結果
問題 | No.472 平均順位 |
ユーザー | pluto77 |
提出日時 | 2018-01-05 13:35:56 |
言語 | Python2 (2.7.18) |
結果 |
TLE
|
実行時間 | - |
コード長 | 386 bytes |
コンパイル時間 | 687 ms |
コンパイル使用メモリ | 6,656 KB |
実行使用メモリ | 10,388 KB |
最終ジャッジ日時 | 2023-08-24 20:16:51 |
合計ジャッジ時間 | 8,820 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 11 ms
10,256 KB |
testcase_01 | AC | 11 ms
5,892 KB |
testcase_02 | AC | 11 ms
6,000 KB |
testcase_03 | AC | 11 ms
5,960 KB |
testcase_04 | AC | 17 ms
5,840 KB |
testcase_05 | AC | 11 ms
5,960 KB |
testcase_06 | AC | 13 ms
5,900 KB |
testcase_07 | AC | 38 ms
5,988 KB |
testcase_08 | AC | 473 ms
6,036 KB |
testcase_09 | TLE | - |
testcase_10 | AC | 1,320 ms
5,904 KB |
testcase_11 | TLE | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
ソースコード
#yuki_472 INF=float('inf') n,p=map(int,raw_input().split()) dp = [INF for i in xrange(p+4)] for i in xrange(n): a,b,c=map(int,raw_input().split()) if i == 0: dp[0]=a dp[1]=b dp[2]=c dp[3]=1 continue for j in xrange(p,-1,-1): dp[j]=dp[j]+a if j>0: dp[j]=min(dp[j],dp[j-1]+b) if j>1: dp[j]=min(dp[j],dp[j-2]+c) if j>2: dp[j]=min(dp[j],dp[j-3]+1) print 1.0*dp[p]/n