結果

問題 No.647 明太子
ユーザー _KingdomOfMoray_KingdomOfMoray
提出日時 2019-11-27 19:56:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,068 ms / 4,500 ms
コード長 659 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,904 KB
最終ジャッジ日時 2024-04-26 17:17:21
合計ジャッジ時間 9,438 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,624 KB
testcase_01 AC 31 ms
10,624 KB
testcase_02 AC 30 ms
10,624 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 30 ms
10,624 KB
testcase_05 AC 31 ms
10,624 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 32 ms
10,752 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 50 ms
10,880 KB
testcase_10 AC 73 ms
10,752 KB
testcase_11 AC 40 ms
11,008 KB
testcase_12 AC 64 ms
10,880 KB
testcase_13 AC 109 ms
11,008 KB
testcase_14 AC 904 ms
11,520 KB
testcase_15 AC 149 ms
10,880 KB
testcase_16 AC 60 ms
10,752 KB
testcase_17 AC 1,126 ms
11,648 KB
testcase_18 AC 1,275 ms
11,520 KB
testcase_19 AC 351 ms
11,520 KB
testcase_20 AC 383 ms
11,392 KB
testcase_21 AC 151 ms
11,008 KB
testcase_22 AC 3,068 ms
11,904 KB
testcase_23 AC 31 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!

n = int(input())
a = []
b = []
for i in range(n):
    ai,bi=[int(i) for i in input().split()]
    a.append(ai)
    b.append(bi)
m = int(input())
x = []
y = []
for i in range(m):
    xi,yi=[int(i) for i in input().split()]
    x.append(xi)
    y.append(yi)

count = [0] * m

for i in range(n):
    price = a[i]
    hot = b[i]
    
    for j in range(m):
        if x[j] <= price and y[j] >= hot:
            count[j] += 1

max_tarako = max(count)

if max_tarako != 0:
    max_index = [i for i, x in enumerate(count) if x == max_tarako]
    
    for i in range(len(max_index)):
        print(max_index[i]+1)
else:
    print(0)
0