Submission details
Task:Box stack I
Sender:aalto25c_008
Submission time:2025-09-17 17:38:24 +0300
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.07 sdetails
#20.06 sdetails
#30.06 sdetails
#40.06 sdetails
#50.06 sdetails
#60.06 sdetails
#70.06 sdetails
#80.06 sdetails
#90.06 sdetails
#100.06 sdetails
#110.06 sdetails
#120.06 sdetails
#130.07 sdetails
#140.06 sdetails
#150.07 sdetails
#160.07 sdetails
#170.06 sdetails
#180.06 sdetails
#190.06 sdetails
#200.06 sdetails
#210.07 sdetails
#220.06 sdetails
#230.06 sdetails
#240.06 sdetails
#250.06 sdetails
#260.06 sdetails
#270.06 sdetails
#280.06 sdetails
#290.06 sdetails
#300.06 sdetails
#310.06 sdetails
#320.06 sdetails
#330.06 sdetails
#340.06 sdetails
#350.06 sdetails
#360.06 sdetails
#370.06 sdetails
#380.07 sdetails
#390.06 sdetails
#400.06 sdetails
#410.06 sdetails
#420.06 sdetails
#430.06 sdetails
#440.06 sdetails
#450.06 sdetails
#460.07 sdetails
#470.06 sdetails
#480.06 sdetails
#490.06 sdetails
#500.06 sdetails
#510.06 sdetails
#520.06 sdetails
#530.07 sdetails
#540.06 sdetails
#550.06 sdetails
#560.06 sdetails
#570.06 sdetails
#580.06 sdetails
#590.06 sdetails
#600.07 sdetails

Code

n, m = map(int, input().split())
 
a = list(map(int, input().split()))
b = list(map(int, input().split()))
checkFast = sorted(b, reverse=True)

result = []
memo = {}

for i in range(len(a)):
    coin = a[i]
    if coin in memo:
        result.append(memo[coin])
        continue
    if coin > checkFast[0]:
        # print(m+1, end=' ')
        result.append(m + 1)
        memo[coin] = m + 1
        continue
    for j in range(len(b)):
        hole = b[j]
        if coin <= hole:
            # print(j+1,end=' ')
            memo[coin] = j + 1
            result.append(j + 1)
            break

for i in range(len(result)):
    print(result[i], end=" ")

Test details

Test 1

Verdict:

input
1
6 7 10

correct output
10

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 2

Verdict:

input
2
5 2 4
1 2 10

correct output
14

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 3

Verdict:

input
2
8 2 3
3 8 5

correct output
8

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 4

Verdict:

input
3
7 3 6
10 8 9
3 6 2

correct output
15

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 5

Verdict:

input
3
9 6 9
4 4 6
7 2 7

correct output
15

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 6

Verdict:

input
3
10 7 6
3 2 8
2 1 9

correct output
23

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 7

Verdict:

input
4
8 4 2
3 4 10
5 10 5
2 6 2

correct output
17

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 8

Verdict:

input
4
3 6 5
1 1 10
10 9 5
4 8 6

correct output
26

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 9

Verdict:

input
4
7 3 6
10 5 9
6 10 1
6 7 1

correct output
10

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 10

Verdict:

input
4
8 1 6
2 7 7
9 6 2
5 2 10

correct output
17

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 11

Verdict:

input
5
6 6 8
9 7 9
6 9 5
7 7 4
...

correct output
18

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 12

Verdict:

input
5
5 10 8
10 1 2
4 10 2
3 1 4
...

correct output
18

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 13

Verdict:

input
5
5 2 1
10 6 10
5 5 5
4 4 2
...

correct output
17

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 14

Verdict:

input
5
6 1 8
9 3 2
6 6 9
5 9 1
...

correct output
17

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 15

Verdict:

input
5
10 10 6
2 10 9
8 7 7
6 3 2
...

correct output
22

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 16

Verdict:

input
5
3 1 9
9 3 4
10 10 5
1 7 4
...

correct output
19

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 17

Verdict:

input
5
9 10 4
3 9 1
1 4 2
10 6 1
...

correct output
12

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 18

Verdict:

input
5
1 3 8
4 5 10
8 5 10
4 6 3
...

correct output
28

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 19

Verdict:

input
5
9 1 10
3 9 4
6 9 3
5 1 7
...

correct output
16

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 20

Verdict:

input
5
1 4 6
5 5 1
2 4 2
1 3 9
...

correct output
18

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 21

Verdict:

input
10
6 6 8
9 7 9
6 9 5
7 7 4
...

correct output
22

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 22

Verdict:

input
10
5 10 8
10 1 2
4 10 2
3 1 4
...

correct output
29

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 23

Verdict:

input
10
5 2 1
10 6 10
5 5 5
4 4 2
...

correct output
25

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 24

Verdict:

