結果

問題 No.647 明太子
ユーザー konabekonabe
提出日時 2018-08-01 16:32:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 847 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 11,960 KB
実行使用メモリ 25,960 KB
最終ジャッジ日時 2023-10-19 20:42:35
合計ジャッジ時間 8,815 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,192 KB
testcase_01 AC 32 ms
10,192 KB
testcase_02 AC 29 ms
10,192 KB
testcase_03 AC 30 ms
10,192 KB
testcase_04 AC 29 ms
10,192 KB
testcase_05 AC 30 ms
10,192 KB
testcase_06 AC 30 ms
10,192 KB
testcase_07 AC 32 ms
10,196 KB
testcase_08 AC 32 ms
10,196 KB
testcase_09 AC 165 ms
10,548 KB
testcase_10 AC 622 ms
10,712 KB
testcase_11 AC 139 ms
10,344 KB
testcase_12 AC 341 ms
10,852 KB
testcase_13 AC 993 ms
11,360 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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
    ind = -1
    for i, x in enumerate(X):
        if tmp < x:
            tmp = x
            ind = i
    return [i for i in range(len(X)) if X[i] == tmp]
    
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

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