結果

問題 No.647 明太子
ユーザー rykaw
提出日時 2018-02-20 12:58:15
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 596 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 12,672 KB
最終ジャッジ日時 2024-12-26 08:10:13
合計ジャッジ時間 11,664 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input()) # members
members = [list(map(int, input().rstrip().split(' '))) for i in range(0, N)]

M = int(input()) # mentaiko
mentaiko = [list(map(int, input().rstrip().split(' '))) for i in range(0, M)]

counts = [0 for _ in range(0, M)]
miracle_idx = -1
max_val = -1

for member in members:
    for (idx, m) in enumerate(mentaiko):
        if (member[0] >= m[0] and member[1] <= m[1]):
            counts[idx] += 1
            if max_val < counts[idx]:
                max_val = counts[idx]
                miracle_idx = idx

print("{}".format(miracle_idx + 1 if miracle_idx > 0 else 0))
0