結果

問題 No.27 板の準備
ユーザー yaoshimaxyaoshimax
提出日時 2015-02-14 22:49:18
言語 Python2
(2.7.18)
結果
AC  
実行時間 103 ms / 5,000 ms
コード長 498 bytes
コンパイル時間 826 ms
コンパイル使用メモリ 6,716 KB
実行使用メモリ 6,124 KB
最終ジャッジ日時 2023-08-27 03:25:27
合計ジャッジ時間 3,870 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
5,884 KB
testcase_01 AC 101 ms
5,880 KB
testcase_02 AC 101 ms
6,036 KB
testcase_03 AC 101 ms
5,948 KB
testcase_04 AC 102 ms
5,852 KB
testcase_05 AC 101 ms
5,952 KB
testcase_06 AC 102 ms
6,036 KB
testcase_07 AC 100 ms
6,024 KB
testcase_08 AC 101 ms
5,932 KB
testcase_09 AC 101 ms
6,088 KB
testcase_10 AC 101 ms
5,932 KB
testcase_11 AC 101 ms
5,988 KB
testcase_12 AC 103 ms
6,032 KB
testcase_13 AC 101 ms
5,948 KB
testcase_14 AC 101 ms
5,948 KB
testcase_15 AC 102 ms
6,032 KB
testcase_16 AC 101 ms
6,124 KB
testcase_17 AC 103 ms
5,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

V=map(int,raw_input().split())

ans = 150
for i in range(1,31):
   for j in range(i+1,31):
      for k in range(j+1,31):
         cnt = [500 for l in range(100)]
         cnt[0]=0
         for l in range(31):
            if cnt[l] != 500 :
               cnt[l+i] = min(cnt[l+i],cnt[l]+1)
               cnt[l+j] = min(cnt[l+j],cnt[l]+1)
               cnt[l+k] = min(cnt[l+k],cnt[l]+1)
         curCnt = 0
         for v in V:
            curCnt += cnt[v]
         ans = min(ans,curCnt)
print ans
0