QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#19230#2397. Eye of SauronQingyuAC ✓3ms3636kbC++20341b2022-01-28 15:33:082022-05-06 04:29:22

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-06 04:29:22]
  • Judged
  • Verdict: AC
  • Time: 3ms
  • Memory: 3636kb
  • [2022-01-28 15:33:08]
  • Submitted

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'