結果

問題 No.647 明太子
ユーザー yomo3yomo3
提出日時 2020-02-18 20:30:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 340 ms / 4,500 ms
コード長 603 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 78,208 KB
最終ジャッジ日時 2024-04-16 04:14:31
合計ジャッジ時間 3,239 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
53,760 KB
testcase_01 AC 45 ms
53,248 KB
testcase_02 AC 44 ms
53,504 KB
testcase_03 AC 45 ms
53,632 KB
testcase_04 AC 44 ms
53,504 KB
testcase_05 AC 45 ms
53,760 KB
testcase_06 AC 46 ms
53,504 KB
testcase_07 AC 49 ms
60,544 KB
testcase_08 AC 49 ms
59,648 KB
testcase_09 AC 66 ms
66,304 KB
testcase_10 AC 73 ms
68,864 KB
testcase_11 AC 66 ms
64,768 KB
testcase_12 AC 76 ms
68,480 KB
testcase_13 AC 89 ms
72,576 KB
testcase_14 AC 170 ms
77,824 KB
testcase_15 AC 101 ms
77,056 KB
testcase_16 AC 73 ms
67,200 KB
testcase_17 AC 176 ms
77,824 KB
testcase_18 AC 220 ms
77,696 KB
testcase_19 AC 91 ms
77,056 KB
testcase_20 AC 97 ms
76,928 KB
testcase_21 AC 94 ms
77,056 KB
testcase_22 AC 340 ms
78,208 KB
testcase_23 AC 54 ms
61,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
import sys

def D(*a, **kwa):
    print(*a, file=sys.stderr, **kwa)

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
M = int(input())
XY = [[i] + list(map(int, input().split())) for i in range(M)]
XY.sort(key=lambda x: x[1])

c = Counter()

for i in range(N):
    a, b = AB[i]
    for xy in XY:
        if xy[1] <= a:
            if xy[2] >= b:
                c[xy[0]] += 1
        else:
            break
if len(c) == 0:
    ans = [0]
else:
    ma = max(c.values())
    ans = sorted(k+1 for k, v in c.items() if v == ma)

print(*ans, sep='\n')
0