117312024-11-08 12:54:12balintLeggyorsabb pénzkeresés (50)python3Time limit exceeded 8/50300ms14644 KiB
def main():
    N, P = map(int, input().split())
    nums = list(map(int, input().split()))
    for n in range(1, N + 1):
        i = 0
        while i + n <= N:
            if sum(nums[i : i + n]) >= P:
                print(n)
                return
            i += 1


main()
SubtaskSumTestVerdictTimeMemory
base8/50
1Accepted0/016ms3060 KiB
2Time limit exceeded0/0275ms14612 KiB
3Accepted2/217ms2872 KiB
4Accepted2/217ms2992 KiB
5Accepted2/218ms3320 KiB
6Time limit exceeded0/2287ms4152 KiB
7Time limit exceeded0/2287ms4156 KiB
8Time limit exceeded0/2300ms4100 KiB
9Time limit exceeded0/2284ms4156 KiB
10Time limit exceeded0/2279ms4168 KiB
11Accepted2/286ms14528 KiB
12Time limit exceeded0/2300ms14620 KiB
13Time limit exceeded0/2284ms14424 KiB
14Time limit exceeded0/2287ms14620 KiB
15Time limit exceeded0/2289ms14620 KiB
16Time limit exceeded0/2286ms14580 KiB
17Time limit exceeded0/2279ms14616 KiB
18Time limit exceeded0/2284ms14620 KiB
19Time limit exceeded0/2286ms14632 KiB
20Time limit exceeded0/2300ms14288 KiB
21Time limit exceeded0/2291ms14556 KiB
22Time limit exceeded0/2284ms14620 KiB
23Time limit exceeded0/2280ms14616 KiB
24Time limit exceeded0/2300ms14528 KiB
25Time limit exceeded0/2284ms14632 KiB
26Time limit exceeded0/2280ms14620 KiB
27Time limit exceeded0/2300ms14644 KiB