結果

問題 No.231 めぐるはめぐる (1)
ユーザー steek79steek79
提出日時 2015-11-11 15:36:30
言語 Python2
(2.7.18)
結果
AC  
実行時間 97 ms / 1,000 ms
コード長 536 bytes
コンパイル時間 40 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 7,424 KB
最終ジャッジ日時 2024-04-25 12:39:32
合計ジャッジ時間 1,527 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
7,424 KB
testcase_01 AC 13 ms
7,296 KB
testcase_02 AC 13 ms
7,296 KB
testcase_03 AC 20 ms
7,168 KB
testcase_04 AC 15 ms
7,296 KB
testcase_05 AC 14 ms
7,168 KB
testcase_06 AC 15 ms
7,168 KB
testcase_07 AC 97 ms
7,296 KB
testcase_08 AC 95 ms
7,296 KB
testcase_09 AC 13 ms
7,040 KB
testcase_10 AC 13 ms
7,296 KB
testcase_11 AC 13 ms
7,296 KB
testcase_12 AC 20 ms
7,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
# -*- coding: utf-8 -*-
import itertools
import random

N = input()
GD = [map(int, raw_input().split()) for loop in xrange(N)]

exp = [GD[0] - 30000*GD[1] for GD in GD]
easiest = max(exp)

if max(exp) * 6 >= 3000000:
    print 'YES'
    for loop in xrange(10000):
        routes = [random.randint(0, N-1) for loop in range(6)]
        if sum([exp[r] for r in routes]) >= 3000000:
            break
    else:
        routes = [exp.index(max(exp))] * 6
    for route in routes:
        print route+1
else:
    print 'NO'
0