| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 65600 | 李志奇 | 07切比雪夫距离 | C++ | Wrong Answer | 3 MS | 272 KB | 287 | 2024-01-26 13:13:35 |
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; stack<char> a; for(int i=0;i<s.size();i++){ if(s[i]=='('){ a.push(s[i]); } if(s[i]==')' && !a.empty()){ a.pop(); } } if(a.empty()){ cout<<"YES"; }else{ cout<<"NO"; } }
------Input------
37 85 25 78
------Answer-----
12
------Your output-----
YES