Task: | Tietoverkko |
Sender: | eaittok |
Submission time: | 2021-10-12 16:58:29 +0300 |
Language: | Python3 (CPython3) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.02 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.04 s | 2, 3 | details |
#3 | WRONG ANSWER | 0.87 s | 3 | details |
Code
def speed(connection): return connection[2] ip = [] if True: n = int(input()) ip.append(n) for _ in range(n-1): ip.append(input()) else: file = open("input.txt") for line in file: ip.append(line.strip()) n = int(input[0]) #print(ip) connections = [] for i in range(1, n): row = ip[i].split() connections.append((int(row[0]), int(row[1]), int(row[2]))) #print(connections) connections.sort(key=speed, reverse=True) #print(connections) result = 0 for i in range(n-1): result += (i+1)*connections[i][2] print(result)
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
100 1 2 74 1 3 100 2 4 50 3 5 40 ... |
correct output |
---|
88687 |
user output |
---|
162632 |
Test 2
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
5000 1 2 613084013 1 3 832364259 2 4 411999902 3 5 989696303 ... |
correct output |
---|
1103702320243776 |
user output |
---|
4183854306632911 |
Test 3
Group: 3
Verdict: WRONG ANSWER
input |
---|
200000 1 2 613084013 1 3 832364259 2 4 411999902 3 5 989696303 ... |
correct output |
---|
1080549209850010931 |
user output |
---|
6652407974595782384 |