85292024-01-21 14:18:15NagyLeoLeggyorsabb pénzkeresés (50)python3Time limit exceeded 6/50284ms29112 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(stdin.readline().split())
    for i in range(0, len(days)):
        current = 0
        countr = 0
        for f in range(i, len(days)):
            countr += 1
            current += int(days[f])
            if current >= P:
                if countr < smallest:
                    smallest = countr
                break

    stdout.write(str(smallest))


main()
SubtaskSumTestVerdictTimeMemory
base6/50
1Accepted0/018ms11336 KiB
2Time limit exceeded0/0261ms12392 KiB
3Accepted2/218ms11768 KiB
4Accepted2/218ms11580 KiB
5Accepted2/218ms11868 KiB
6Time limit exceeded0/2256ms5468 KiB
7Time limit exceeded0/2268ms5488 KiB
8Time limit exceeded0/2282ms5436 KiB
9Time limit exceeded0/2266ms5812 KiB
10Time limit exceeded0/2263ms6080 KiB
11Time limit exceeded0/2207ms29112 KiB
12Time limit exceeded0/2272ms13732 KiB
13Time limit exceeded0/2275ms13672 KiB
14Time limit exceeded0/2272ms13776 KiB
15Time limit exceeded0/2280ms13776 KiB
16Time limit exceeded0/2252ms13920 KiB
17Time limit exceeded0/2268ms14068 KiB
18Time limit exceeded0/2247ms14108 KiB
19Time limit exceeded0/2268ms14164 KiB
20Time limit exceeded0/2284ms14352 KiB
21Time limit exceeded0/2268ms14508 KiB
22Time limit exceeded0/2264ms14692 KiB
23Time limit exceeded0/2259ms14840 KiB
24Time limit exceeded0/2280ms15056 KiB
25Time limit exceeded0/2280ms14876 KiB
26Time limit exceeded0/2232ms14992 KiB
27Time limit exceeded0/2284ms15028 KiB