結果
問題 | No.647 明太子 |
ユーザー |
![]() |
提出日時 | 2018-02-09 22:58:57 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 336 ms / 4,500 ms |
コード長 | 709 bytes |
コンパイル時間 | 145 ms |
コンパイル使用メモリ | 82,036 KB |
実行使用メモリ | 77,928 KB |
最終ジャッジ日時 | 2024-06-27 02:34:29 |
合計ジャッジ時間 | 3,408 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#!/usr/bin/env pypyimport collectionsdef count_miracle_items(conds, props):ctr = collections.Counter()for j, (x, y) in enumerate(props, start=1):for a, b in conds:if x <= a and y >= b:ctr[j] += 1try:max_num = ctr.most_common(1)[0][1]except IndexError:return [0]else:return [k for k, v in ctr.items() if v == max_num]def main():n = int(input())conds = [tuple(int(ab) for ab in input().split()) for _ in range(n)]m = int(input())props = [tuple(int(z) for z in input().split()) for _ in range(m)]print(*count_miracle_items(conds, props), sep="\n")if __name__ == '__main__':main()