题解
2023-07-16 14:08:31
发布于:日本
10阅读
0回复
0点赞
/***************************************
代码名称(题目序号/链接):
作者:校溯(米哈游miHoYo)
邮箱:xiaosu-1009@qq.com
编写时间:
***************************************/
//解决爆栈,手动加栈,必须放在头文件之前
#pragma comment(linker,"/STACK:1024000000,1024000000")
//万能头文件(非特殊情况勿用!)
// #include <bits/stdc++.h>
//常用头文件
//STL专用,使用了哪种数据结构,就要用到哪种头文件
#include <map>
#include <vector>
#include <set>
//C++必备头文件,cin、cout及其相关函数在这里
#include <iostream>
//strlen()、strcat()等字符串操作函数在这里
#include <cstring>
//min()、max()等在这里
#include <cstdlib>
//scanf()、printf()以及和它们长得像的函数在这里
#include <cstdio>
//sort()在这里
#include <algorithm>
//log()、sin()、pow()等数学运算的函数在这里
#include <cmath>
//long long 简化为 ll
typedef long long ll;
//使用命名空间
using namespace std;
//全局区
char s[265];
int TOP=0;
//主函数
int main(){
// cin/cout加速(只能放主函数里面)
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
//代码区
char x;
while(cin>>x){
if(x=='@') break;
if(TOP==0){
if(x==')'){
cout<<"NO";
return 0;
}
}
if(x=='(')s[++TOP]=x;
if(x==')')--TOP;
}
if(TOP==0) cout<<"YES";
else cout<<"NO";
return 0;
}
这里空空如也
有帮助,赞一个