結果

問題 No.647 明太子
ユーザー liny_tail
提出日時 2020-09-18 12:57:33
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 2,538 ms / 4,500 ms
コード長 528 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,904 KB
最終ジャッジ日時 2024-06-22 07:56:45
合計ジャッジ時間 7,971 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input().strip())
A, B = [], []
for i in range(N):
  tmp = list(map(int, input().split()))
  A.append(tmp[0])
  B.append(tmp[1])

M = int(input().strip())
X, Y = [], []
for i in range(M):
  tmp = list(map(int, input().split()))
  X.append(tmp[0])
  Y.append(tmp[1])

lst = [0] * M

for n in range(len(X)):
  x, y = X[n], Y[n]
  for a, b in zip(A, B):
    if x <= a and y >= b:
      lst[n] += 1

m = max(lst)
cnt = 0
for n, i in enumerate(lst):
  if i == m and m > 0:
    print(n+1)
    cnt += 1

if cnt == 0:
  print(0)
0