185982025-10-28 12:14:22WellLeopardUsually20G (40 pont)python3Time limit exceeded 4/40400ms15140 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 = 0
previous_i = 0
for mi in m:
    output = 1
    for i in range(previous_i, n):
        if maxt[i] <= mi:
            output += 1
            previous_i = i
            
    print(output) 
SubtaskSumTestVerdictTimeMemory
base4/40
1Accepted0/016ms3132 KiB
2Time limit exceeded0/0377ms15140 KiB
3Accepted2/216ms3124 KiB
4Accepted2/216ms3324 KiB
5Wrong answer0/224ms3124 KiB
6Wrong answer0/2134ms3204 KiB
7Time limit exceeded0/3400ms3388 KiB
8Time limit exceeded0/3388ms14916 KiB
9Time limit exceeded0/3375ms14828 KiB
10Time limit exceeded0/3384ms14896 KiB
11Wrong answer0/4112ms14896 KiB
12Time limit exceeded0/4400ms14896 KiB
13Wrong answer0/4115ms15088 KiB
14Time limit exceeded0/4400ms14892 KiB
15Time limit exceeded0/4381ms14896 KiB