| Task: | Abandoned warehouse |
| Sender: | jonnymorgan |
| Submission time: | 2025-09-08 17:28:36 +0300 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | RUNTIME ERROR | 0.06 s | details |
| #2 | RUNTIME ERROR | 0.06 s | details |
| #3 | RUNTIME ERROR | 0.06 s | details |
| #4 | RUNTIME ERROR | 0.06 s | details |
| #5 | RUNTIME ERROR | 0.06 s | details |
| #6 | RUNTIME ERROR | 0.07 s | details |
| #7 | RUNTIME ERROR | 0.06 s | details |
| #8 | RUNTIME ERROR | 0.07 s | details |
| #9 | RUNTIME ERROR | 0.06 s | details |
| #10 | RUNTIME ERROR | 0.07 s | details |
| #11 | RUNTIME ERROR | 0.06 s | details |
| #12 | RUNTIME ERROR | 0.07 s | details |
| #13 | RUNTIME ERROR | 0.06 s | details |
| #14 | RUNTIME ERROR | 0.06 s | details |
| #15 | RUNTIME ERROR | 0.06 s | details |
| #16 | RUNTIME ERROR | 0.07 s | details |
Code
n, m = [int(x) for x in input().split()]
classroom = [[] for i in range(n + 1)]
for i in range(m):
a, b = [int(x) for x in input().split()]
classroom[a].append(b)
classroom[b].append(a)
team = [0] * (n + 1)
print(*classroom)
def assign2(start):
for i in classroom[start]:
if not set(classroom[i]).intersection(classroom[start]):
team[i] = 2
else:
return True
return False
impossible = False
for i in range(1, n + 1):
if team[i] == 0:
team[i] = 1
impossible = assign2(i)
if impossible:
break
if not impossible:
del team[0]
print(*team)
else:
print("IMPOSSIBLE")
Test details
Test 1
Verdict: RUNTIME ERROR
| input |
|---|
| 10 10 ##.A###### #.##.##.## #####..### .######### ... |
| correct output |
|---|
| NO |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 2
Verdict: RUNTIME ERROR
| input |
|---|
| 10 10 B#..##.#.. #....A##.. #.....#..# .#......#. ... |
| correct output |
|---|
| NO |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 3
Verdict: RUNTIME ERROR
| input |
|---|
| 10 10 ...#..A.#. ....B...## ...#...... .......... ... |
| correct output |
|---|
| YES 3 LLD |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 4
Verdict: RUNTIME ERROR
| input |
|---|
| 10 10 .#........ .......... .......... ........#. ... |
| correct output |
|---|
| YES 1 R |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 5
Verdict: RUNTIME ERROR
| input |
|---|
| 10 10 .......... .......... .......... .......... ... |
| correct output |
|---|
| YES 3 RDD |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 6
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 1000 ##.###..######.#########.###.#... |
| correct output |
|---|
| NO |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 7
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 1000 ####.#.###....#.......##.##.#.... |
| correct output |
|---|
| YES 626 LLLDDRDDDDLDLDDLLLLLDDDDLLDLDL... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 8
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 1000 ....#.##......#....#......#...... |
| correct output |
|---|
| YES 364 LULULLULLLULLLLLUULLLLUUULLLLL... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 9
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 1000 .................#......#........ |
| correct output |
|---|
| YES 1003 LLLLLLLLLLLLLLLLLLLLLLLLLDLLLL... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 10
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 1000 ................................. |
| correct output |
|---|
| YES 947 LLLLLLLLLLLLLLLLLLLLLLLLLLLLLL... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 11
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 3 A#B .#. .#. .#. ... |
| correct output |
|---|
| YES 2000 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 12
Verdict: RUNTIME ERROR
| input |
|---|
| 3 1000 A................................ |
| correct output |
|---|
| YES 2000 RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 13
Verdict: RUNTIME ERROR
| input |
|---|
| 999 999 A#...#...#...#...#...#...#...#... |
| correct output |
|---|
| YES 499998 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 14
Verdict: RUNTIME ERROR
| input |
|---|
| 1 3 A.B |
| correct output |
|---|
| YES 2 RR |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 15
Verdict: RUNTIME ERROR
| input |
|---|
| 2 2 ## AB |
| correct output |
|---|
| YES 1 R |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...Test 16
Verdict: RUNTIME ERROR
| input |
|---|
| 1000 1000 A................................ |
| correct output |
|---|
| YES 1998 RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 5, in <module>
a, b =...