第三个点WA了,下载数据后答案是对的,求助
查看原帖
第三个点WA了,下载数据后答案是对的,求助
218226
ZXCVB123楼主2020/10/4 17:06
#include<bits/stdc++.h>
using namespace std;
string s;
int cnt;
char zh[260];
int main(){
	cin>>s;
	for(int i=0;i<s.size();i++){
		if(s[i]=='(') zh[++cnt]='(';
		if(s[i]==')' && zh[cnt]=='(') cnt--;
	}
	if(cnt) printf("NO\n");
	else printf("YES\n");
	return 0;
}

rt

2020/10/4 17:06
加载中...