結果

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

ソースコード

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 = []
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]
                del miracle_idx[:]
                miracle_idx.append(idx)
            elif max_val == counts[idx]:
                miracle_idx.append(idx)

for m in miracle_idx:
    print("{}".format(m + 1))
0