結果

問題 No.647 明太子
ユーザー hedwig100hedwig100
提出日時 2020-05-15 19:51:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,245 ms / 4,500 ms
コード長 685 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 11,788 KB
実行使用メモリ 11,680 KB
最終ジャッジ日時 2023-10-19 10:04:53
合計ジャッジ時間 7,860 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,092 KB
testcase_01 AC 31 ms
10,092 KB
testcase_02 AC 29 ms
10,092 KB
testcase_03 AC 30 ms
10,092 KB
testcase_04 AC 30 ms
10,092 KB
testcase_05 AC 29 ms
10,092 KB
testcase_06 AC 29 ms
10,092 KB
testcase_07 AC 30 ms
10,096 KB
testcase_08 AC 31 ms
10,100 KB
testcase_09 AC 45 ms
10,196 KB
testcase_10 AC 63 ms
10,216 KB
testcase_11 AC 38 ms
10,152 KB
testcase_12 AC 55 ms
10,220 KB
testcase_13 AC 85 ms
10,296 KB
testcase_14 AC 655 ms
11,336 KB
testcase_15 AC 116 ms
10,368 KB
testcase_16 AC 52 ms
10,204 KB
testcase_17 AC 798 ms
11,432 KB
testcase_18 AC 872 ms
11,412 KB
testcase_19 AC 160 ms
11,284 KB
testcase_20 AC 176 ms
11,076 KB
testcase_21 AC 81 ms
10,556 KB
testcase_22 AC 3,245 ms
11,680 KB
testcase_23 AC 32 ms
10,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(100000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():  
    N = int(input())
    want = [tuple(map(int,input().split())) for _ in range(N)]
    M = int(input())
    mentaiko = [tuple(map(int,input().split())) for _ in range(M)]

    bought = [0] * M
    max_bought = 0
    for a,b in want:
        for i,(x,y) in enumerate(mentaiko):
            if x <= a and b <= y:
                bought[i] += 1
                max_bought = max(max_bought,bought[i])

    if max_bought == 0:
        print(0)
    else:
        ans = [i + 1 for i in range(M) if bought[i] == max_bought]
        print('\n'.join(map(str,ans)))
if __name__ == '__main__':
    main()
0