結果

問題 No.27 板の準備
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-12-31 11:30:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 5,000 ms
コード長 537 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 81,944 KB
実行使用メモリ 76,436 KB
最終ジャッジ日時 2024-04-16 22:22:11
合計ジャッジ時間 3,125 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
76,100 KB
testcase_01 AC 101 ms
76,000 KB
testcase_02 AC 105 ms
76,088 KB
testcase_03 AC 102 ms
76,296 KB
testcase_04 AC 105 ms
76,192 KB
testcase_05 AC 104 ms
76,296 KB
testcase_06 AC 104 ms
76,172 KB
testcase_07 AC 104 ms
76,336 KB
testcase_08 AC 104 ms
76,324 KB
testcase_09 AC 104 ms
76,304 KB
testcase_10 AC 105 ms
76,292 KB
testcase_11 AC 102 ms
76,004 KB
testcase_12 AC 105 ms
76,432 KB
testcase_13 AC 103 ms
76,316 KB
testcase_14 AC 103 ms
76,436 KB
testcase_15 AC 103 ms
76,292 KB
testcase_16 AC 101 ms
76,348 KB
testcase_17 AC 103 ms
76,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

V = list(map(int,input().split()))
ans = sum(V)
M = 31
for i in range(1,M):
    for j in range(1,M):
        for k in range(1,M):
            cost = [1000]*M
            cost[0] = 0
            for t in ((i,j,k)):
                for l in range(M):
                    if cost[l] == 1000:
                        continue
                    if l+t < M:
                        cost[l+t] = min(cost[l+t],cost[l]+1)
            count = 0
            for v in V:
                count += cost[v]
            ans = min(ans,count)
print(ans)
0