Task: | Sulut |
Sender: | a256 |
Submission time: | 2024-01-20 14:42:04 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#3 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#4 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#5 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#6 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#7 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#8 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#9 | ACCEPTED | 0.01 s | 1, 2, 3 | details |
#10 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#11 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#12 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#13 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#14 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#15 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#16 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#17 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#18 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#19 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#20 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#21 | ACCEPTED | 0.00 s | 2, 3 | details |
#22 | ACCEPTED | 0.00 s | 2, 3 | details |
#23 | ACCEPTED | 0.00 s | 2, 3 | details |
#24 | ACCEPTED | 0.00 s | 2, 3 | details |
#25 | WRONG ANSWER | 0.01 s | 3 | details |
#26 | ACCEPTED | 0.01 s | 3 | details |
#27 | ACCEPTED | 0.01 s | 3 | details |
#28 | ACCEPTED | 0.01 s | 3 | details |
#29 | ACCEPTED | 0.01 s | 3 | details |
Code
#include <bits/stdc++.h> using namespace std; #define F first #define S second #define N ((int)1e6+100) char A[N],B[N]; int n,k; int construct(char *A,int k){ A[k-1]='('; int l=k-1; int r=n-l-1; if((l&1)==(r&1)) return 0; A[n-1]=')'; --r; if(l&1){ A[n-2]=')'; for(int i=0;i+1<l;i+=2){ A[i]='('; A[i+1]=')'; } A[l-1]='('; --r; for(int i=0;i+1<r;i+=2){ A[k+i]='('; A[k+i+1]=')'; } } else { for(int i=0;i+1<l;i+=2){ A[i]='('; A[i+1]=')'; } for(int i=0;i+1<r;i+=2){ A[k+i]='('; A[k+i+1]=')'; } } return 1; } int main(){ cin>>n>>k; for(int i=0;i<n;++i) A[i]=B[i]='.'; if((n&1)||n==k||n==1){ cout<<"IMPOSSIBLE\n"; return 0; } if(!construct(A,k)){ cout<<"IMPOSSIBLE\n"; return 0; } if(!construct(B,n-k+1)){ cout<<"IMPOSSIBLE\n"; return 0; } reverse(B,B+n); for(int i=0;i<n;++i){ if(B[i]=='(') B[i]=')'; else B[i]='('; } cout<<A<<'\n'<<B<<'\n'; }
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
2 0 |
correct output |
---|
() () |
user output |
---|
)) ()( |
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
4 0 |
correct output |
---|
()() ()() |
user output |
---|
())) ()()( |
Test 3
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
4 2 |
correct output |
---|
()() (()) |
user output |
---|
(()) ()() |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
6 0 |
correct output |
---|
()()() ()()() |
user output |
---|
()())) ()()()( |
Test 5
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 2 |
correct output |
---|
()()() ()(()) |
user output |
---|
((())) ()()() |
Test 6
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
6 4 |
correct output |
---|
()()() (()()) |
user output |
---|
()(()) (())() |
Test 7
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
8 0 |
correct output |
---|
()()()() ()()()() |
user output |
---|
()()())) ()()()()( |
Test 8
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
8 2 |
correct output |
---|
()()()() ()()(()) |
user output |
---|
((()())) ()()()() |
Test 9
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
8 4 |
correct output |
---|
()()()() ()(()()) |
user output |
---|
()((())) (())()() |
Test 10
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
8 6 |
correct output |
---|
()()()() (()()()) |
user output |
---|
()()(()) (()())() |
Test 11
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
10 0 |
correct output |
---|
()()()()() ()()()()() |
user output |
---|
()()()())) ()()()()()( |
Test 12
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
10 2 |
correct output |
---|
()()()()() ()()()(()) |
user output |
---|
((()()())) ()()()()() |
Test 13
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
10 4 |
correct output |
---|
()()()()() ()()(()()) |
user output |
---|
()((()())) (())()()() |
Test 14
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
10 6 |
correct output |
---|
()()()()() ()(()()()) |
user output |
---|
()()((())) (()())()() |
Test 15
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
10 8 |
correct output |
---|
()()()()() (()()()()) |
user output |
---|
()()()(()) (()()())() |
Test 16
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
4 1 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
(()) ()() |
Test 17
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
4 4 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
IMPOSSIBLE |
Test 18
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
5 1 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
IMPOSSIBLE |
Test 19
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
5 2 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
IMPOSSIBLE |
Test 20
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 0 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
()()()()()()()()()()()()()()()... Truncated |
Test 21
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 10 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
()()()()((()()()()()()()()()()... Truncated |
Test 22
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 42 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
()()()()()()()()()()()()()()()... Truncated |
Test 23
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 80 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
()()()()()()()()()()()()()()()... Truncated |
Test 24
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 98 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
()()()()()()()()()()()()()()()... Truncated |
Test 25
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000000 0 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
()()()()()()()()()()()()()()()... Truncated |
Test 26
Group: 3
Verdict: ACCEPTED
input |
---|
1000000 42 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
()()()()()()()()()()()()()()()... Truncated |
Test 27
Group: 3
Verdict: ACCEPTED
input |
---|
1000000 4242 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
()()()()()()()()()()()()()()()... Truncated |
Test 28
Group: 3
Verdict: ACCEPTED
input |
---|
1000000 424242 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
()()()()()()()()()()()()()()()... Truncated |
Test 29
Group: 3
Verdict: ACCEPTED
input |
---|
1000000 999998 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
()()()()()()()()()()()()()()()... Truncated |