結果

問題 No.647 明太子
ユーザー GrayCoderGrayCoder
提出日時 2018-02-10 19:51:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,292 ms / 4,500 ms
コード長 703 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 10,808 KB
実行使用メモリ 11,188 KB
最終ジャッジ日時 2023-09-09 09:31:24
合計ジャッジ時間 4,000 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,760 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 17 ms
7,776 KB
testcase_03 AC 16 ms
7,812 KB
testcase_04 AC 16 ms
7,824 KB
testcase_05 AC 15 ms
7,828 KB
testcase_06 AC 15 ms
7,872 KB
testcase_07 AC 16 ms
7,824 KB
testcase_08 AC 16 ms
7,748 KB
testcase_09 AC 23 ms
8,348 KB
testcase_10 AC 28 ms
8,436 KB
testcase_11 AC 18 ms
8,260 KB
testcase_12 AC 27 ms
8,532 KB
testcase_13 AC 41 ms
8,604 KB
testcase_14 AC 319 ms
10,764 KB
testcase_15 AC 53 ms
8,736 KB
testcase_16 AC 24 ms
8,384 KB
testcase_17 AC 399 ms
10,884 KB
testcase_18 AC 409 ms
10,764 KB
testcase_19 AC 44 ms
10,620 KB
testcase_20 AC 39 ms
10,304 KB
testcase_21 AC 26 ms
9,232 KB
testcase_22 AC 1,292 ms
11,188 KB
testcase_23 AC 17 ms
8,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    AB = tuple(tuple(map(int, input().split())) for _ in [0] * N)
    M = int(input())
    XY = {int(i): tuple(map(int, input().split())) for i in range(M)}

    ab = dict()
    for i, (a, b) in enumerate(sorted(AB, reverse=True)):
        ab[i] = (a, b)

    men = [0] * M
    for i in range(M):
        x, y = XY[i]
        for j in range(N):
            a, b = ab[j]
            if x <= a:
                if y >= b:
                    men[i] += 1
            else:
                break

    max_ = max(men)
    if not max_:
        print(0)
    else:
        idx = [i for i, x in enumerate(men) if x == max_]
        for i in idx:
            print(i + 1)

main()
0