Submission #1467902


Source Code Expand

Copy
def main():
    k = int(input())
    if(k == 0):
        print("2\n1 1")
        return 0
    if(k == 1):
        print("2\n3 1")
        return 0
    for n in range(50, 1, -1):
        clear = k // n + 1
        additional = n - k % n
        a = clear + n - 1
        if(a >= 0 and a <= 10**16 + 1000):
            lst = [a] * n
            for i in range(additional):
                m = max(lst)
                for i, item in enumerate(lst):
                    if(item == m):
                        lst[i] -= n
                        break
            print(n)
            print(' '.join([str(item) for item in lst]))
            return 0
main()

Submission Info

Submission Time
Task D - Decrease (Contestant ver.)
User antonych
Language Python3 (3.4.3)
Score 0
Code Size 678 Byte
Status
Exec Time 17 ms
Memory 3064 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example0, example1, example2, example3, example4
All 0 / 600 corner0, corner1, corner2, corner3, corner4, corner5, corner6, corner7, corner8, corner9, example0, example1, example2, example3, example4, rand0, rand1, rand2, rand3, rand4, rand5, rand6, rand7, rand8, rand9
Case Name Status Exec Time Memory
corner0 17 ms 3064 KB
corner1 17 ms 3064 KB
corner2 17 ms 3064 KB
corner3 17 ms 3064 KB
corner4 17 ms 3064 KB
corner5 17 ms 3064 KB
corner6 17 ms 3064 KB
corner7 17 ms 3064 KB
corner8 17 ms 3064 KB
corner9 17 ms 3064 KB
example0 17 ms 3064 KB
example1 17 ms 3064 KB
example2 17 ms 3064 KB
example3 17 ms 3064 KB
example4 17 ms 3064 KB
rand0 17 ms 3064 KB
rand1 17 ms 3064 KB
rand2 17 ms 3064 KB
rand3 17 ms 3064 KB
rand4 17 ms 3064 KB
rand5 17 ms 3064 KB
rand6 17 ms 3064 KB
rand7 17 ms 3064 KB
rand8 17 ms 3060 KB
rand9 17 ms 3064 KB