Submission #866939


Source Code Expand

N, x = map(int, input().split())
a    = list(map(int, input().split()))

check = [False] * N
ans = 0

while True:
    for i in range(N):
        if a[i] < x:
            check[i] = True
            ans += a[i]
    if (False in check) == False:
        print(ans)
        break

    temp = check[-1]
    for i in range(-1,-N,-1):
        check[i] = check[i-1]
    check[0] = temp
    ans += x
    if (False in check) == False:
        print(ans)
        break

Submission Info

Submission Time
Task B - Colorful Slimes
User blue9
Language Python (3.4.3)
Score 0
Code Size 480 Byte
Status WA
Exec Time 2105 ms
Memory 3188 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 5
WA × 5
TLE × 11
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt
Case Name Status Exec Time Memory
0_00.txt AC 39 ms 3188 KiB
0_01.txt AC 38 ms 3064 KiB
0_02.txt AC 38 ms 3064 KiB
1_00.txt TLE 2105 ms 3064 KiB
1_01.txt AC 44 ms 3064 KiB
1_02.txt TLE 2105 ms 3188 KiB
1_03.txt TLE 2105 ms 3188 KiB
1_04.txt AC 1767 ms 3188 KiB
1_05.txt TLE 2105 ms 3188 KiB
1_06.txt TLE 2105 ms 3188 KiB
1_07.txt TLE 2105 ms 3188 KiB
1_08.txt TLE 2105 ms 3188 KiB
1_09.txt TLE 2105 ms 3188 KiB
1_10.txt TLE 2105 ms 3188 KiB
1_11.txt WA 1056 ms 3188 KiB
1_12.txt WA 782 ms 3188 KiB
1_13.txt WA 1073 ms 3188 KiB
1_14.txt WA 862 ms 3188 KiB
1_15.txt TLE 2105 ms 3188 KiB
1_16.txt WA 574 ms 3188 KiB
1_17.txt TLE 2105 ms 3188 KiB