結果

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

ソースコード

diff #

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

M = int(input()) # mentaiko

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

for idx in range(0, M):
    m = list(map(int, input().rstrip().split(' ')))

    for member in members:
        if member[0] >= m[0] and member[1] <= m[1]:
            counts[idx] += 1

            if max_val == counts[idx]:
                miracle_idx.append(idx)

            elif max_val < counts[idx]:
                max_val = counts[idx]
                del miracle_idx[:]
                miracle_idx.append(idx)

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