結果
問題 |
No.2596 Christmas Eve (Heuristic ver.)
|
ユーザー |
👑 |
提出日時 | 2023-12-24 13:36:23 |
言語 | cLay (20241019-1) |
結果 |
WA
|
実行時間 | - |
コード長 | 853 bytes |
コンパイル時間 | 2,771 ms |
コンパイル使用メモリ | 197,072 KB |
実行使用メモリ | 6,676 KB |
スコア | 0 |
最終ジャッジ日時 | 2023-12-24 13:38:34 |
合計ジャッジ時間 | 128,630 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 121 TLE * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:259:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ 259 | auto&[h,V]=*O.begin(); | ^ main.cpp:272:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ 272 | auto&[h,V]=*O.rbegin(); | ^ main.cpp:289:10: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ 289 | auto&[h,V]=*j++; | ^
ソースコード
#define I insert #define S second #define V u,v,w,x ll@N,@K,@a[8N],H;set<pair<ll,ll>>A,C,E;rep(i,N)A.I({a[i],i+1}),C.I({a[2N+2i],2i}),C.I({a[2N+2i],2i+1}),E.I({a[6N+i],i});set<tuple<ll,ll,ll,ll,ll>> O;rep(K){auto x=E.begin(),u=A.upper_bound({x->first,N}),v=C.upper_bound({u->first,2N}),w=v++;O.I({a[N+u->S]+a[4N+v->S]+a[4N+w->S]+a[7N+x->S],u->S+1,v->S+1,w->S+1,x->S+1});A.erase(u),C.erase(v),C.erase(w),E.erase(x);}REP(n,1d8){if(n%2){auto&[h,V]=*O.begin();auto y=E.upper_bound({6N+x,2N}),e=E.end();if(y!=e)if(h<(H=h-a[7N+x]+a[7N+y->S]))O.erase({h,V}),O.I({H,u,v,w,y->S+1}),E.erase(y),E.I({a[7N+x],x});}else{auto&[h,V]=*O.rbegin();auto y=E.lower_bound({6N+x,2N}),e=E.begin();if(y!=e){y--;if(h>(H=h-a[7N+x]+a[7N+y->S]))O.erase({h,V}),O.I({H,u,v,w,y->S+1}),E.erase(y),E.I({a[7N+x],x});}}}auto j=O.begin(),e=O.end();while(j!=e){auto&[h,V]=*j++;wt(u,v,w,x);}