結果

問題 No.231 めぐるはめぐる (1)
ユーザー yaoshimaxyaoshimax
提出日時 2015-06-27 20:34:55
言語 Python2
(2.7.18)
結果
AC  
実行時間 15 ms / 1,000 ms
コード長 437 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 6,672 KB
実行使用メモリ 6,068 KB
最終ジャッジ日時 2023-08-07 18:39:30
合計ジャッジ時間 1,142 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
6,004 KB
testcase_01 AC 11 ms
6,016 KB
testcase_02 AC 11 ms
5,852 KB
testcase_03 AC 13 ms
6,004 KB
testcase_04 AC 15 ms
5,940 KB
testcase_05 AC 12 ms
5,964 KB
testcase_06 AC 13 ms
5,988 KB
testcase_07 AC 12 ms
5,940 KB
testcase_08 AC 12 ms
5,956 KB
testcase_09 AC 11 ms
6,068 KB
testcase_10 AC 11 ms
6,004 KB
testcase_11 AC 12 ms
6,024 KB
testcase_12 AC 13 ms
5,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(raw_input())
L=[]
for i in range(N):
    G,D=map(int,raw_input().split())
    L.append((G-D*30000,i+1))
L.sort()
L.reverse()
if( L[0][0]*6 < 3000000 ):
    print "NO"
else:
    print "YES"
    ind=0
    cur=0
    num=0
    while num<6:
        if cur+L[ind][0]+L[0][0]*(5-num) >= 3000000:
            print L[ind][1]
            cur+=L[ind][0]
            ind+=1
            num+=1
        else:
            ind=0
        ind%=N


0