Submission details
Task:Cow heist
Sender:aalto25b_004
Submission time:2025-09-10 16:45:15 +0300
Language:Python2 (PyPy2)
Status:READY
Result:
Test results
testverdicttime
#10.03 sdetails
#20.03 sdetails
#30.03 sdetails
#40.03 sdetails
#50.03 sdetails
#60.03 sdetails
#70.03 sdetails
#80.04 sdetails
#90.03 sdetails
#100.03 sdetails
#110.03 sdetails
#120.03 sdetails
#130.03 sdetails
#140.03 sdetails
#150.04 sdetails
#160.03 sdetails
#170.03 sdetails
#180.03 sdetails
#190.03 sdetails
#200.03 sdetails
#210.03 sdetails
#220.03 sdetails
#230.03 sdetails
#240.03 sdetails
#250.03 sdetails
#260.03 sdetails
#270.03 sdetails
#280.03 sdetails
#290.03 sdetails
#300.03 sdetails
#310.03 sdetails
#320.03 sdetails
#330.03 sdetails
#340.03 sdetails
#350.03 sdetails
#360.03 sdetails
#370.03 sdetails
#380.03 sdetails
#390.03 sdetails
#400.03 sdetails
#410.03 sdetails
#420.03 sdetails
#430.03 sdetails
#440.03 sdetails
#450.03 sdetails
#460.03 sdetails
#470.03 sdetails
#480.03 sdetails
#490.03 sdetails
#500.04 sdetails
#510.03 sdetails
#520.04 sdetails
#530.04 sdetails
#540.03 sdetails
#550.04 sdetails
#560.04 sdetails
#570.04 sdetails
#580.07 sdetails
#590.07 sdetails
#600.07 sdetails
#610.07 sdetails
#620.07 sdetails

Code

# After an epic heist crew recruitment montage, a group of aliens is preparing to steal all the cows on Earth! There are n cow farms on Earth and the i-th farm has c_i cows. The team needs to move swiftly, so they need to fine-tune their ship's tractor beams. The ship has 30 tractor beams and the i-th tractor beam can be tuned to pull in exactly X_i cows. As a member of the crew, your task is to tune the tractor beams in such a way that you can steal all the cows from any of the farms in a single pull.
# Formally, for each i in 1,2,\dots,n, there should be a subset of the tractor beams that can pull in exactly c_i cows. If there are multiple answers, print any.
# Input
# The first line contains a single integer n.
# The next line contains n integers c_1,\,c_2,\cdots,\,c_n.
# Output
# Print 30 integers X_1\ X_2 \dots\ X_{30} on a single line.
# Constraints

# 1 \leq n \leq 10^5
# 1 \leq c_i \leq 10^6
# 0 \leq X_i \leq 10^6

# Example 1
# Input:
# 3
# 4 5 6


def function(n, farms):
    max_cows = max(farms)
    beams = []
    power = 1
    while len(beams) < 30:
        if power > max_cows:
            break
        beams.append(power)
        power *= 2
    beams += [0] * (30 - len(beams))


    return beams


def main():
    # input :
    # 3
    # 3 5 8 7 4 3

 
    n = int(input())
    farms = list(map(int, input().split()))

    for farm in farms:
        print(farm)
 
 
    results = function(n, farms)
    print(" ".join(map(str, results)))

 
 
 
if __name__ == "__main__":
    main()




Test details

Test 1

Verdict:

input
1
11

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 2

Verdict:

input
2
9 20

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 3

Verdict:

input
3
18 2 8

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 4

Verdict:

input
3
4 9 15

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 5

Verdict:

input
3
4 16 15

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 6

Verdict:

input
4
8 10 6 14

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 7

Verdict:

input
4
14 15 6 9

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 8

Verdict:

input
5
11 12 15 17 13

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 9

Verdict:

input
5
9 20 15 19 1

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 10

Verdict:

input
5
9 4 1 19 11

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 11

