結果

問題 No.647 明太子
ユーザー ysys
提出日時 2018-02-09 22:37:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 551 ms / 4,500 ms
コード長 557 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 78,924 KB
最終ジャッジ日時 2023-09-09 09:23:13
合計ジャッジ時間 4,890 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
71,756 KB
testcase_01 AC 85 ms
71,392 KB
testcase_02 AC 85 ms
71,624 KB
testcase_03 AC 89 ms
71,440 KB
testcase_04 AC 84 ms
71,392 KB
testcase_05 AC 89 ms
71,484 KB
testcase_06 AC 87 ms
71,688 KB
testcase_07 AC 95 ms
77,160 KB
testcase_08 AC 97 ms
77,260 KB
testcase_09 AC 112 ms
77,224 KB
testcase_10 AC 119 ms
77,880 KB
testcase_11 AC 108 ms
77,616 KB
testcase_12 AC 119 ms
77,936 KB
testcase_13 AC 140 ms
78,416 KB
testcase_14 AC 264 ms
78,560 KB
testcase_15 AC 146 ms
78,228 KB
testcase_16 AC 113 ms
77,460 KB
testcase_17 AC 263 ms
78,568 KB
testcase_18 AC 286 ms
78,720 KB
testcase_19 AC 134 ms
77,892 KB
testcase_20 AC 134 ms
77,864 KB
testcase_21 AC 125 ms
77,844 KB
testcase_22 AC 551 ms
78,924 KB
testcase_23 AC 105 ms
77,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N = int(input())
rec = []
for i in range(N):
    a, b = map(int, input().split())
    rec.append((a, b))

M = int(input())
max_ = 0
dic = defaultdict(int)
tmp = []
for i in range(M):
    x, y = map(int, input().split())
    for s in rec:
        if s[0] >= x and s[1] <= y:
            dic[i] += 1
            if dic[i] == max_:
                tmp.append(i)
            if dic[i] > max_:
                max_ = dic[i]
                tmp = [i]

if len(tmp) == 0:
    print(0)
else:
    for i in tmp:
        print(i + 1)
0