input
10
6 1 8
9 3 2
6 6 9
5 9 1
...

correct output
19

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 25

Verdict:

input
10
10 10 6
2 10 9
8 7 7
6 3 2
...

correct output
31

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 26

Verdict:

input
10
3 1 9
9 3 4
10 10 5
1 7 4
...

correct output
28

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 27

Verdict:

input
10
9 10 4
3 9 1
1 4 2
10 6 1
...

correct output
21

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 28

Verdict:

input
10
1 3 8
4 5 10
8 5 10
4 6 3
...

correct output
28

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 29

Verdict:

input
10
9 1 10
3 9 4
6 9 3
5 1 7
...

correct output
27

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 30

Verdict:

input
10
1 4 6
5 5 1
2 4 2
1 3 9
...

correct output
29

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 31

Verdict:

input
100
1098 1186 1431
1689 1206 1716
1090 1695 848
1248 1292 769
...

correct output
16023

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 32

Verdict:

input
100
835 1995 1441
1866 1 257
605 1999 294
473 185 794
...

correct output
16049

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 33

Verdict:

input
100
872 371 52
1864 1100 1896
871 970 841
642 661 309
...

correct output
14165

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 34

Verdict:

input
100
1102 142 1417
1680 582 243
1022 1139 1786
875 1793 38
...

correct output
12391

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 35

Verdict:

input
100
1935 1802 1095
346 1946 1712
1430 1219 1396
1196 433 283
...

correct output
19385

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 36

Verdict:

input
100
444 111 1742
1663 414 728
1838 1959 977
180 1224 794
...

correct output
15364

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 37

Verdict:

input
100
1786 1895 664
419 1643 129
84 741 216
1971 1191 199
...

correct output
15648

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 38

Verdict:

input
100
153 455 1560
638 877 1957
1447 912 1956
617 1077 528
...

correct output
12527

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 39

Verdict:

input
100
1747 23 1938
479 1739 756
1062 1633 466
845 23 1225
...

correct output
12817

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 40

Verdict:

input
100
21 729 1004
999 992 16
268 633 285
27 438 1755
...

correct output
15927

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 41

Verdict:

input
200
1098 1186 1431
1689 1206 1716
1090 1695 848
1248 1292 769
...

correct output
20991

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 42

Verdict:

input
200
835 1995 1441
1866 1 257
605 1999 294
473 185 794
...

correct output
24785

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 43

Verdict:

input
200
872 371 52
1864 1100 1896
871 970 841
642 661 309
...

correct output
20005

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 44

Verdict:

input
200
1102 142 1417
1680 582 243
1022 1139 1786
875 1793 38
...

correct output
21655

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 45

Verdict:

input
200
1935 1802 1095
346 1946 1712
1430 1219 1396
1196 433 283
...

correct output
24716

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 46

Verdict:

input
200
444 111 1742
1663 414 728
1838 1959 977
180 1224 794
...

correct output
20753

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 47

Verdict:

input
200
1786 1895 664
419 1643 129
84 741 216
1971 1191 199
...

correct output
25462

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 48

Verdict:

input
200
153 455 1560
638 877 1957
1447 912 1956
617 1077 528
...

correct output
19588

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 49

Verdict:

input
200
1747 23 1938
479 1739 756
1062 1633 466
845 23 1225
...

correct output
19995

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 50

Verdict:

input
200
21 729 1004
999 992 16
268 633 285
27 438 1755
...

correct output
26434

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 51

Verdict:

input
1000
1098 1186 1431
1689 1206 1716
1090 1695 848
1248 1292 769
...

correct output
51198

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 52

Verdict:

input
1000
835 1995 1441
1866 1 257
605 1999 294
473 185 794
...

correct output
49723

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 53

Verdict:

input
1000
872 371 52
1864 1100 1896
871 970 841
642 661 309
...

correct output
47760

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 54

Verdict:

input
1000
1102 142 1417
1680 582 243
1022 1139 1786
875 1793 38
...

correct output
46095

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 55

Verdict:

input
1000
1935 1802 1095
346 1946 1712
1430 1219 1396
1196 433 283
...

correct output
55178

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 56

Verdict:

input
2000
444 111 1742
1663 414 728
1838 1959 977
180 1224 794
...

correct output
76003

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 57

Verdict:

input
2000
1786 1895 664
419 1643 129
84 741 216
1971 1191 199
...

correct output
69375

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 58

Verdict:

input
2000
153 455 1560
638 877 1957
1447 912 1956
617 1077 528
...

correct output
68402

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 59

Verdict:

input
2000
1747 23 1938
479 1739 756
1062 1633 466
845 23 1225
...

correct output
76262

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...

Test 60

Verdict:

input
2000
21 729 1004
999 992 16
268 633 285
27 438 1755
...

correct output
81251

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n, m =...