QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#19230 | #2397. Eye of Sauron | Qingyu | AC ✓ | 3ms | 3636kb | C++20 | 341b | 2022-01-28 15:33:08 | 2022-05-06 04:29:22 |
Judging History
answer
#include <bits/stdc++.h>
int main() {
std::string s;
std::cin >> s;
if (s.length() % 2 ) {
puts("fix");
return 0;
}
int n = s.length(), m = (n - 2) / 2;
int tot = 0;
for (char ch : s) {
if (ch == '(') break;
++tot;
}
puts(tot == m ? "correct" : "fix");
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3536kb
input:
|()||
output:
fix
result:
ok single line: 'fix'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3612kb
input:
||||()||||
output:
correct
result:
ok single line: 'correct'
Test #3:
score: 0
Accepted
time: 3ms
memory: 3624kb
input:
|()|
output:
correct
result:
ok single line: 'correct'
Test #4:
score: 0
Accepted
time: 3ms
memory: 3588kb
input:
|||()|
output:
fix
result:
ok single line: 'fix'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
|||||||||||||||||||||||||||||||||||||||||||||||||()|||||||||||||||||||||||||||||||||||||||||||||||||
output:
correct
result:
ok single line: 'correct'
Test #6:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
|||||||||||||||||||||||||||||||||||||||()|||||||||||||||||||||||||||||||||||||||||
output:
fix
result:
ok single line: 'fix'
Test #7:
score: 0
Accepted
time: 3ms
memory: 3636kb
input:
||||||||||||||||||||||||()||||||||||||||||||||||||
output:
correct
result:
ok single line: 'correct'
Test #8:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
|||||||||||||||||||||||||()|||||||||||||||||||||||
output:
fix
result:
ok single line: 'fix'
Test #9:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
|||||||||||||||||||||||()|||||||||||||||||||||||||
output:
fix
result:
ok single line: 'fix'
Test #10:
score: 0
Accepted
time: 3ms
memory: 3624kb
input:
||()|
output:
fix
result:
ok single line: 'fix'