186002025-10-28 12:25:19WellLeopardUsually20G (40 pont)python3Time limit exceeded 0/40400ms15144 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)
previous_i = 0
for mi in m:
    output = 1
    for i in range(n-1, previous_i-1, -1):
        if maxt[i] <= mi:
            output = i + 2
            previous_i = i
            print(output)
            break
SubtaskSumTestVerdictTimeMemory
base0/40
1Accepted0/017ms3124 KiB
2Time limit exceeded0/0375ms15144 KiB
3Wrong answer0/217ms3124 KiB
4Wrong answer0/216ms3128 KiB
5Wrong answer0/224ms3124 KiB
6Wrong answer0/2137ms3124 KiB
7Time limit exceeded0/3386ms3380 KiB
8Time limit exceeded0/3400ms14896 KiB
9Time limit exceeded0/3377ms14908 KiB
10Time limit exceeded0/3384ms15008 KiB
11Wrong answer0/492ms14896 KiB
12Time limit exceeded0/4386ms14896 KiB
13Wrong answer0/486ms14896 KiB
14Time limit exceeded0/4381ms14892 KiB
15Time limit exceeded0/4372ms14908 KiB