結果

問題 No.647 明太子
ユーザー takakin
提出日時 2020-04-24 01:08:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 203 ms / 4,500 ms
コード長 555 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 81,800 KB
実行使用メモリ 74,120 KB
最終ジャッジ日時 2024-10-14 09:36:29
合計ジャッジ時間 2,769 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
AB=[]
XY=[]
append=AB.append
for _ in range(n):
  a,b=map(int,input().split())
  append(a*10**9+b)
append=XY.append
m=int(input())
for _ in range(m):
  a,b=map(int,input().split())
  append(a*10**9+b)

def f(a,b):
  if a//10**9>=b//10**9 and a%10**9<=b%10**9:
    return True
  else:
    return False
Ans=[0]*m
for i in range(n):
  for j in range(m):
    if f(AB[i],XY[j]):
      Ans[j]+=1
ma=max(Ans)
if ma!=0:
  for i in range(m):
    if Ans[i]==ma:
      print(i+1)
else:
  print(0)
0