結果
問題 | No.2982 Logic Battle |
ユーザー |
![]() |
提出日時 | 2024-12-07 19:49:54 |
言語 | cLay (20241019-1) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 610 bytes |
コンパイル時間 | 3,746 ms |
コンパイル使用メモリ | 181,688 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-07 19:49:59 |
合計ジャッジ時間 | 4,320 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
ソースコード
struct A{ll d,x;};bool operator<(A const&a, A const&b){return a.d>b.d?true:a.d<b.d?false:a.x>b.x;}{vector<A> s[3];s[0].push_back({0,0});s[1].push_back({0,0});ll@n;rrep(h,n){ll@a[3];vector<A> t[3];rep(i,3){vector<A> u;rep(j,3){if(i!=j){for(auto b:s[j]){ll x=b.x+a[i];u.push_back({b.d+x,x=x==0?0:x-1});}}}sort(u.begin(),u.end());ll w=-1;for(auto b:u){if(b.x>w){w=b.x;t[i].push_back(b);}}}rep(i,3){s[i]=t[i];}}ll z=0;rep(i,3){for(auto b:s[i]){z=max(z,b.d);}}wt(z);}