题目传送门
代码来啦
#include <bits/stdc++.h>
using namespace std;
int n;
string s;
bool flag(){
if(n % 2 == 0) return false;
int x = (1 + n) / 2 - 1;
if(s[x] != '/') return false;
for(int i = 1 ; i < x ; i ++)
if(s[i] != '1') return false;
for(int i = x + 1 ; i < n ; i ++)
if(s[i] != '2') return false;
return true;
}
int main(){
cin >> n >> s;
if(flag()) cout << "Yes";
else cout << "No";
return 0;
}
附上新鲜的翻译