Task: | Ruudukko |
Sender: | ossikoo |
Submission time: | 2019-10-10 14:32:32 +0300 |
Language: | Python3 (CPython3) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.02 s | details |
#2 | ACCEPTED | 0.02 s | details |
#3 | WRONG ANSWER | 0.02 s | details |
#4 | WRONG ANSWER | 0.02 s | details |
#5 | WRONG ANSWER | 0.03 s | details |
#6 | WRONG ANSWER | 0.03 s | details |
Code
def generate_empty_grid(n): grid = [] for row in range(0, n): grid.insert(row, [0] * n) return grid def get_int(n_col, n_offset, n): v = n_col + n_offset + 1 if v > n: return v - n else: return v def get_new_offset(cur_offset, n): new_offset = cur_offset + 1 if new_offset > n: new_offset = 0 return new_offset def main(n): grid = generate_empty_grid(n) n_offset = 0 for n_row, row in enumerate(grid): row_string = "" for n_col in range(0, len(row)): v = get_int(n_col, n_offset, n) row[n_col] = v row_string = row_string + str(v) + " " n_offset = get_new_offset(n_offset, n) print(row_string) main(int(input()))
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1 |
correct output |
---|
1 |
user output |
---|
1 |
Test 2
Verdict: ACCEPTED
input |
---|
2 |
correct output |
---|
1 2 2 1 |
user output |
---|
1 2 2 1 |
Test 3
Verdict: WRONG ANSWER
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 3 4 5 1 3 4 5 1 2 4 5 1 2 3 5 1 2 3 4 |
Test 4
Verdict: WRONG ANSWER
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: WRONG ANSWER
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: WRONG ANSWER
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 |