結果

問題 No.231 めぐるはめぐる (1)
ユーザー kutsutamakutsutama
提出日時 2019-01-31 19:06:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 19 ms / 1,000 ms
コード長 511 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 8,360 KB
最終ジャッジ日時 2023-08-10 19:54:24
合計ジャッジ時間 1,283 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,360 KB
testcase_01 AC 16 ms
7,896 KB
testcase_02 AC 15 ms
7,964 KB
testcase_03 AC 17 ms
7,908 KB
testcase_04 AC 18 ms
8,304 KB
testcase_05 AC 17 ms
7,964 KB
testcase_06 AC 17 ms
8,220 KB
testcase_07 AC 16 ms
7,744 KB
testcase_08 AC 17 ms
7,792 KB
testcase_09 AC 16 ms
7,728 KB
testcase_10 AC 15 ms
7,800 KB
testcase_11 AC 15 ms
7,772 KB
testcase_12 AC 17 ms
7,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
velo = [(i, 0) for i in range(1, n + 1)]
maxi = 0
max_num = 1
for i in range(n):
    g, d = [int(x) for x in input().split()]
    velo[i] = (i + 1, g - 30000 * d)

velo.sort(key=lambda p: p[1])
best = velo[-6:]
best += [best[-1]] * (6 - len(best))
if best[-1][1] * 6 >= 3 * 10 ** 6:
    for i in range(len(best)):
        if sum([p[1] for p in best]) >= 3 * 10 ** 6:
            break
        best[i] = best[-1]
    print('YES')
    print(*[p[0] for p in best], sep='\n')
else:
    print('NO')
0