Task: | Tietoverkko |
Sender: | Tipu |
Submission time: | 2021-10-15 20:24:05 +0300 |
Language: | Python3 (CPython3) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
#2 | RUNTIME ERROR | 0 |
#3 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | RUNTIME ERROR | 0.03 s | 1, 2, 3 | details |
#2 | RUNTIME ERROR | 0.42 s | 2, 3 | details |
#3 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
def määritä(a, b, x, pienimmät: dict, n): # print("määritys") i = 0 store = pienimmät.copy() # print(store) if a in store: for i in store[a]: # print(store[i]) if store[a][i] < x: # print("kolme") if not b in pienimmät: pienimmät.update({b: {i: store[a][i]}}) else: pienimmät[b].update({i: store[a][i]}) # pienimmät[i][b] = store[i][a] else: # print("neljä") if not b in pienimmät: pienimmät.update({b: {i: x}}) else: pienimmät[b].update({i: x}) # pienimmät[i][b] = x if not a in pienimmät: pienimmät.update({a : {b : x}}) else: pienimmät[a].update({b : x}) if not b in pienimmät: pienimmät.update({b : {a : x}}) else: pienimmät[b].update({a : x}) # print(pienimmät) return pienimmät def laske(verkko): # print(verkko) j = 0 i = 1 luku = 0 saveI = i # print(len(verkko)) while j < len(verkko): i = saveI # print(len(verkko[j])) while i < len(verkko): # print(verkko[j][i], verkko[j] , i) luku += verkko[j][i] i += 1 saveI += 1 j += 1 return luku def main(): n = int(input()) # print(n) i = 0 a = [] b = [] x = [] pienimmät = {} while i < n - 1: abx = input().split(" ") a = int(abx[0]) b = int(abx[1]) x = int(abx[2]) pienimmät = määritä(a - 1, b - 1, x, pienimmät, n) # print(a, b, x) i += 1 print(laske(pienimmät)) # print("moi") main()
Test details
Test 1
Group: 1, 2, 3
Verdict: RUNTIME ERROR
input |
---|
100 1 2 74 1 3 100 2 4 50 3 5 40 ... |
correct output |
---|
88687 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 74, in <module> main()...
Test 2
Group: 2, 3
Verdict: RUNTIME ERROR
input |
---|
5000 1 2 613084013 1 3 832364259 2 4 411999902 3 5 989696303 ... |
correct output |
---|
1103702320243776 |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 74, in <module> main()...
Test 3
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 1 2 613084013 1 3 832364259 2 4 411999902 3 5 989696303 ... |
correct output |
---|
1080549209850010931 |
user output |
---|
(empty) |