結果

問題 No.647 明太子
ユーザー rykawrykaw
提出日時 2018-02-20 13:49:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,925 ms / 4,500 ms
コード長 725 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-06-07 22:07:15
合計ジャッジ時間 10,202 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,752 KB
testcase_01 AC 28 ms
10,752 KB
testcase_02 AC 28 ms
10,752 KB
testcase_03 AC 28 ms
10,752 KB
testcase_04 AC 27 ms
10,880 KB
testcase_05 AC 27 ms
10,752 KB
testcase_06 AC 28 ms
10,752 KB
testcase_07 AC 28 ms
10,752 KB
testcase_08 AC 28 ms
10,880 KB
testcase_09 AC 53 ms
10,880 KB
testcase_10 AC 77 ms
10,880 KB
testcase_11 AC 39 ms
10,880 KB
testcase_12 AC 63 ms
10,880 KB
testcase_13 AC 109 ms
11,008 KB
testcase_14 AC 1,032 ms
12,416 KB
testcase_15 AC 157 ms
11,008 KB
testcase_16 AC 62 ms
10,880 KB
testcase_17 AC 1,229 ms
12,544 KB
testcase_18 AC 1,262 ms
12,672 KB
testcase_19 AC 296 ms
12,416 KB
testcase_20 AC 329 ms
12,032 KB
testcase_21 AC 147 ms
11,392 KB
testcase_22 AC 3,925 ms
12,800 KB
testcase_23 AC 31 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input()) # members
members = [list(map(int, input().rstrip().split(' '))) for i in range(0, N)]

M = int(input()) # mentaiko

counts = [0 for _ in range(0, M)]
miracle_idx = []
max_val = -1

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

    for member in members:
        if member[0] >= m[0] and member[1] <= m[1]:
            counts[idx] += 1

            if max_val < counts[idx]:
                max_val = counts[idx]
                del miracle_idx[:]
                miracle_idx.append(idx)

            elif max_val == counts[idx]:
                miracle_idx.append(idx)

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