結果
問題 | No.1122 Plane Tickets |
ユーザー |
👑 ![]() |
提出日時 | 2023-04-11 18:13:14 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 662 bytes |
コンパイル時間 | 2,071 ms |
コンパイル使用メモリ | 199,200 KB |
最終ジャッジ日時 | 2025-02-12 05:07:10 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 44 RE * 11 |
ソースコード
#include<bits/stdc++.h>using namespace std;#define rep(i,a,b) for(int i=a;i<b;i++)using ll = long long;#define all(p) p.begin(),p.end()int main(){vector<ll> p(5);rep(i,0,5) cin>>p[i];vector<ll> base(5);ll ans=1e18;int L=0,R=6;ll K=6;auto f=[&](auto self,int ind)->void{if(ind<5){for(int i=L;i<R+1;i++){base[ind]=i;self(self,ind+1);}}if(ind==5){bool ok=1;rep(i,0,5){int tmp=0;rep(j,0,3){tmp+=base[(i+j)%5];}if(tmp<K) ok=0;}if(ok){ll v=0;rep(i,0,5){v+=base[i]*p[i];}ans=min(ans,v);}}};f(f,0);assert(ans%K==0);std::cout<<ans/K<<"\n";}