結果
問題 |
No.647 明太子
|
ユーザー |
![]() |
提出日時 | 2019-05-16 02:11:37 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 2,577 ms / 4,500 ms |
コード長 | 616 bytes |
コンパイル時間 | 234 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 14,592 KB |
最終ジャッジ日時 | 2024-09-15 06:08:11 |
合計ジャッジ時間 | 9,440 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
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)