結果

問題 No.647 明太子
ユーザー kohei2019
提出日時 2022-03-01 00:28:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 227 ms / 4,500 ms
コード長 417 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 77,056 KB
最終ジャッジ日時 2024-07-07 03:34:51
合計ジャッジ時間 3,134 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lsAB = [tuple(map(int,input().split())) for i in range(N)]
M = int(input())
lsXY = [tuple(map(int,input().split())) for i in range(M)]
cnt = [0]*(M)
for i in range(N):
    a,b = lsAB[i]
    for j in range(M):
        x,y = lsXY[j]
        if x <= a and y >= b:
            cnt[j] += 1
maxj = max(cnt)
if maxj == 0:
    print(0)
    exit()

for i in range(M):
    if cnt[i] == maxj:
        print(i+1)
0