Task: | Kayaks |
Sender: | P=NP |
Submission time: | 2020-10-03 14:58:35 +0300 |
Language: | Python3 (PyPy3) |
Status: | READY |
Result: | RUNTIME ERROR |
test | verdict | time | |
---|---|---|---|
#1 | RUNTIME ERROR | 0.07 s | details |
#2 | RUNTIME ERROR | 0.08 s | details |
#3 | RUNTIME ERROR | 0.07 s | details |
#4 | RUNTIME ERROR | 0.08 s | details |
#5 | RUNTIME ERROR | 0.08 s | details |
#6 | RUNTIME ERROR | 0.07 s | details |
#7 | RUNTIME ERROR | 0.07 s | details |
#8 | RUNTIME ERROR | 0.08 s | details |
#9 | RUNTIME ERROR | 0.07 s | details |
#10 | RUNTIME ERROR | 0.07 s | details |
#11 | RUNTIME ERROR | 0.08 s | details |
#12 | RUNTIME ERROR | 0.07 s | details |
Code
n, m = input().split(" ") distances = [] for i in range(int(n)): row = input() counting = False distance = 0 team = '.' for j in row: #print(j, end = '') if (j == 'S' or (j == '.' and not counting) or j == 'F'): pass elif (j == '.' and counting): distance += 1 else: counting = True team = j if (team != '.'): distances.append((int(team), distance)) #print(row) #print((team, distance)) s1 = sorted(distances, key=lambda tup: tup[1]) #print(s1) placements = [] kayaks = 0 place = 0 while kayaks < 9: place += 1 dis = s1[0][1] remlist = [] for k in s1: if (k[1] == dis): kayaks += 1 placements.append((k[0], place)) remlist.append(k) for k in remlist: s1.remove(k) #print(placements) s2 = sorted(placements, key=lambda tup: tup[0]) #print(s2) for elem in s2: print(elem[1])
Test details
Test 1
Verdict: RUNTIME ERROR
input |
---|
10 15
S..........222F S.....111.....F S...333.......F S...555.......F ... |
correct output |
---|
5
1 6 3 6 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 2
Verdict: RUNTIME ERROR
input |
---|
10 10
S.....111F S....222.F S...333..F S..444...F ... |
correct output |
---|
1
2 3 4 5 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 3
Verdict: RUNTIME ERROR
input |
---|
10 10
S...111..F S....222.F S.....333F S444.....F ... |
correct output |
---|
3
2 1 6 5 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 4
Verdict: RUNTIME ERROR
input |
---|
10 20
S..................F S...111............F S......222.........F S.........333......F ... |
correct output |
---|
9
7 5 3 1 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 5
Verdict: RUNTIME ERROR
input |
---|
20 20
S999...............F S..................F S..................F S..................F ... |
correct output |
---|
5
3 7 6 4 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 6
Verdict: RUNTIME ERROR
input |
---|
30 30
S............................F... |
correct output |
---|
1
6 5 4 3 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 7
Verdict: RUNTIME ERROR
input |
---|
30 30
S111.........................F... |
correct output |
---|
1
1 1 1 1 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 8
Verdict: RUNTIME ERROR
input |
---|
30 30
S111.........................F... |
correct output |
---|
7
6 5 3 2 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 9
Verdict: RUNTIME ERROR
input |
---|
30 30
S............................F... |
correct output |
---|
1
1 1 1 3 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 10
Verdict: RUNTIME ERROR
input |
---|
30 30
S............................F... |
correct output |
---|
5
3 3 3 1 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 11
Verdict: RUNTIME ERROR
input |
---|
30 30
S............................F... |
correct output |
---|
6
5 3 5 4 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'
Test 12
Verdict: RUNTIME ERROR
input |
---|
30 30
S............................F... |
correct output |
---|
5
4 3 1 2 ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 21, in <module> distances.append((int(team), distance)) ValueError: invalid literal for int() with base 10: '\r'