結果

問題 No.2596 Christmas Eve (Heuristic ver.)
ユーザー 👑 p-adicp-adic
提出日時 2023-12-24 16:01:25
言語 cLay
(20240714-1)
結果
TLE  
実行時間 -
コード長 1,881 bytes
コンパイル時間 3,333 ms
コンパイル使用メモリ 201,548 KB
実行使用メモリ 6,676 KB
スコア 2,759,250
最終ジャッジ日時 2023-12-24 16:03:58
合計ジャッジ時間 149,281 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 994 ms
6,676 KB
testcase_02 AC 1,028 ms
6,676 KB
testcase_03 AC 1,180 ms
6,676 KB
testcase_04 AC 1,084 ms
6,676 KB
testcase_05 AC 1,157 ms
6,676 KB
testcase_06 AC 1,139 ms
6,676 KB
testcase_07 AC 1,094 ms
6,676 KB
testcase_08 AC 1,046 ms
6,676 KB
testcase_09 AC 1,108 ms
6,676 KB
testcase_10 AC 1,088 ms
6,676 KB
testcase_11 AC 1,011 ms
6,676 KB
testcase_12 AC 1,034 ms
6,676 KB
testcase_13 AC 1,059 ms
6,676 KB
testcase_14 AC 1,096 ms
6,676 KB
testcase_15 AC 1,154 ms
6,676 KB
testcase_16 AC 989 ms
6,676 KB
testcase_17 AC 1,105 ms
6,676 KB
testcase_18 AC 1,090 ms
6,676 KB
testcase_19 AC 1,039 ms
6,676 KB
testcase_20 AC 1,128 ms
6,676 KB
testcase_21 AC 1,092 ms
6,676 KB
testcase_22 AC 1,052 ms
6,676 KB
testcase_23 AC 1,091 ms
6,676 KB
testcase_24 AC 1,024 ms
6,676 KB
testcase_25 AC 1,105 ms
6,676 KB
testcase_26 AC 1,001 ms
6,676 KB
testcase_27 AC 1,056 ms
6,676 KB
testcase_28 TLE -
testcase_29 AC 1,102 ms
6,676 KB
testcase_30 AC 960 ms
6,676 KB
testcase_31 AC 1,175 ms
6,676 KB
testcase_32 AC 1,107 ms
6,676 KB
testcase_33 AC 1,056 ms
6,676 KB
testcase_34 AC 1,127 ms
6,676 KB
testcase_35 AC 1,109 ms
6,676 KB
testcase_36 AC 1,031 ms
6,676 KB
testcase_37 AC 1,094 ms
6,676 KB
testcase_38 AC 1,046 ms
6,676 KB
testcase_39 AC 1,109 ms
6,676 KB
testcase_40 AC 1,010 ms
6,676 KB
testcase_41 AC 958 ms
6,676 KB
testcase_42 AC 1,050 ms
6,676 KB
testcase_43 AC 1,161 ms
6,676 KB
testcase_44 AC 1,134 ms
6,676 KB
testcase_45 AC 990 ms
6,676 KB
testcase_46 AC 940 ms
6,676 KB
testcase_47 AC 1,142 ms
6,676 KB
testcase_48 AC 1,153 ms
6,676 KB
testcase_49 AC 888 ms
6,676 KB
testcase_50 AC 1,010 ms
6,676 KB
testcase_51 AC 1,185 ms
6,676 KB
testcase_52 AC 1,097 ms
6,676 KB
testcase_53 AC 1,087 ms
6,676 KB
testcase_54 AC 1,121 ms
6,676 KB
testcase_55 AC 1,035 ms
6,676 KB
testcase_56 AC 905 ms
6,676 KB
testcase_57 AC 1,070 ms
6,676 KB
testcase_58 AC 1,103 ms
6,676 KB
testcase_59 AC 1,189 ms
6,676 KB
testcase_60 AC 1,100 ms
6,676 KB
testcase_61 AC 1,009 ms
6,676 KB
testcase_62 AC 1,011 ms
6,676 KB
testcase_63 AC 1,098 ms
6,676 KB
testcase_64 AC 1,130 ms
6,676 KB
testcase_65 AC 1,054 ms
6,676 KB
testcase_66 AC 1,031 ms
6,676 KB
testcase_67 AC 1,116 ms
6,676 KB
testcase_68 AC 1,105 ms
6,676 KB
testcase_69 AC 1,051 ms
6,676 KB
testcase_70 AC 1,081 ms
6,676 KB
testcase_71 AC 1,019 ms
6,676 KB
testcase_72 AC 950 ms
6,676 KB
testcase_73 AC 999 ms
6,676 KB
testcase_74 AC 1,080 ms
6,676 KB
testcase_75 AC 1,087 ms
6,676 KB
testcase_76 AC 1,067 ms
6,676 KB
testcase_77 AC 1,070 ms
6,676 KB
testcase_78 AC 1,041 ms
6,676 KB
testcase_79 AC 1,003 ms
6,676 KB
testcase_80 AC 1,034 ms
6,676 KB
testcase_81 AC 1,004 ms
6,676 KB
testcase_82 AC 981 ms
6,676 KB
testcase_83 AC 1,068 ms
6,676 KB
testcase_84 AC 1,167 ms
6,676 KB
testcase_85 AC 1,167 ms
6,676 KB
testcase_86 AC 1,158 ms
6,676 KB
testcase_87 AC 1,006 ms
6,676 KB
testcase_88 AC 1,080 ms
6,676 KB
testcase_89 AC 1,036 ms
6,676 KB
testcase_90 AC 1,098 ms
6,676 KB
testcase_91 AC 1,046 ms
6,676 KB
testcase_92 AC 928 ms
6,676 KB
testcase_93 AC 914 ms
6,676 KB
testcase_94 AC 995 ms
6,676 KB
testcase_95 AC 1,044 ms
6,676 KB
testcase_96 AC 1,110 ms
6,676 KB
testcase_97 AC 1,164 ms
6,676 KB
testcase_98 AC 1,113 ms
6,676 KB
testcase_99 AC 1,047 ms
6,676 KB
testcase_100 AC 1,157 ms
6,676 KB
testcase_101 AC 1,049 ms
6,676 KB
testcase_102 AC 1,185 ms
6,676 KB
testcase_103 AC 1,104 ms
6,676 KB
testcase_104 AC 989 ms
6,676 KB
testcase_105 AC 1,061 ms
6,676 KB
testcase_106 AC 1,049 ms
6,676 KB
testcase_107 AC 1,121 ms
6,676 KB
testcase_108 AC 963 ms
6,676 KB
testcase_109 AC 1,044 ms
6,676 KB
testcase_110 AC 970 ms
6,676 KB
testcase_111 AC 1,074 ms
6,676 KB
testcase_112 AC 1,050 ms
6,676 KB
testcase_113 AC 1,121 ms
6,676 KB
testcase_114 AC 1,013 ms
6,676 KB
testcase_115 AC 1,154 ms
6,676 KB
testcase_116 AC 1,060 ms
6,676 KB
testcase_117 AC 1,128 ms
6,676 KB
testcase_118 AC 944 ms
6,676 KB
testcase_119 AC 891 ms
6,676 KB
testcase_120 AC 1,111 ms
6,676 KB
testcase_121 AC 1,035 ms
6,676 KB
testcase_122 AC 999 ms
6,676 KB
testcase_123 AC 1,110 ms
6,676 KB
testcase_124 AC 1,075 ms
6,676 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:283:14: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  283 |         auto&[h,V]=*O.begin();
      |              ^
