結果

問題 No.2596 Christmas Eve (Heuristic ver.)
ユーザー 👑 p-adicp-adic
提出日時 2023-12-24 15:35:24
言語 cLay
(20240104-1)
結果
AC  
実行時間 152 ms / 1,224 ms
コード長 1,143 bytes
コンパイル時間 3,169 ms
コンパイル使用メモリ 197,848 KB
実行使用メモリ 6,676 KB
スコア 2,785,679
最終ジャッジ日時 2023-12-24 15:35:57
合計ジャッジ時間 30,557 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 152 ms
6,676 KB
testcase_01 AC 128 ms
6,676 KB
testcase_02 AC 118 ms
6,676 KB
testcase_03 AC 134 ms
6,676 KB
testcase_04 AC 125 ms
6,676 KB
testcase_05 AC 135 ms
6,676 KB
testcase_06 AC 133 ms
6,676 KB
testcase_07 AC 126 ms
6,676 KB
testcase_08 AC 122 ms
6,676 KB
testcase_09 AC 137 ms
6,676 KB
testcase_10 AC 125 ms
6,676 KB
testcase_11 AC 132 ms
6,676 KB
testcase_12 AC 127 ms
6,676 KB
testcase_13 AC 122 ms
6,676 KB
testcase_14 AC 133 ms
6,676 KB
testcase_15 AC 135 ms
6,676 KB
testcase_16 AC 121 ms
6,676 KB
testcase_17 AC 133 ms
6,676 KB
testcase_18 AC 139 ms
6,676 KB
testcase_19 AC 113 ms
6,676 KB
testcase_20 AC 134 ms
6,676 KB
testcase_21 AC 127 ms
6,676 KB
testcase_22 AC 116 ms
6,676 KB
testcase_23 AC 126 ms
6,676 KB
testcase_24 AC 119 ms
6,676 KB
testcase_25 AC 137 ms
6,676 KB
testcase_26 AC 122 ms
6,676 KB
testcase_27 AC 120 ms
6,676 KB
testcase_28 AC 143 ms
6,676 KB
testcase_29 AC 133 ms
6,676 KB
testcase_30 AC 112 ms
6,676 KB
testcase_31 AC 136 ms
6,676 KB
testcase_32 AC 136 ms
6,676 KB
testcase_33 AC 128 ms
6,676 KB
testcase_34 AC 143 ms
6,676 KB
testcase_35 AC 132 ms
6,676 KB
testcase_36 AC 119 ms
6,676 KB
testcase_37 AC 136 ms
6,676 KB
testcase_38 AC 133 ms
6,676 KB
testcase_39 AC 136 ms
6,676 KB
testcase_40 AC 117 ms
6,676 KB
testcase_41 AC 106 ms
6,676 KB
testcase_42 AC 128 ms
6,676 KB
testcase_43 AC 133 ms
6,676 KB
testcase_44 AC 132 ms
6,676 KB
testcase_45 AC 112 ms
6,676 KB
testcase_46 AC 115 ms
6,676 KB
testcase_47 AC 138 ms
6,676 KB
testcase_48 AC 138 ms
6,676 KB
testcase_49 AC 111 ms
6,676 KB
testcase_50 AC 122 ms
6,676 KB
testcase_51 AC 143 ms
6,676 KB
testcase_52 AC 132 ms
6,676 KB
testcase_53 AC 123 ms
6,676 KB
testcase_54 AC 134 ms
6,676 KB
testcase_55 AC 117 ms
6,676 KB
testcase_56 AC 107 ms
6,676 KB
testcase_57 AC 130 ms
6,676 KB
testcase_58 AC 136 ms
6,676 KB
testcase_59 AC 137 ms
6,676 KB
testcase_60 AC 136 ms
6,676 KB
testcase_61 AC 118 ms
6,676 KB
testcase_62 AC 120 ms
6,676 KB
testcase_63 AC 121 ms
6,676 KB
testcase_64 AC 134 ms
6,676 KB
testcase_65 AC 131 ms
6,676 KB
testcase_66 AC 123 ms
6,676 KB
testcase_67 AC 132 ms
6,676 KB
testcase_68 AC 127 ms
6,676 KB
testcase_69 AC 134 ms
6,676 KB
testcase_70 AC 138 ms
6,676 KB
testcase_71 AC 121 ms
6,676 KB
testcase_72 AC 110 ms
6,676 KB
testcase_73 AC 129 ms
6,676 KB
testcase_74 AC 128 ms
6,676 KB
testcase_75 AC 119 ms
6,676 KB
testcase_76 AC 125 ms
6,676 KB
testcase_77 AC 136 ms
6,676 KB
testcase_78 AC 121 ms
6,676 KB
testcase_79 AC 112 ms
6,676 KB
testcase_80 AC 122 ms
6,676 KB
testcase_81 AC 117 ms
6,676 KB
testcase_82 AC 121 ms
6,676 KB
testcase_83 AC 122 ms
6,676 KB
testcase_84 AC 144 ms
6,676 KB
testcase_85 AC 140 ms
6,676 KB
testcase_86 AC 143 ms
6,676 KB
testcase_87 AC 119 ms
6,676 KB
testcase_88 AC 132 ms
6,676 KB
testcase_89 AC 117 ms
6,676 KB
testcase_90 AC 138 ms
6,676 KB
testcase_91 AC 126 ms
6,676 KB
testcase_92 AC 107 ms
6,676 KB
testcase_93 AC 109 ms
6,676 KB
testcase_94 AC 112 ms
6,676 KB
testcase_95 AC 116 ms
6,676 KB
testcase_96 AC 141 ms
6,676 KB
testcase_97 AC 133 ms
6,676 KB
testcase_98 AC 138 ms
6,676 KB
testcase_99 AC 134 ms
6,676 KB
testcase_100 AC 140 ms
6,676 KB
testcase_101 AC 130 ms
6,676 KB
testcase_102 AC 140 ms
6,676 KB
testcase_103 AC 133 ms
6,676 KB
testcase_104 AC 117 ms
6,676 KB
testcase_105 AC 126 ms
6,676 KB
testcase_106 AC 130 ms
6,676 KB
testcase_107 AC 136 ms
6,676 KB
testcase_108 AC 103 ms
6,676 KB
testcase_109 AC 132 ms
6,676 KB
testcase_110 AC 117 ms
6,676 KB
testcase_111 AC 127 ms
6,676 KB
testcase_112 AC 128 ms
6,676 KB
testcase_113 AC 142 ms
6,676 KB
testcase_114 AC 124 ms
6,676 KB
testcase_115 AC 141 ms
6,676 KB
testcase_116 AC 124 ms
6,676 KB
testcase_117 AC 134 ms
6,676 KB
testcase_118 AC 100 ms
6,676 KB
testcase_119 AC 100 ms
6,676 KB
testcase_120 AC 134 ms
6,676 KB
testcase_121 AC 126 ms
6,676 KB
testcase_122 AC 108 ms
6,676 KB
testcase_123 AC 134 ms
6,676 KB
testcase_124 AC 130 ms
6,676 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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,v->S,w->S,x->S});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({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);}}auto j=O.begin(),e=O.end();while(j!=e){auto&[h,V]=*j++;wt(u+1,v+1,w+1,x+1);}
0