QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#433413#2397. Eye of SauronJustJie#AC ✓1ms3852kbC++20976b2024-06-08 10:56:492024-06-08 10:56:51

Judging History

你现在查看的是最新测评结果

  • [2024-06-08 10:56:51]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3852kb
  • [2024-06-08 10:56:49]
  • 提交

answer

/***************************************************************************************************
 * author : Jie Chen (4th Year CS)
 * school : Rochester Institute of Technology
 * created: 06.07.2024 22:54:32
****************************************************************************************************/
#include "bits/stdc++.h"

using namespace std;

using i64 = long long;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    string s;
    cin >> s;
    int n = s.size();

    if (n % 2 == 0) {
        for (int i = 0; i < n / 2 - 1; i++) {
            if (s[i] != '|') {
                cout << "fix\n";
                return 0;
            }
            if (s[n - i - 1] != '|') {
                cout << "fix\n";
                return 0;
            }
        }
        cout << (s.substr(n / 2 - 1, 2) == "()" ? "correct" : "fix") << "\n";
    } else {
        cout << "fix\n";
    }
}

// ~ Just Jie

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3656kb

input:

|()||

output:

fix

result:

ok single line: 'fix'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3628kb

input:

||||()||||

output:

correct

result:

ok single line: 'correct'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3792kb

input:

|()|

output:

correct

result:

ok single line: 'correct'

Test #4:

score: 0
Accepted
time: 1ms
memory: 3628kb

input:

|||()|

output:

fix

result:

ok single line: 'fix'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3848kb

input:

|||||||||||||||||||||||||||||||||||||||||||||||||()|||||||||||||||||||||||||||||||||||||||||||||||||

output:

correct

result:

ok single line: 'correct'

Test #6:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

|||||||||||||||||||||||||||||||||||||||()|||||||||||||||||||||||||||||||||||||||||

output:

fix

result:

ok single line: 'fix'

Test #7:

score: 0
Accepted
time: 1ms
memory: 3564kb

input:

||||||||||||||||||||||||()||||||||||||||||||||||||

output:

correct

result:

ok single line: 'correct'

Test #8:

score: 0
Accepted
time: 1ms
memory: 3852kb

input:

|||||||||||||||||||||||||()|||||||||||||||||||||||

output:

fix

result:

ok single line: 'fix'

Test #9:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

|||||||||||||||||||||||()|||||||||||||||||||||||||

output:

fix

result:

ok single line: 'fix'

Test #10:

score: 0
Accepted
time: 1ms
memory: 3564kb

input:

||()|

output:

fix

result:

ok single line: 'fix'