Verdict:

input
5
12 2 15 17 6

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 12

Verdict:

input
5
20 19 11 4 20

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 13

Verdict:

input
5
5 2 18 17 5

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 14

Verdict:

input
5
18 19 7 5 17

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 15

Verdict:

input
5
2 5 16 7 9

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 16

Verdict:

input
5
18 1 20 5 18

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 17

Verdict:

input
5
1 8 11 10 10

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 18

Verdict:

input
10
11 12 15 17 13 18 11 17 9 13

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 19

Verdict:

input
10
9 20 15 19 1 3 7 20 3 5

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 20

Verdict:

input
10
9 4 1 19 11 19 9 10 9 7

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 21

Verdict:

input
10
12 2 15 17 6 3 11 12 18 9

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 22

Verdict:

input
10
20 19 11 4 20 18 15 13 14 12

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 23

Verdict:

input
10
5 2 18 17 5 8 19 20 10 2

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 24

Verdict:

input
10
18 19 7 5 17 2 1 8 3 20

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 25

Verdict:

input
10
2 5 16 7 9 20 15 10 20 7

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 26

Verdict:

input
10
18 1 20 5 18 8 11 17 5 9

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 27

Verdict:

input
10
1 8 11 10 10 1 3 7 3 1

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 28

Verdict:

input
100
548938 592979 715351 844456 60...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 29

Verdict:

input
100
417116 997410 720487 932768 11...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 30

Verdict:

input
100
436094 185124 25933 931751 549...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 31

Verdict:

input
100
550922 70741 708308 840139 290...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 32

Verdict:

input
100
967248 900825 547356 172735 97...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 33

Verdict:

input
100
222044 55193 870929 831516 206...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 34

Verdict:

input
100
893062 947690 332055 209454 82...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 35

Verdict:

input
100
76326 227391 780095 319045 438...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 36

Verdict:

input
100
873627 11117 968759 239494 869...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 37

Verdict:

input
100
10377 364544 501988 499243 495...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 38

Verdict:

input
200
548938 592979 715351 844456 60...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 39

Verdict:

input
200
417116 997410 720487 932768 11...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 40

Verdict:

input
200
436094 185124 25933 931751 549...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 41

Verdict:

input
200
550922 70741 708308 840139 290...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 42

Verdict:

input
200
967248 900825 547356 172735 97...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 43

Verdict:

input
200
222044 55193 870929 831516 206...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 44

Verdict:

input
200
893062 947690 332055 209454 82...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 45

Verdict:

input
200
76326 227391 780095 319045 438...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 46

Verdict:

input
200
873627 11117 968759 239494 869...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 47

Verdict:

input
200
10377 364544 501988 499243 495...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 48

Verdict:

input
1000
548938 592979 715351 844456 60...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 49

Verdict:

input
1000
417116 997410 720487 932768 11...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 50

Verdict:

input
1000
436094 185124 25933 931751 549...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 51

Verdict:

input
1000
550922 70741 708308 840139 290...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 52

Verdict:

input
1000
967248 900825 547356 172735 97...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 53

Verdict:

input
1000
222044 55193 870929 831516 206...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 54

Verdict:

input
1000
893062 947690 332055 209454 82...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 55

Verdict:

input
1000
76326 227391 780095 319045 438...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 56

Verdict:

input
1000
873627 11117 968759 239494 869...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 57

Verdict:

input
1000
10377 364544 501988 499243 495...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 58

Verdict:

input
100000
548938 592979 715351 844456 60...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 59

Verdict:

input
100000
417116 997410 720487 932768 11...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 60

Verdict:

input
100000
436094 185124 25933 931751 549...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 61

Verdict:

input
100000
550922 70741 708308 840139 290...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...

Test 62

Verdict:

input
100000
967248 900825 547356 172735 97...

correct output
1 2 4 8 16 32 64 128 256 512 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 55, in <module>
    main()...