Submission details
Task:Ruudukko
Sender:Metabolix
Submission time:2025-11-28 23:54:47 +0200
Language:Python3 (CPython3)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.02 s1, 2, 3details
#20.02 s2, 3details
#30.02 s2, 3details
#40.02 s3details
#50.02 s3details

Code

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
rivit = [0] * (n+1)
for i in range(m):
    y1, x1, y2, x2 = map(int, input().split())
    rivit[y1] ^= 1 << x1
    rivit[y1] ^= 1 << (x2 + 1)
    rivit[y2 + 1] ^= 1 << x1
    rivit[y2 + 1] ^= 1 << (x2 + 1)

rivi = 8 << n
for i in range(1, n+1):
    rivi ^= rivit[i]
    x = 0
    for j in range(1, n+1):
        if rivi & (1 << j):
            x ^= 1
        print(".#"[x], end="")
    print()

Test details

Test 1

Group: 1, 2, 3

Verdict:

input
10 100
6 7 8 9
2 6 7 10
7 5 9 6
6 1 6 2
...

correct output
..##..##..
##....##.#
..####..##
##.##.....
####....##
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 10, in <module>
    rivit[y2 + 1] ^= 1 << x1
IndexError: list index out of range

Test 2

Group: 2, 3

Verdict:

input
500 100000
133 109 167 178
204 337 481 477
242 476 445 485
452 198 460 321
...

correct output
.##....####.####..##....#.##.#...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 10, in <module>
    rivit[y2 + 1] ^= 1 << x1
IndexError: list index out of range

Test 3

Group: 2, 3

Verdict:

input
500 100000
33 7 485 482
50 38 456 459
34 20 479 493
13 6 479 485
...

correct output
.....#.####.#.#...####.##....#...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 10, in <module>
    rivit[y2 + 1] ^= 1 << x1
IndexError: list index out of range

Test 4

Group: 3

Verdict:

input
2000 100000
126 95 1489 1619
1473 29 1697 78
1290 1031 1588 1047
1209 1794 1546 1818
...

correct output
..........................####...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 10, in <module>
    rivit[y2 + 1] ^= 1 << x1
IndexError: list index out of range

Test 5

Group: 3

Verdict:

input
2000 100000
55 51 1842 1905
47 60 1997 1890
117 45 1920 1840
48 175 1987 1852
...

correct output
#.#...#...###.#...#####..####....

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 10, in <module>
    rivit[y2 + 1] ^= 1 << x1
IndexError: list index out of range