結果

問題 No.647 明太子
ユーザー 141sksk141sksk
提出日時 2019-09-17 21:13:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,106 ms / 4,500 ms
コード長 667 bytes
コンパイル時間 1,140 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 9,284 KB
最終ジャッジ日時 2023-09-21 20:17:03
合計ジャッジ時間 6,256 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,688 KB
testcase_01 AC 15 ms
7,764 KB
testcase_02 AC 15 ms
7,784 KB
testcase_03 AC 15 ms
7,836 KB
testcase_04 AC 15 ms
7,752 KB
testcase_05 AC 14 ms
7,772 KB
testcase_06 AC 15 ms
7,784 KB
testcase_07 AC 15 ms
7,688 KB
testcase_08 AC 15 ms
7,760 KB
testcase_09 AC 23 ms
8,164 KB
testcase_10 AC 33 ms
8,188 KB
testcase_11 AC 20 ms
7,732 KB
testcase_12 AC 29 ms
8,232 KB
testcase_13 AC 47 ms
8,288 KB
testcase_14 AC 372 ms
8,980 KB
testcase_15 AC 64 ms
8,228 KB
testcase_16 AC 28 ms
8,220 KB
testcase_17 AC 471 ms
9,032 KB
testcase_18 AC 507 ms
9,000 KB
testcase_19 AC 134 ms
8,960 KB
testcase_20 AC 146 ms
8,772 KB
testcase_21 AC 62 ms
8,488 KB
testcase_22 AC 1,106 ms
9,284 KB
testcase_23 AC 17 ms
7,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():

    n = int(input())
    A = []
    B = []
    for _ in range(n):
        a, b = list(map(int, input().split()))
        A.append(a)
        B.append(b)
    m = int(input())
    X = []
    Y = []
    M = [0] * m
    for _ in range(m):
        x, y = list(map(int, input().split()))
        X.append(x)
        Y.append(y)
    for i in range(n):
        for j in range(m):
            if X[j] <= A[i] and Y[j] >= B[i]:
                M[j] += 1
    mx = max(M)
    
    if max(M) == 0:
        print("0")
    else:
        for x in range(m):
            if M[x] == mx:
                print(x + 1)
        
        


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