Task: | Ruudukko |
Sender: | VirtuesL |
Submission time: | 2019-10-12 16:27:59 +0300 |
Language: | Python3 (CPython3) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
test | verdict | time | |
---|---|---|---|
#1 | RUNTIME ERROR | 0.02 s | details |
#2 | RUNTIME ERROR | 0.02 s | details |
#3 | RUNTIME ERROR | 0.02 s | details |
#4 | RUNTIME ERROR | 0.02 s | details |
#5 | RUNTIME ERROR | 0.02 s | details |
#6 | RUNTIME ERROR | 0.02 s | details |
Code
import numpy as npx = int(input())fl = np.zeros((x,x), dtype='int')fl[0] = [i+1 for i in range(x)]def swapRow(lt):tmp = [i for i in lt]for i in range(0,x,2):try:a = tmp[i+1]tmp[i+1] = tmp[i]tmp[i] = aexcept IndexError:a = tmp[i]tmp[i] = tmp[i-1]tmp[i-1] = areturn tmpdef conflict(lt,l):for i, val in enumerate(lt):if val in fl[:,i][:l]:return (i,val)def correct(lt,l):for i, _ in enumerate(lt):conf = conflict(lt,l)if conf:pos, val = confif val not in fl[:,x-(i+1)][:l]:lt[pos] = lt[x-(i+1)]lt[x-(i+1)] = valdef swap2Row(lt):tmp = [i for i in lt]for i in range(x-2):a = tmp[i+2]tmp[i+2] = tmp[i]tmp[i] = aif len(tmp)%2 == 0:passelse:a = tmp[x-1]tmp[x-1] = tmp[x-2]tmp[x-2] = areturn tmpfl[1] = swapRow(fl[0])for i, row in enumerate(fl[:x-2]):fl[i+2] = swap2Row(row)correct(fl[i+2],i+2)for l in fl:print(" ".join(map(str,l)))
Test details
Test 1
Verdict: RUNTIME ERROR
input |
---|
1 |
correct output |
---|
1 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 1, in <module> import...
Test 2
Verdict: RUNTIME ERROR
input |
---|
2 |
correct output |
---|
1 2 2 1 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 1, in <module> import...
Test 3
Verdict: RUNTIME ERROR
input |
---|
5 |
correct output |
---|
1 2 3 4 5 2 1 4 3 6 3 4 1 2 7 4 3 2 1 8 5 6 7 8 1 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 1, in <module> import...
Test 4
Verdict: RUNTIME ERROR
input |
---|
42 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 1, in <module> import...
Test 5
Verdict: RUNTIME ERROR
input |
---|
99 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 1, in <module> import...
Test 6
Verdict: RUNTIME ERROR
input |
---|
100 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 1, in <module> import...