結果

問題 No.2596 Christmas Eve (Heuristic ver.)
ユーザー 👑 p-adic
提出日時 2023-12-24 14:26:22
言語 cLay
(20241019-1)
結果
WA  
実行時間 -
コード長 1,163 bytes
コンパイル時間 3,005 ms
コンパイル使用メモリ 198,804 KB
実行使用メモリ 6,676 KB
スコア 0
最終ジャッジ日時 2023-12-24 14:26:52
合計ジャッジ時間 28,805 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 125
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:261:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  261 |       auto&[h,V]=*O.begin();
      |            ^
main.cpp:274:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  274 |       auto&[h,V]=*O.begin();
      |            ^
main.cpp:287:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  287 |       auto&[h,V]=*O.rbegin();
      |            ^
main.cpp:300:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  300 |       auto&[h,V]=*O.rbegin();
      |            ^
main.cpp:316:10: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  316 |     auto&[h,V]=*j++;
      |          ^

ソースコード

diff #

#define I insert
#define D erase
#define S second
#define V u,v,w,x
#define U upper_bound
ll@N,@K,@a[8N],H;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+1,v->S+1,w->S+1,x->S+1});A.D(u),C.D(v),C.D(w),E.D(x);}REP(n,1d7){if(n%4>2){auto&[h,V]=*O.begin();auto s=C.U({2N+u-1,2N}),e=C.end();if(s!=e)if(h<(H=h-a[2N+u-1]+a[2N+s->S]))O.D({h,V}),O.I({H,s->S+1,v,w,x}),C.D(s),C.I({a[2N+u-1],u});}else if(n%2){auto&[h,V]=*O.begin();auto t=C.U({2N+v-1,2N}),e=C.end();if(t!=e)if(h<(H=h-a[2N+v-1]+a[2N+t->S]))O.D({h,V}),O.I({H,u,t->S+1,w,x}),C.D(t),C.I({a[2N+v-1],v});}else if(n%4){auto&[h,V]=*O.rbegin();auto s=C.U({2N+u-1,2N}),e=C.end();if(s!=e)if(h>(H=h-a[2N+u-1]+a[2N+s->S]))O.D({h,V}),O.I({H,s->S+1,v,w,x}),C.D(s),C.I({a[2N+u-1],u});}else{auto&[h,V]=*O.rbegin();auto t=C.U({2N+v-1,2N}),e=C.end();if(t!=e)if(h>(H=h-a[2N+v-1]+a[2N+t->S]))O.D({h,V}),O.I({H,u,t->S+1,w,x}),C.D(t),C.I({a[2N+v-1],v});}}auto j=O.begin(),e=O.end();while(j!=e){auto&[h,V]=*j++;wt(u,v,w,x);}
0