結果

問題 No.647 明太子
ユーザー rykawrykaw
提出日時 2018-02-20 14:11:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,382 ms / 4,500 ms
コード長 734 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 10,996 KB
実行使用メモリ 10,268 KB
最終ジャッジ日時 2023-09-09 09:35:39
合計ジャッジ時間 8,691 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,836 KB
testcase_01 AC 14 ms
7,872 KB
testcase_02 AC 14 ms
7,932 KB
testcase_03 AC 15 ms
7,796 KB
testcase_04 AC 15 ms
7,952 KB
testcase_05 AC 16 ms
7,936 KB
testcase_06 AC 16 ms
7,864 KB
testcase_07 AC 16 ms
7,800 KB
testcase_08 AC 15 ms
7,876 KB
testcase_09 AC 30 ms
8,328 KB
testcase_10 AC 46 ms
8,400 KB
testcase_11 AC 23 ms
7,868 KB
testcase_12 AC 41 ms
8,292 KB
testcase_13 AC 72 ms
8,276 KB
testcase_14 AC 663 ms
10,156 KB
testcase_15 AC 101 ms
8,468 KB
testcase_16 AC 36 ms
8,200 KB
testcase_17 AC 802 ms
10,160 KB
testcase_18 AC 855 ms
10,012 KB
testcase_19 AC 471 ms
9,984 KB
testcase_20 AC 485 ms
9,640 KB
testcase_21 AC 173 ms
8,912 KB
testcase_22 AC 3,382 ms
10,268 KB
testcase_23 AC 17 ms
7,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input()) # members
members = [list(map(int, input().rstrip().split(' '))) for i in range(0, N)]
members.sort(key=lambda x:x[1])

M = int(input()) # mentaiko

miracle_idx = []
max_val = -1

for idx in range(0, M):
    cnt = 0
    m = list(map(int, input().rstrip().split(' ')))

    for member in members:
        if member[1] <= m[1]:
            if member[0] >= m[0]:
                cnt += 1

                if max_val == cnt:
                    miracle_idx.append(idx)

                elif max_val < cnt:
                    max_val = cnt
                    miracle_idx = [idx]
        else:
            break

if len(miracle_idx) == 0:
    print("0")
else:
    for m in miracle_idx:
        print("{}".format(m + 1))
0