CSES - Datatähti 2020 alku - Results
Submission details
Task:Ruudukko
Sender:Ugi
Submission time:2019-10-12 11:42:56 +0300
Language:Python3 (PyPy3)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.05 sdetails
#2ACCEPTED0.05 sdetails
#3ACCEPTED0.05 sdetails
#4ACCEPTED0.07 sdetails
#5ACCEPTED0.26 sdetails
#6ACCEPTED0.27 sdetails

Code

l1 = int(input())
li = []
for x in range(l1):
    li2 = []
    y = 0
    count = 0
    while len(li2) != l1:
        count += 1
        for t in range(1,2*l1):
            if t not in li2 and t not in [z[y] for z in li]:
                li2.append(t)
                y += 1
                break
    li.append(li2)
print("\n".join(map(str,[" ".join(map(str,x)) for x in li])))

Test details

Test 1

Verdict: ACCEPTED

input
1

correct output

user output
1

Test 2

Verdict: ACCEPTED

input
2

correct output
1 2 
2 1 

user output
1 2
2 1

Test 3

Verdict: ACCEPTED

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
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

Test 4

Verdict: ACCEPTED

input
42

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...
Truncated

Test 5

Verdict: ACCEPTED

input
99

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...
Truncated

Test 6

Verdict: ACCEPTED

input
100

correct output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
1 2 3 4 5 6 7 8 9 10 11 12 13 ...
Truncated