Task: | Sulut |
Sender: | cppbetter |
Submission time: | 2024-01-20 14:05:23 +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 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#2 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#3 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#4 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#5 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#6 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#7 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#8 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#9 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#10 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#11 | ACCEPTED | 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 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#15 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#16 | ACCEPTED | 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 | ACCEPTED | 0.00 s | 2, 3 | details |
#21 | RUNTIME ERROR | 0.00 s | 2, 3 | details |
#22 | RUNTIME ERROR | 0.00 s | 2, 3 | details |
#23 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#24 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#25 | ACCEPTED | 0.02 s | 3 | details |
#26 | RUNTIME ERROR | 0.02 s | 3 | details |
#27 | RUNTIME ERROR | 0.02 s | 3 | details |
#28 | RUNTIME ERROR | 0.02 s | 3 | details |
#29 | WRONG ANSWER | 0.00 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:72:25: warning: comparison of integer expressions of different signedness: 'll' {aka 'long int'} and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 72 | for(ll i = 0; i < c.size(); i++) { | ~~^~~~~~~~~~
Code
#include <bits/stdc++.h> using namespace std; using ll = int64_t; // ((((())))) // ()()()()() // 0|0|00|0|0 // ()() // ((())) // ()()() // ()()()()() //#define TEST int main() { ll n, k; #ifndef TEST cin >> n >> k; #endif #ifdef TEST for(ll x = 1; x < 10; x++) { for(ll y = 0; y <= x; y++) { n = x; k = y; #endif if(k % 2 != 0 || n % 2 != 0 || k > n/2) { cout << "IMPOSSIBLE\n"; } else { string s; for(ll i = 0; i < n/2; i++) s += "("; for(ll i = 0; i < n/2; i++) s += ")"; string c = s; if(n == 4 && k == 2) { c = "()()"; } else { ll center = n/2 - 1; for(ll i = 0; i < k/2; i++) { c[center] = ')'; c[center + 2] = '('; center--; } } #if 1 // CHECK ll t = 0; for(auto e : c) { if(e == '(') t++; else t--; if(t < 0) throw runtime_error("False"); } if(t != 0) throw runtime_error("False"); for(auto e : s) { if(e == '(') t++; else t--; if(t < 0) throw runtime_error("False"); } if(t != 0) throw runtime_error("False"); for(ll i = 0; i < c.size(); i++) { if(c[i] != s[i]) t++; if(t > k) throw runtime_error("False"); } if(t != k) throw runtime_error("False"); #endif cout << c << "\n"; cout << s << "\n"; } #ifdef TEST } } #endif }
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
2 0 |
correct output |
---|
() () |
user output |
---|
() () |
Test 2
Group: 1, 2, 3
Verdict: ACCEPTED
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: ACCEPTED
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: WRONG ANSWER
input |
---|
6 4 |
correct output |
---|
()()() (()()) |
user output |
---|
IMPOSSIBLE |
Test 7
Group: 1, 2, 3
Verdict: ACCEPTED
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: WRONG ANSWER
input |
---|
8 6 |
correct output |
---|
()()()() (()()()) |
user output |
---|
IMPOSSIBLE |
Test 11
Group: 1, 2, 3
Verdict: ACCEPTED
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: WRONG ANSWER
input |
---|
10 6 |
correct output |
---|
()()()()() ()(()()()) |
user output |
---|
IMPOSSIBLE |
Test 15
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
10 8 |
correct output |
---|
()()()()() (()()()()) |
user output |
---|
IMPOSSIBLE |
Test 16
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
4 1 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
IMPOSSIBLE |
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: ACCEPTED
input |
---|
100 0 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
((((((((((((((((((((((((((((((... Truncated |
Test 21
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 10 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
(empty) |
Error:
terminate called after throwing an instance of 'std::runtime_error' what(): False
Test 22
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 42 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
(empty) |
Error:
terminate called after throwing an instance of 'std::runtime_error' what(): False
Test 23
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 80 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
IMPOSSIBLE |
Test 24
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 98 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
IMPOSSIBLE |
Test 25
Group: 3
Verdict: ACCEPTED
input |
---|
1000000 0 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
((((((((((((((((((((((((((((((... Truncated |
Test 26
Group: 3
Verdict: RUNTIME ERROR
input |
---|
1000000 42 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
(empty) |
Error:
terminate called after throwing an instance of 'std::runtime_error' what(): False
Test 27
Group: 3
Verdict: RUNTIME ERROR
input |
---|
1000000 4242 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
(empty) |
Error:
terminate called after throwing an instance of 'std::runtime_error' what(): False
Test 28
Group: 3
Verdict: RUNTIME ERROR
input |
---|
1000000 424242 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
(empty) |
Error:
terminate called after throwing an instance of 'std::runtime_error' what(): False
Test 29
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000000 999998 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
IMPOSSIBLE |