結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
12,696 KB
testcase_01 AC 11 ms
6,164 KB
testcase_02 AC 10 ms
6,176 KB
testcase_03 AC 11 ms
5,952 KB
testcase_04 AC 4,059 ms
6,520 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, v))

dp = [0] * 10001
tuples.sort()
for tup in tuples:
    for n in xrange(tup[0] - 1, -1, -1):
        v = min(dp[n] + tup[1], 10000)
        dp[v] = max(dp[v], dp[n] + tup[1]);

print max(dp)
0