Submission #65535975


Source Code Expand

N,M=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=B.copy();C.sort();C.reverse()

from collections import deque
E=deque()
D={}

for i in range(M):
  E.append(C[i])

for i in range(N):
  while True:
    if A[i] <= E[0]:
      D[E[0]]=i+1
      E.popleft()
    else:
      break
    if len(E)==0:
      break
  if len(E)==0:
      break

for i in range(M):
  if B[i] in D:
    print(D[B[i]])
  else:
    print(-1)

Submission Info

Submission Time
Task C - Kaiten Sushi
User watacco
Language Python (PyPy 3.10-v7.3.12)
Score 350
Code Size 485 Byte
Status AC
Exec Time 242 ms
Memory 136984 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 350 / 350
Status
AC × 3
AC × 30
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 02_random2_08.txt, 02_random2_09.txt, 02_random2_10.txt, 02_random2_11.txt, 02_random2_12.txt, 02_random2_13.txt, 02_random2_14.txt, 02_random2_15.txt, 02_random2_16.txt, 03_handmade_00.txt, 03_handmade_01.txt, 03_handmade_02.txt, 03_handmade_03.txt, 03_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 71 ms 76792 KiB
00_sample_01.txt AC 72 ms 76656 KiB
00_sample_02.txt AC 72 ms 76840 KiB
01_random_00.txt AC 135 ms 103036 KiB
01_random_01.txt AC 106 ms 93040 KiB
01_random_02.txt AC 176 ms 122764 KiB
01_random_03.txt AC 187 ms 127128 KiB
01_random_04.txt AC 143 ms 115668 KiB
02_random2_00.txt AC 200 ms 125056 KiB
02_random2_01.txt AC 228 ms 124676 KiB
02_random2_02.txt AC 226 ms 125248 KiB
02_random2_03.txt AC 225 ms 125308 KiB
02_random2_04.txt AC 224 ms 125516 KiB
02_random2_05.txt AC 232 ms 125256 KiB
02_random2_06.txt AC 227 ms 124876 KiB
02_random2_07.txt AC 238 ms 125236 KiB
02_random2_08.txt AC 229 ms 125092 KiB
02_random2_09.txt AC 233 ms 125084 KiB
02_random2_10.txt AC 225 ms 125112 KiB
02_random2_11.txt AC 221 ms 125492 KiB
02_random2_12.txt AC 237 ms 125476 KiB
02_random2_13.txt AC 237 ms 124916 KiB
02_random2_14.txt AC 242 ms 124924 KiB
02_random2_15.txt AC 225 ms 125176 KiB
02_random2_16.txt AC 237 ms 125164 KiB
03_handmade_00.txt AC 165 ms 136984 KiB
03_handmade_01.txt AC 160 ms 134796 KiB
03_handmade_02.txt AC 124 ms 114380 KiB
03_handmade_03.txt AC 115 ms 114624 KiB
03_handmade_04.txt AC 72 ms 76792 KiB