85302024-01-21 14:19:42NagyLeoLeggyorsabb pénzkeresés (50)python3Time limit exceeded 8/50300ms35248 KiB
from sys import stdin, stdout


def main():
    NP = list(stdin.readline().split())
    N = int(NP[0])
    P = int(NP[1])
    smallest = N+1

    days = list(map(int, stdin.readline().split()))
    for i in range(0, len(days)):
        current = 0
        countr = 0
        for f in range(i, len(days)):
            countr += 1
            current += days[f]
            if current >= P:
                if countr < smallest:
                    smallest = countr
                break

    stdout.write(str(smallest))


main()
SubtaskSumTestVerdictTimeMemory
base8/50
1Accepted0/018ms11208 KiB
2Time limit exceeded0/0273ms15324 KiB
3Accepted2/217ms11608 KiB
4Accepted2/217ms11928 KiB
5Accepted2/217ms12400 KiB
6Time limit exceeded0/2300ms5928 KiB
7Time limit exceeded0/2256ms5932 KiB
8Time limit exceeded0/2247ms6052 KiB
9Time limit exceeded0/2272ms6140 KiB
10Time limit exceeded0/2259ms6060 KiB
11Accepted2/2160ms35248 KiB
12Time limit exceeded0/2280ms16612 KiB
13Time limit exceeded0/2287ms16800 KiB
14Time limit exceeded0/2259ms16732 KiB
15Time limit exceeded0/2228ms16560 KiB
16Time limit exceeded0/2263ms16636 KiB
17Time limit exceeded0/2284ms16756 KiB
18Time limit exceeded0/2263ms17056 KiB
19Time limit exceeded0/2259ms17212 KiB
20Time limit exceeded0/2256ms17020 KiB
21Time limit exceeded0/2300ms17092 KiB
22Time limit exceeded0/2272ms17092 KiB
23Time limit exceeded0/2268ms17028 KiB
24Time limit exceeded0/2263ms17092 KiB
25Time limit exceeded0/2268ms17180 KiB
26Time limit exceeded0/2272ms17020 KiB
27Time limit exceeded0/2268ms17104 KiB