結果

問題 No.647 明太子
ユーザー iad_2889iad_2889
提出日時 2019-05-16 02:11:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,661 ms / 4,500 ms
コード長 616 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 12,220 KB
最終ジャッジ日時 2023-10-13 09:00:31
合計ジャッジ時間 10,118 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,936 KB
testcase_01 AC 15 ms
7,776 KB
testcase_02 AC 15 ms
7,892 KB
testcase_03 AC 15 ms
7,892 KB
testcase_04 AC 16 ms
7,808 KB
testcase_05 AC 16 ms
7,808 KB
testcase_06 AC 16 ms
7,780 KB
testcase_07 AC 16 ms
7,816 KB
testcase_08 AC 16 ms
7,776 KB
testcase_09 AC 41 ms
8,244 KB
testcase_10 AC 67 ms
8,224 KB
testcase_11 AC 27 ms
7,936 KB
testcase_12 AC 56 ms
8,244 KB
testcase_13 AC 107 ms
8,528 KB
testcase_14 AC 1,043 ms
11,472 KB
testcase_15 AC 159 ms
8,784 KB
testcase_16 AC 52 ms
8,244 KB
testcase_17 AC 1,336 ms
11,748 KB
testcase_18 AC 1,395 ms
11,640 KB
testcase_19 AC 504 ms
11,456 KB
testcase_20 AC 539 ms
10,796 KB
testcase_21 AC 224 ms
9,412 KB
testcase_22 AC 2,661 ms
12,220 KB
testcase_23 AC 18 ms
7,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_buy(budget,taste):
    def _(price,hot):
        return budget >= price and taste <= hot
    return _

N = int(input())
members = [is_buy(*map(int,input().split())) for x in range(N)]
M = int(input())

mentaiko = {}
popular = 0
for i in range(M):
    price,hot = map(int,input().split())
    cnt = 0
    for member in members:
        if member(price,hot):
            cnt+=1
    if cnt:
        mentaiko[i + 1] = cnt
        popular = max(popular,cnt)

if mentaiko:
    mentaiko = sorted([x for x,y in mentaiko.items() if y == popular])
    for miracle in mentaiko:
        print(miracle)
else:
    print(0)
0