QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#456509#4824. Bracket-and-bar SequencesFaggi0 7ms3848kbC++20660b2024-06-28 05:31:512024-06-28 05:31:51

Judging History

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

  • [2024-06-28 05:31:51]
  • 评测
  • 测评结果:0
  • 用时:7ms
  • 内存:3848kb
  • [2024-06-28 05:31:51]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long t,a,i;
    bool op=1;
    string s;
    char ch;
    cin >> s;
    cin >> t;
    while(t--)
    {
        cin >> a;
        for(i=0; i<a*3; i++)
        {
            cin >> ch;
            if(ch=='1')
            cout << '(';
            else if(ch=='2')
            cout << '|';
            else if(ch=='3')
            cout << ')';
            else if(ch=='(')
            cout << '1';
            else if(ch=='|')
            cout << '2';
            else if(ch==')')
            cout << '3';
        }
        cout << '\n';
    }
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

encode
3
1
(|)
4
((((|)|)|)|)
5
(|(|))((|(|))|)

output:

123
111123232323
121233112123323

input:

decode
3
1
123
4
111123232323
5
121233112123323

output:

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

result:

ok 3 lines

Test #2:

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

input:

encode
1
1
(|)

output:

123

input:

decode
1
1
123

output:

(|)

result:

ok single line: '(|)'

Test #3:

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

input:

encode
3
2
((|)|)
1
(|)
2
(|(|))

output:

112323
123
121233

input:

decode
3
2
112323
1
123
2
121233

output:

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

result:

ok 3 lines

Test #4:

score: 100
Accepted
time: 7ms
memory: 3572kb

input:

encode
1000
3
(|)(|)(|)
3
(|)(|(|))
3
(|)((|)|)
3
(|(|))(|)
3
(|(|)(|))
3
(|(|(|)))
3
(|((|)|))
3
((|)|)(|)
3
((|)|(|))
3
((|)(|)|)
3
((|(|))|)
3
(((|)|)|)
4
(|)(|)(|)(|)
4
(|)(|)(|(|))
4
(|)(|)((|)|)
4
(|)(|(|))(|)
4
(|)(|(|)(|))
4
(|)(|(|(|)))
4
(|)(|((|)|))
4
(|)((|)|)(|)
4
(|)((|)|(|))
4
(|)((|)...

output:

123123123
123121233
123112323
121233123
121231233
121212333
121123233
112323123
112321233
112312323
112123323
111232323
123123123123
123123121233
123123112323
123121233123
123121231233
123121212333
123121123233
123112323123
123112321233
123112312323
123112123323
123111232323
121233123123
12123312123...

input:

decode
1000
3
123123123
3
123121233
3
123112323
3
121233123
3
121231233
3
121212333
3
121123233
3
112323123
3
112321233
3
112312323
3
112123323
3
111232323
4
123123123123
4
123123121233
4
123123112323
4
123121233123
4
123121231233
4
123121212333
4
123121123233
4
123112323123
4
123112321233
4
1231123...

output:

(|)(|)(|)
(|)(|(|))
(|)((|)|)
(|(|))(|)
(|(|)(|))
(|(|(|)))
(|((|)|))
((|)|)(|)
((|)|(|))
((|)(|)|)
((|(|))|)
(((|)|)|)
(|)(|)(|)(|)
(|)(|)(|(|))
(|)(|)((|)|)
(|)(|(|))(|)
(|)(|(|)(|))
(|)(|(|(|)))
(|)(|((|)|))
(|)((|)|)(|)
(|)((|)|(|))
(|)((|)(|)|)
(|)((|(|))|)
(|)(((|)|)|)
(|(|))(|)(|)
(|(|))(|(|)...

result:

ok 1000 lines

Test #5:

score: 0
Wrong Answer on the first run

input:

encode
1000
6
(|((((|)|)|)|)(|))
6
(|((|)(|)(|)|(|)))
6
(|((|)(|(|))|(|)))
6
(|((|)((|)|)|(|)))
6
(|((|(|))(|)|(|)))
6
(|((|(|)(|))|(|)))
6
(|((|(|(|)))|(|)))
6
(|((|((|)|))|(|)))
6
(|(((|)|)(|)|(|)))
6
(|(((|)|(|))|(|)))
6
(|(((|)(|)|)|(|)))
6
(|(((|(|))|)|(|)))
6
(|((((|)|)|)|(|)))
6
(|((|)(|)(|)(...

output:

121111232323231233
121123123123212333
121123121233212333
121123112323212333
121121233123212333
121121231233212333
121121212333212333
121121123233212333
121112323123212333
121112321233212333
121112312323212333
121112123323212333
121111232323212333
121123123123123233
121123123121233233
121123123112323...

input:


output:


result:

wrong output format Expected integer, but "123123123123123123123" found (test case 769)