結果
| 問題 | No.27 板の準備 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-07 23:54:02 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 17 ms / 5,000 ms |
| コード長 | 574 bytes |
| 記録 | |
| コンパイル時間 | 1,061 ms |
| コンパイル使用メモリ | 214,144 KB |
| 実行使用メモリ | 9,196 KB |
| 最終ジャッジ日時 | 2026-07-05 22:00:14 |
| 合計ジャッジ時間 | 2,561 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
vector<int> V(4);
int an=1e9;
for(int i=0;i<4;i++)cin>>V[i];
for(int a=1;a<=30;a++)for(int b=1;b<a;b++)for(int c=1;c<b;c++){
vector<int> DP(61,3e8);
DP[0]=0;
for(int j=0;j<30;j++){
for(int k:{a,b,c}){
DP[j+k]=min(DP[j]+1,DP[j+k]);
}
}
int res=0;
for(int j=0;j<4;j++)res+=DP[V[j]];
an=min(an,res);
}
cout<<an<<endl;
}