結果

問題 No.647 明太子
ユーザー takakintakakin
提出日時 2020-04-24 01:08:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 204 ms / 4,500 ms
コード長 555 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 73,044 KB
最終ジャッジ日時 2024-04-22 10:22:59
合計ジャッジ時間 2,899 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,020 KB
testcase_01 AC 38 ms
53,756 KB
testcase_02 AC 39 ms
53,132 KB
testcase_03 AC 39 ms
52,980 KB
testcase_04 AC 39 ms
53,036 KB
testcase_05 AC 39 ms
51,944 KB
testcase_06 AC 39 ms
53,772 KB
testcase_07 AC 50 ms
61,428 KB
testcase_08 AC 47 ms
60,868 KB
testcase_09 AC 55 ms
64,420 KB
testcase_10 AC 59 ms
64,728 KB
testcase_11 AC 53 ms
62,820 KB
testcase_12 AC 57 ms
65,328 KB
testcase_13 AC 68 ms
67,488 KB
testcase_14 AC 149 ms
72,648 KB
testcase_15 AC 74 ms
67,312 KB
testcase_16 AC 57 ms
63,660 KB
testcase_17 AC 195 ms
72,708 KB
testcase_18 AC 204 ms
72,896 KB
testcase_19 AC 66 ms
68,808 KB
testcase_20 AC 68 ms
67,980 KB
testcase_21 AC 57 ms
66,072 KB
testcase_22 AC 137 ms
73,044 KB
testcase_23 AC 49 ms
61,968 KB
権限があれば一括ダウンロードができます

ソースコード

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