結果

問題 No.54 Happy Hallowe'en
ユーザー yuki2006yuki2006
提出日時 2014-10-30 21:25:20
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 438 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 6,704 KB
実行使用メモリ 12,284 KB
最終ジャッジ日時 2023-08-28 23:29:40
合計ジャッジ時間 10,714 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
12,284 KB
testcase_01 AC 11 ms
6,164 KB
testcase_02 AC 12 ms
5,988 KB
testcase_03 AC 12 ms
5,912 KB
testcase_04 AC 3,998 ms
6,288 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
tuples = []
for _ in xrange(N):
    v, t = map(int, raw_input().split())
    tuples.append(t * 20000 + v)

dp = [-1] * 10001
dp[0] = 0
tuples.sort()
for tuple_value in tuples:
    V = tuple_value % 20000
    T = tuple_value // 20000
    for n in xrange(T - 1, -1, -1):
        if dp[n] == -1:
            continue
        v = min(n + V, 10000)
        dp[v] = max(dp[v], dp[n] + V);

print max(dp)
0