Submission #74962243


Source Code Expand

N, M = map(int, input().split())
if N == 1:
    try:
        input()
    except:
        pass
    W = []
else:
    W = list(map(int, input().split()))
current_location = 1
licenses = M
for i in range(N - 1):
    if W[i] == 0:
        current_location += 1
    else:
        if licenses > 0:
            licenses -= 1
            current_location += 1
        else:
            break
print(current_location)

Submission Info

Submission Time
Task B - Road Closure on a One-Way Street
User junhengF
Language Python (Codon 0.19.3)
Score 0
Code Size 426 Byte
Status CE

Compile Error

Main.py:1 (8-33): error: 'Generator[int]' object has no attribute '__getitem__'