185962025-10-28 12:10:05WellLeopardUsually20G (40 pont)python3Time limit exceeded 4/40398ms15144 KiB
n, q = map(int, input().split())
t = tuple(map(int, input().split()))
m = tuple(int(input()) for _ in range(q))

maxti = 0
maxt = list()
for i in range(n):
    if maxti < t[i]:
        maxti = t[i]
    maxt.append(maxti)
output = []
previous_i = 0
for mi in m:
    output.append(1)
    for i in range(previous_i, n):
        if maxt[i] <= mi:
            output[-1] += 1
            previous_i = i
for line in output:
    print(line)
    
SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/016ms2996 KiB
2Time limit exceeded0/0391ms15144 KiB
3Accepted2/216ms3140 KiB
4Accepted2/216ms3124 KiB
5Wrong answer0/224ms3168 KiB
6Wrong answer0/2128ms3248 KiB
7Time limit exceeded0/3398ms3248 KiB
8Time limit exceeded0/3386ms14896 KiB
9Time limit exceeded0/3384ms14896 KiB
10Time limit exceeded0/3386ms14892 KiB
11Wrong answer0/4115ms14892 KiB
12Time limit exceeded0/4388ms14904 KiB
13Wrong answer0/4122ms14892 KiB
14Time limit exceeded0/4386ms14812 KiB
15Time limit exceeded0/4377ms14896 KiB