結果

問題 No.647 明太子
コンテスト
ユーザー konabe
提出日時 2018-08-01 16:54:26
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 2,187 ms / 4,500 ms
コード長 718 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 519 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 16,116 KB
最終ジャッジ日時 2026-04-08 04:09:52
合計ジャッジ時間 11,805 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())
ABs = [[int(j) for j in input().split()] for i in range(N)]
M = int(input())
XYs = [[int(j) for j in input().split()] for i in range(M)]

def be_wanted(A, B, X, Y):
    if X <= A and B <= Y:
        return True
    else:
        return False

def argmax_s(X):
    tmp = -99999
    for i, x in enumerate(X):
        if tmp < x:
            tmp = x
            res = [i]
        elif tmp == x:
            res.append(i)
    return res
    
    

point = [0 for i in range(M)]
for i, xy in enumerate(XYs):
    for ab in ABs:
        if be_wanted(ab[0], ab[1], xy[0], xy[1]):
            point[i] += 1
            
if sum(point) == 0:
    print(0)
else:
    for i in (argmax_s(point)):
        print(i+1)
0