Task: | VERTEX COVER |
Sender: | PyPy > Assembly |
Submission time: | 2016-10-04 18:59:05 +0300 |
Language: | Python3 |
Status: | READY |
Result: | RUNTIME ERROR |
test | verdict | time | |
---|---|---|---|
#1 | RUNTIME ERROR | 0.16 s | details |
#2 | RUNTIME ERROR | 0.11 s | details |
#3 | RUNTIME ERROR | 0.10 s | details |
#4 | RUNTIME ERROR | 0.22 s | details |
#5 | RUNTIME ERROR | 0.21 s | details |
#6 | RUNTIME ERROR | 0.23 s | details |
#7 | RUNTIME ERROR | 0.23 s | details |
#8 | RUNTIME ERROR | 0.12 s | details |
#9 | RUNTIME ERROR | 0.15 s | details |
#10 | RUNTIME ERROR | 0.31 s | details |
#11 | RUNTIME ERROR | 0.21 s | details |
#12 | RUNTIME ERROR | 0.29 s | details |
#13 | RUNTIME ERROR | 0.29 s | details |
#14 | RUNTIME ERROR | 0.27 s | details |
#15 | RUNTIME ERROR | 0.27 s | details |
#16 | RUNTIME ERROR | 0.33 s | details |
#17 | RUNTIME ERROR | 0.27 s | details |
#18 | RUNTIME ERROR | 0.27 s | details |
#19 | RUNTIME ERROR | 0.27 s | details |
#20 | RUNTIME ERROR | 0.30 s | details |
#21 | RUNTIME ERROR | 0.28 s | details |
#22 | RUNTIME ERROR | 0.26 s | details |
#23 | RUNTIME ERROR | 0.34 s | details |
#24 | RUNTIME ERROR | 0.28 s | details |
#25 | RUNTIME ERROR | 0.27 s | details |
#26 | RUNTIME ERROR | 0.28 s | details |
#27 | RUNTIME ERROR | 0.31 s | details |
#28 | RUNTIME ERROR | 0.28 s | details |
#29 | RUNTIME ERROR | 0.38 s | details |
#30 | RUNTIME ERROR | 0.27 s | details |
Code
from sys import stdin n = int(stdin.readline()) v = {} extras = [] root = None for _ in range(n+1): a, b = tuple(map(int, stdin.readline().split())) if a not in v: v[a] = [b] if root is None: root = a elif b == root: root = a elif b not in v: v[a].append(b) else: extras.append((a, b)) out = 0 selected = [] for k in v: for fuck in v[k]: if fuck in v and v[fuck] not in v: out += 1 selected.append(k) fix = True i = 0 from itertools import chain for a, b in extras: i += 1 if a in selected and b in selected: other = (i-1) ^ 1 ankka, duck = extras[other] if ankka not in v or duck not in v or v[ankka] not in v or v[duck] not in v: out -= 1 if a in selected or b in selected: fix = False continue out += 1 if fix and len(set(chain.from_iterable(extras))) < 4: out -= 1 print(out)
Test details
Test 1
Verdict: RUNTIME ERROR
input |
---|
43516 31635 7283 407 22068 14527 27341 13988 3756 ... |
correct output |
---|
15856 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 2
Verdict: RUNTIME ERROR
input |
---|
15844 11075 5963 12852 1355 12408 997 5774 1839 ... |
correct output |
---|
6691 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 3
Verdict: RUNTIME ERROR
input |
---|
16739 5194 10683 1122 249 3384 12552 9483 5513 ... |
correct output |
---|
6757 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 4
Verdict: RUNTIME ERROR
input |
---|
45585 2278 17306 29200 4367 3493 946 13733 29961 ... |
correct output |
---|
16583 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 5
Verdict: RUNTIME ERROR
input |
---|
65713 48285 11821 34133 22499 14959 39378 27756 2333 ... |
correct output |
---|
27673 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 6
Verdict: RUNTIME ERROR
input |
---|
65594 48205 44126 49025 17567 49495 29064 5497 9432 ... |
correct output |
---|
26501 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 7
Verdict: RUNTIME ERROR
input |
---|
76352 41529 44956 24215 33162 32459 57488 36012 8978 ... |
correct output |
---|
27769 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 8
Verdict: RUNTIME ERROR
input |
---|
19735 3280 11743 5800 4932 15996 16996 1326 8492 ... |
correct output |
---|
8362 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 9
Verdict: RUNTIME ERROR
input |
---|
49843 38377 42277 22655 27295 9233 8151 20174 26700 ... |
correct output |
---|
20103 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 10
Verdict: RUNTIME ERROR
input |
---|
93738 34468 1473 62502 21129 7249 69111 34431 14831 ... |
correct output |
---|
34129 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 11
Verdict: RUNTIME ERROR
input |
---|
70512 59016 43446 23523 34215 40100 65349 32479 69170 ... |
correct output |
---|
29712 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 12
Verdict: RUNTIME ERROR
input |
---|
77793 67362 43115 26066 53059 34877 28252 41322 27232 ... |
correct output |
---|
31415 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 13
Verdict: RUNTIME ERROR
input |
---|
81528 17424 60496 16303 9750 72040 16424 73313 66255 ... |
correct output |
---|
29740 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 14
Verdict: RUNTIME ERROR
input |
---|
87601 26609 79183 12401 22737 40749 41820 44416 43745 ... |
correct output |
---|
36915 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 15
Verdict: RUNTIME ERROR
input |
---|
100000 99312 64091 74701 14263 18494 14204 48860 56668 ... |
correct output |
---|
40376 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 16
Verdict: RUNTIME ERROR
input |
---|
100000 85199 85147 16157 86513 31941 9017 28468 14549 ... |
correct output |
---|
50000 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 17
Verdict: RUNTIME ERROR
input |
---|
100000 23889 65680 23889 43172 31662 23889 23889 14952 ... |
correct output |
---|
3 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 18
Verdict: RUNTIME ERROR
input |
---|
100000 69560 99883 72675 99883 46326 77576 99883 92496 ... |
correct output |
---|
6 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 19
Verdict: RUNTIME ERROR
input |
---|
100000 28151 97740 74287 42190 55692 76617 51247 37435 ... |
correct output |
---|
36374 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 20
Verdict: RUNTIME ERROR
input |
---|
100000 92176 53508 59512 60686 3760 73799 25954 68463 ... |
correct output |
---|
42107 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 21
Verdict: RUNTIME ERROR
input |
---|
100000 77208 54647 86577 72654 30560 44935 58433 65087 ... |
correct output |
---|
40367 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 22
Verdict: RUNTIME ERROR
input |
---|
100000 11835 72732 46693 14441 91141 81072 9142 96454 ... |
correct output |
---|
36396 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 23
Verdict: RUNTIME ERROR
input |
---|
100000 62977 19876 33643 71597 43079 56905 55474 63340 ... |
correct output |
---|
42014 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 24
Verdict: RUNTIME ERROR
input |
---|
100000 10558 826 71579 31910 52499 85798 49687 29460 ... |
correct output |
---|
40315 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 25
Verdict: RUNTIME ERROR
input |
---|
100000 42867 7204 6642 28627 52963 75885 5909 2124 ... |
correct output |
---|
36378 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 26
Verdict: RUNTIME ERROR
input |
---|
100000 98353 70486 18269 81832 96346 42985 52089 65027 ... |
correct output |
---|
42053 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 27
Verdict: RUNTIME ERROR
input |
---|
100000 95632 70669 80227 14695 8281 32693 36226 99062 ... |
correct output |
---|
40405 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 28
Verdict: RUNTIME ERROR
input |
---|
100000 93396 66096 17209 78703 63472 8252 44686 81626 ... |
correct output |
---|
36410 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 29
Verdict: RUNTIME ERROR
input |
---|
100000 76692 65797 61491 11409 1719 12971 71081 59660 ... |
correct output |
---|
42226 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'
Test 30
Verdict: RUNTIME ERROR
input |
---|
100000 41478 47936 87485 27259 90595 12109 53850 41021 ... |
correct output |
---|
40385 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 29, in <module> if fuck in v and v[fuck] not in v: TypeError: unhashable type: 'list'