結果

問題 No.647 明太子
ユーザー akitsugu777
提出日時 2018-10-25 15:28:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 4,251 ms / 4,500 ms
コード長 503 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 91,328 KB
最終ジャッジ日時 2024-11-19 05:43:31
合計ジャッジ時間 10,916 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
nl = [list(map(int, input().split())) for _ in range(n)]

m = int(input())
ml = [list(map(int, input().split())) for _ in range(m)]

l = []
for i, (x, y) in enumerate(ml, 1):
    for a, b in nl:
        if x <= a and y >= b:
            l.append(i)

if len(l) == 0:
    print(0)
else:
    c = {}
    for i in l:
        if not i in c:
            c[i] = 1
        else:
            c[i] += 1
    x = max(c.values())

    l = []
    for i in c:
        if c[i] == x:
            print(i)
0