CSES - Datatähti 2020 alku - Results
Submission details
Task:Ruudukko
Sender:tassu
Submission time:2019-09-30 13:29:58 +0300
Language:Python2 (CPython2)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.01 sdetails
#2ACCEPTED0.02 sdetails
#30.01 sdetails
#40.02 sdetails
#50.02 sdetails
#60.02 sdetails

Code

size = int(input())
list_of_lists = [([0] * size) for _ in range(size)]

list_of_lists[0][0] = 1

for i in range(size):
    list_of_lists[i][i] = 1
    list_of_lists[0][i] = i + 1
    list_of_lists[i][0] = i + 1

for i in range(1, size):
    for j in range(1, size):
        if i == j:
            continue

        max_size = max([list_of_lists[i - 1][j], list_of_lists[i][j - 1]])

        list_of_lists[i][j] = max_size + 1

for foo in list_of_lists:
    for char in foo:
        print(char),
    print ""

Test details

Test 1

Verdict: ACCEPTED

input
1

correct output

user output

Test 2

Verdict: ACCEPTED

input
2

correct output
1 2 
2 1 

user output
1 2 
2 1 

Test 3

Verdict:

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 5 6 
3 4 1 6 7 
4 5 6 1 8 
5 6 7 8 1 

Test 4

Verdict:

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:

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:

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