結果

問題 No.647 明太子
ユーザー rykawrykaw
提出日時 2018-02-20 13:49:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,526 ms / 4,500 ms
コード長 725 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 10,260 KB
最終ジャッジ日時 2023-08-27 02:23:55
合計ジャッジ時間 9,180 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,768 KB
testcase_01 AC 15 ms
7,780 KB
testcase_02 AC 14 ms
7,824 KB
testcase_03 AC 15 ms
7,892 KB
testcase_04 AC 16 ms
7,780 KB
testcase_05 AC 14 ms
7,824 KB
testcase_06 AC 14 ms
7,808 KB
testcase_07 AC 15 ms
7,792 KB
testcase_08 AC 14 ms
7,872 KB
testcase_09 AC 34 ms
8,264 KB
testcase_10 AC 59 ms
8,356 KB
testcase_11 AC 23 ms
7,784 KB
testcase_12 AC 49 ms
8,320 KB
testcase_13 AC 90 ms
8,192 KB
testcase_14 AC 901 ms
9,948 KB
testcase_15 AC 138 ms
8,312 KB
testcase_16 AC 43 ms
8,316 KB
testcase_17 AC 1,060 ms
9,952 KB
testcase_18 AC 1,144 ms
10,028 KB
testcase_19 AC 250 ms
9,860 KB
testcase_20 AC 276 ms
9,452 KB
testcase_21 AC 108 ms
8,712 KB
testcase_22 AC 3,526 ms
10,260 KB
testcase_23 AC 17 ms
7,788 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