QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#275600 | #7894. Many Many Heads | zyyscj | Compile Error | / | / | C++14 | 725b | 2023-12-04 21:19:16 | 2023-12-04 21:19:16 |
Judging History
你现在查看的是最新测评结果
- [2023-12-06 19:13:14]
- hack成功,自动添加数据
- (//qoj.ac/hack/490)
- [2023-12-04 21:19:16]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-12-04 21:19:16]
- 提交
answer
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> PII;
stack<PII>st;
int main()
{
int t;
cin >> t;
while(t--)
{
string s;
cin >> s;
int num0 = 0;
int num1 = 0;
bool ok1 = 0;
bool ok2 = 0;
for(int j = 0; j < s.size(); j++)
{
if(s[j] == '[' || s[j] == ']')
{
num1++;
}
else
{
if(num1 % 2 == 0) num0++;
}
}
if(num0 >= 3)
{
ok0 = 1;
}
num0 = 0;
num1 = 0;
for(int j = 0; j < s.size(); j++)
{
if(s[j] == '(' || s[j] == ')')
{
num0++;
}
else
{
if(num0 % 2 == 0) num1++;
}
}
if(num1 >= 3)
{
ok1 = 1;
}
if(ok0 && ok1)cout<<"No\n";
else cout << "Yes\n";
}
}
Details
answer.code: In function ‘int main()’: answer.code:30:25: error: ‘ok0’ was not declared in this scope; did you mean ‘ok2’? 30 | ok0 = 1; | ^~~ | ok2 answer.code:49:20: error: ‘ok0’ was not declared in this scope; did you mean ‘ok2’? 49 | if(ok0 && ok1)cout<<"No\n"; | ^~~ | ok2