結果

問題 No.647 明太子
コンテスト
ユーザー Lo_OT
提出日時 2018-03-29 10:37:33
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 1,585 ms / 4,500 ms
+ 668µs
コード長 744 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 279 ms
コンパイル使用メモリ 21,156 KB
実行使用メモリ 17,148 KB
最終ジャッジ日時 2026-07-30 21:40:33
合計ジャッジ時間 8,516 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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