結果

問題 No.647 明太子
ユーザー akitsugu777akitsugu777
提出日時 2018-10-25 15:06:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 4,331 ms / 4,500 ms
コード長 565 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 91,140 KB
最終ジャッジ日時 2024-04-29 21:36:45
合計ジャッジ時間 11,412 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,624 KB
testcase_01 AC 32 ms
10,880 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 29 ms
10,624 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 AC 29 ms
10,752 KB
testcase_06 AC 28 ms
10,624 KB
testcase_07 AC 30 ms
10,624 KB
testcase_08 AC 30 ms
10,752 KB
testcase_09 AC 55 ms
11,264 KB
testcase_10 AC 80 ms
11,520 KB
testcase_11 AC 41 ms
11,008 KB
testcase_12 AC 78 ms
11,392 KB
testcase_13 AC 122 ms
12,032 KB
testcase_14 AC 1,071 ms
22,528 KB
testcase_15 AC 174 ms
12,416 KB
testcase_16 AC 65 ms
11,264 KB
testcase_17 AC 1,278 ms
24,704 KB
testcase_18 AC 1,483 ms
25,088 KB
testcase_19 AC 404 ms
12,416 KB
testcase_20 AC 388 ms
12,160 KB
testcase_21 AC 179 ms
11,264 KB
testcase_22 AC 4,331 ms
91,140 KB
testcase_23 AC 32 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
nl = [list(map(int, input().split())) for _ in range(n)]

m = int(input())
ml = [list(map(int, input().split())) for _ in range(m)]

ml2 = []
for i in range(len(ml)):
    ml2.append([i+1, ml[i][0], ml[i][1]])

l = []
for i, x, y in ml2:
    for a, b in nl:
        if x <= a and y >= b:
            l.append(i)

if len(l) == 0:
    print(0)
else:
    c = {}
    for i in l:
        if not i in c:
            c[i] = 1
        else:
            c[i] += 1
    x = max(c.values())

    l = []
    for i in c:
        if c[i] == x:
            print(i)
0