Task: | Kolmijako |
Sender: | Ugi |
Submission time: | 2021-01-23 16:53:49 +0200 |
Language: | Python3 (PyPy3) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.05 s | 1, 2 | details |
#2 | ACCEPTED | 0.05 s | 1, 2 | details |
#3 | WRONG ANSWER | 0.05 s | 1, 2 | details |
#4 | WRONG ANSWER | 0.05 s | 1, 2 | details |
#5 | ACCEPTED | 0.05 s | 1, 2 | details |
#6 | WRONG ANSWER | 0.05 s | 1, 2 | details |
#7 | WRONG ANSWER | 0.05 s | 1, 2 | details |
#8 | ACCEPTED | 0.05 s | 1, 2 | details |
#9 | WRONG ANSWER | 0.05 s | 2 | details |
#10 | WRONG ANSWER | 0.05 s | 2 | details |
#11 | WRONG ANSWER | 0.05 s | 2 | details |
#12 | ACCEPTED | 0.05 s | 2 | details |
#13 | WRONG ANSWER | 0.05 s | 2 | details |
#14 | WRONG ANSWER | 0.05 s | 2 | details |
#15 | ACCEPTED | 0.05 s | 2 | details |
Code
num = int(input()) sum1 = sum(range(num+1)) checks = [True for x in range(num+1)] def main(): if num == 3: print("1 2 3") return if (sum1)%3 != 0: print("IMPOSSIBLE") return aim = sum1//3 li = {} num2 = 0 last = 0 for x in range(1,num+1)[::-1]: print(x + num2 , aim , aim-num2 , x) if x + num2 <= aim and aim-num2 >= x: last = x num2 += x li[x] = 1 else: break save = aim-num2 li[save] = 1 num3 = 0 for x in range(1,last)[::-1]: if x + num3 <= aim and aim-num3 >= x: if x != save: last = x num3 += x li[x] = 2 print(" ".join(map(str,[li.get(x,3) for x in range(1,num+1)]))) main()
Test details
Test 1
Group: 1, 2
Verdict: ACCEPTED
input |
---|
3 |
correct output |
---|
1 2 3 |
user output |
---|
1 2 3 |
Test 2
Group: 1, 2
Verdict: ACCEPTED
input |
---|
4 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
IMPOSSIBLE |
Test 3
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
5 |
correct output |
---|
1 3 1 3 2 |
user output |
---|
5 5 5 5 9 5 0 4 2 3 3 2 1 |
Test 4
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
6 |
correct output |
---|
1 3 2 2 1 3 |
user output |
---|
6 7 7 6 11 7 1 5 1 2 3 3 2 1 |
Test 5
Group: 1, 2
Verdict: ACCEPTED
input |
---|
7 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
IMPOSSIBLE |
Test 6
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
8 |
correct output |
---|
2 3 1 2 3 3 2 1 |
user output |
---|
8 12 12 8 15 12 4 7 3 3 3 1 2 3 2 1 |
Test 7
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
9 |
correct output |
---|
1 2 3 1 2 3 3 2 1 |
user output |
---|
9 15 15 9 17 15 6 8 3 3 3 3 3 1 2 2 1 |
Test 8
Group: 1, 2
Verdict: ACCEPTED
input |
---|
10 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
IMPOSSIBLE |
Test 9
Group: 2
Verdict: WRONG ANSWER
input |
---|
42 |
correct output |
---|
1 3 2 2 1 3 1 2 3 3 2 1 1 2 3 ... |
user output |
---|
42 301 301 42 83 301 259 41 123 301 218 40 162 301 178 39 200 301 139 38 ... Truncated |
Test 10
Group: 2
Verdict: WRONG ANSWER
input |
---|
95 |
correct output |
---|
1 3 1 3 2 1 2 3 3 2 1 1 2 3 3 ... |
user output |
---|
95 1520 1520 95 189 1520 1425 94 282 1520 1331 93 374 1520 1238 92 465 1520 1146 91 ... Truncated |
Test 11
Group: 2
Verdict: WRONG ANSWER
input |
---|
96 |
correct output |
---|
1 3 2 2 1 3 1 2 3 3 2 1 1 2 3 ... |
user output |
---|
96 1552 1552 96 191 1552 1456 95 285 1552 1361 94 378 1552 1267 93 470 1552 1174 92 ... Truncated |
Test 12
Group: 2
Verdict: ACCEPTED
input |
---|
97 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
IMPOSSIBLE |
Test 13
Group: 2
Verdict: WRONG ANSWER
input |
---|
98 |
correct output |
---|
2 3 1 2 3 3 2 1 1 2 3 3 2 1 1 ... |
user output |
---|
98 1617 1617 98 195 1617 1519 97 291 1617 1422 96 386 1617 1326 95 480 1617 1231 94 ... Truncated |
Test 14
Group: 2
Verdict: WRONG ANSWER
input |
---|
99 |
correct output |
---|
1 2 3 1 2 3 3 2 1 1 2 3 3 2 1 ... |
user output |
---|
99 1650 1650 99 197 1650 1551 98 294 1650 1453 97 390 1650 1356 96 485 1650 1260 95 ... Truncated |
Test 15
Group: 2
Verdict: ACCEPTED
input |
---|
100 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
IMPOSSIBLE |