結果

問題 No.647 明太子
コンテスト
ユーザー Mario
提出日時 2018-05-15 18:22:49
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 1,812 ms / 4,500 ms
コード長 561 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 520 ms
コンパイル使用メモリ 20,696 KB
実行使用メモリ 16,732 KB
最終ジャッジ日時 2026-03-17 05:05:42
合計ジャッジ時間 6,961 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
members = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x:-x[0])
m = int(input())
mentaiko = [list(map(int, input().split())) for _ in range(m)]
mentaiko_count = [0] * m

for i, (x, y) in enumerate(mentaiko):
    for price, hot in members:
        if x <= price:
            if y >= hot:
                mentaiko_count[i] += 1
        else:
            break

kiseki = [i + 1 for i, x in enumerate(mentaiko_count) if x == max(mentaiko_count) and x != 0]
if kiseki == []:
    print(0)
else:
    print(*kiseki, sep="\n")
0