Task: | Spiraali |
Sender: | severi |
Submission time: | 2021-10-17 13:15:54 +0300 |
Language: | Python3 (PyPy3) |
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.04 s | 1 | details |
#2 | WRONG ANSWER | 0.08 s | 2 | details |
#3 | WRONG ANSWER | 0.08 s | 3 | details |
Code
njat = input().split(" ") n = int(njat[0]) t = int(njat[1]) i = 0 kordinaatit = [] while i < t: kordinaatit.append(input()) i += 1 layers = round(n / 2 + 0.1) i = 0 ruudukko = n * n print(kordinaatit) while i < t: xy = kordinaatit[i].split(" ") y = int(xy[0]) x = int(xy[1]) k = n + 1 - x s = n + 1 - y layer = x if y < x: layer = y if s < layer: layer = s if k < layer: layer = k inner = n - (2 * (layer - 1)) ekaruutu = ruudukko - inner * inner + 1 if x == layer: vastaus = y - layer + ekaruutu elif s == layer: vastaus = x - layer + ekaruutu + inner - 1 elif y == layer: vastaus = ekaruutu + inner + inner + inner - 3 + k - layer else: vastaus = ekaruutu + inner + inner - 2 + s - layer print(vastaus) i += 1
Test details
Test 1
Group: 1
Verdict: WRONG ANSWER
input |
---|
10 100 1 1 1 2 1 3 1 4 ... |
correct output |
---|
1 36 35 34 33 ... |
user output |
---|
['1 1', '1 2', '1 3', '1 4', '... Truncated |
Test 2
Group: 2
Verdict: WRONG ANSWER
input |
---|
1000 1000 371 263 915 322 946 880 53 738 ... |
correct output |
---|
773533 312166 206053 200080 593922 ... |
user output |
---|
['371 263', '915 322', '946 88... Truncated |
Test 3
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000000000 1000 177757853 827347032 409613589 419171337 739269360 256524697 328695530 896842209 ... |
correct output |
---|
571375684522141210 967321186816598569 762879105851175000 370065046779516790 936897883750373771 ... |
user output |
---|
['177757853 827347032', '40961... Truncated |