main.cpp:296:14: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  296 |         auto&[h,V]=*O.begin();
      |              ^
main.cpp:309:14: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  309 |         auto&[h,V]=*O.rbegin();
      |              ^
main.cpp:322:14: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  322 |         auto&[h,V]=*O.rbegin();
      |              ^
main.cpp:338:14: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  338 |         auto&[h,V]=*O.begin();
      |              ^
main.cpp:351:14: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  351 |         auto&[h,V]=*O.rbegin();
      |              ^
main.cpp:368:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  368 |       auto&[h,V]=*O.begin();
      |            ^
main.cpp:381:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  381 |       auto&[h,V]=*O.rbegin();
      |            ^
main.cpp:397:10: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  397 |     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,v->S,w->S,x->S});A.D(u),C.D(v),C.D(w),E.D(x);}rep(1d2){REP(n,6d5){if(n%4>2){auto&[h,V]=*O.begin();auto s=C.U({a[2N+v],2N}),e=C.end();if(s!=e)if(h<(H=h-a[4N+v]+a[4N+s->S]))O.I({H,u,s->S,w,x}),C.I({a[2N+v],v}),O.D({h,V}),C.D(s);}else if(n%2){auto&[h,V]=*O.begin();auto t=C.U({a[2N+w],2N}),e=C.end();if(t!=e)if(h<(H=h-a[4N+w]+a[4N+t->S]))O.I({H,u,v,t->S,x}),C.I({a[2N+w],w}),O.D({h,V}),C.D(t);}else if(n%4){auto&[h,V]=*O.rbegin();auto s=C.U({a[2N+v],2N}),e=C.end();if(s!=e)if(h>(H=h-a[4N+v]+a[4N+s->S]))O.I({H,u,s->S,w,x}),C.I({a[2N+v],v}),O.D({h,V}),C.D(s);}else{auto&[h,V]=*O.rbegin();auto t=C.U({a[2N+w],2N}),e=C.end();if(t!=e)if(h>(H=h-a[4N+w]+a[4N+t->S]))O.I({H,u,v,t->S,x}),C.I({a[2N+w],w}),O.D({h,V}),C.D(t);}}REP(n,3d5){if(n%2){auto&[h,V]=*O.begin();auto s=A.U({a[u],N}),e=A.end();if(s!=e)if(h<(H=h-a[N+u]+a[N+s->S])&&a[s->S]<min(a[2N+v],a[2N,w]))O.I({H,s->S,v,w,x}),A.I({a[u],u}),O.D({h,V}),A.D(s);}else{auto&[h,V]=*O.rbegin();auto t=A.U({a[u],2N}),e=A.end();if(t!=e)if(h>(H=h-a[N+u]+a[N+t->S])&&a[t->S]<min(a[2N+v],a[2N,w]))O.I({H,t->S,v,w,x}),A.I({a[u],u}),O.D({h,V}),A.D(t);}}}REP(n,1d5){if(n%2){auto&[h,V]=*O.begin();auto s=E.U({a[6N+x],N}),e=E.end();if(s!=e)if(h<(H=h-a[7N+x]+a[7N+s->S])&&a[6N+s->S]<a[u])O.I({H,u,v,w,s->S}),E.I({a[6N+x],x}),O.D({h,V}),E.D(s);}else{auto&[h,V]=*O.rbegin();auto t=E.U({a[6N+x],N}),e=E.end();if(t!=e)if(h>(H=h-a[7N+x]+a[7N+t->S])&&a[6N+t->S]<a[u])O.I({H,u,v,w,t->S}),E.I({a[x],x}),O.D({h,V}),E.D(t);}}auto j=O.begin(),e=O.end();while(j!=e){auto&[h,V]=*j++;wt(u+1,v+1,w+1,x+1);}
0