結果

問題 No.647 明太子
ユーザー togacodertogacoder
提出日時 2018-02-15 16:51:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,148 ms / 4,500 ms
コード長 670 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 9,956 KB
最終ジャッジ日時 2023-09-09 09:34:34
合計ジャッジ時間 4,644 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,768 KB
testcase_01 AC 16 ms
7,852 KB
testcase_02 AC 16 ms
7,908 KB
testcase_03 AC 16 ms
7,908 KB
testcase_04 AC 16 ms
7,904 KB
testcase_05 AC 16 ms
7,936 KB
testcase_06 AC 16 ms
7,984 KB
testcase_07 AC 16 ms
7,840 KB
testcase_08 AC 17 ms
7,772 KB
testcase_09 AC 26 ms
8,240 KB
testcase_10 AC 34 ms
8,240 KB
testcase_11 AC 20 ms
7,840 KB
testcase_12 AC 31 ms
8,288 KB
testcase_13 AC 50 ms
8,360 KB
testcase_14 AC 399 ms
9,576 KB
testcase_15 AC 69 ms
8,528 KB
testcase_16 AC 29 ms
8,344 KB
testcase_17 AC 494 ms
9,568 KB
testcase_18 AC 533 ms
9,528 KB
testcase_19 AC 164 ms
9,452 KB
testcase_20 AC 170 ms
9,192 KB
testcase_21 AC 73 ms
8,720 KB
testcase_22 AC 1,148 ms
9,956 KB
testcase_23 AC 17 ms
7,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    ab = []
    for i in range(n):
        a, b = map(int, input().split())
        ab.append([a, b])

    m = int(input())
    count = [0 for i in range(m)]
    maxans = 0
    for i in range(m):
        x, y = map(int, input().split())
        for j in range(n):
            if x <= ab[j][0] and ab[j][1] <= y:
                count[i] += 1
        if maxans < count[i]:
            maxans = count[i]

    ans = []
    if maxans == 0:
        ans.append(0)
    else:
        for i in range(m):
            if maxans == count[i]:
                ans.append(i + 1)
    for i in ans:
        print(i)

if __name__ == '__main__':
    main()
0