結果
問題 |
No.2596 Christmas Eve (Heuristic ver.)
|
ユーザー |
👑 |
提出日時 | 2023-12-26 01:13:10 |
言語 | cLay (20241019-1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 983 bytes |
コンパイル時間 | 3,390 ms |
コンパイル使用メモリ | 202,444 KB |
実行使用メモリ | 16,808 KB |
スコア | 0 |
最終ジャッジ日時 | 2023-12-26 01:13:19 |
合計ジャッジ時間 | 9,011 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 124 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:341:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ 341 | auto&[V]=*O.begin(); | ^ main.cpp:345:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ 345 | auto&[V]=*O.rbegin(); | ^ main.cpp:365:10: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ 365 | auto&[V]=*j++; | ^
ソースコード
#define I insert #define D erase #define S second #define V h,u,v,w,x #define U upper_bound #define l get<0>(*O.begin()) #define L get<0>(*O.rbegin()) ll@N,@K,@a[8N],H,p;set<pair<ll,ll>>A,C,E;rep(i,N)A.I({a[i],i}),C.I({a[2N+2i],2i}),C.I({a[2N+2i+1],2i+1}),E.I({a[6N+i],i});set<tuple<ll,ll,ll,ll,ll>>O;rep(K){auto x=E.begin(),u=A.U({x->first,N}),w=C.U({u->first,2N}),v=w++;O.I({a[N+u->S]+a[4N+v->S]+a[4N+w->S]+a[7N+x->S],u->S,v->S,w->S,x->S});A.D(u),C.D(v),C.D(w),E.D(x);}vector<ll>c,d,s={N,4N,4N,7N};decltype(A)*P[4]={&A,&C,&C,&E};Rand R;rep(n,1d6){if(n%2){auto&[V]=*O.begin();c={V};}else{auto&[V]=*O.rbegin();c={V};}d=c;p=R.get()%4;auto j=P[p]->begin();REP(R.get()%P[p]->size())j++;if(l<(H=c[0]-a[s[p]+c[p+1]]+a[s[p]+(d[p+1]=j->S)])<L&&a[6N+d[4]]<a[d[1]]<min(a[2N+d[2]],a[2N+d[3]])){O.I({H,d[1],d[2],d[3],d[4]}),P[p]->I({a[s[p]+c[p+1]],c[p+1]}),O.D({c[0],c[1],c[2],c[3],c[4]}),P[p]->D({a[s[p]+j->S],j->S});}}auto j=O.begin(),e=O.end();while(j!=e){auto&[V]=*j++;wt(u+1,v+1,w+1,x+1);}