結果

問題 No.647 明太子
ユーザー Lo_OTLo_OT
提出日時 2018-03-29 10:37:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,233 ms / 4,500 ms
コード長 744 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 10,848 KB
実行使用メモリ 10,384 KB
最終ジャッジ日時 2023-09-09 09:44:58
合計ジャッジ時間 7,908 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,904 KB
testcase_01 AC 15 ms
7,932 KB
testcase_02 AC 15 ms
7,780 KB
testcase_03 AC 15 ms
7,968 KB
testcase_04 AC 15 ms
7,804 KB
testcase_05 AC 15 ms
7,760 KB
testcase_06 AC 16 ms
7,784 KB
testcase_07 AC 16 ms
7,776 KB
testcase_08 AC 16 ms
7,888 KB
testcase_09 AC 34 ms
8,260 KB
testcase_10 AC 52 ms
8,340 KB
testcase_11 AC 25 ms
7,792 KB
testcase_12 AC 46 ms
8,356 KB
testcase_13 AC 83 ms
8,292 KB
testcase_14 AC 762 ms
9,936 KB
testcase_15 AC 116 ms
8,452 KB
testcase_16 AC 42 ms
8,292 KB
testcase_17 AC 942 ms
10,188 KB
testcase_18 AC 1,071 ms
10,156 KB
testcase_19 AC 324 ms
9,884 KB
testcase_20 AC 372 ms
9,612 KB
testcase_21 AC 137 ms
8,744 KB
testcase_22 AC 2,233 ms
10,384 KB
testcase_23 AC 17 ms
7,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

member = []
menta = []

# 10^4
n = int(input())
for _ in range(n):
    member.append(list(map(int, input().split())))

# 10^3
m = int(input())
for _ in range(m):
    menta.append(list(map(int, input().split())))

# print(member)
# print(menta)

# 10^3 * 10^4
numOfBuy = []
for index, (x, y) in enumerate(menta):
    # print('menta ', index, x, y)
    current = 0
    for a, b in member:
        # print(f'member (yen, spice) = ({a}, {b})')
        if x <= a and b <= y:
            current += 1
    numOfBuy.append(current)
    # print(f'{index} : menta = {current}')

# print(numOfBuy)
if max(numOfBuy) == 0:
    print(0)
else:
    max = max(numOfBuy)
    for idx, num in enumerate(numOfBuy):
        if num == max:
            print(idx + 1)
0