結果

問題 No.2596 Christmas Eve (Heuristic ver.)
ユーザー 👑 p-adicp-adic
提出日時 2023-12-26 01:42:06
言語 cLay
(20240104-1)
結果
AC  
実行時間 362 ms / 1,224 ms
コード長 1,011 bytes
コンパイル時間 3,714 ms
コンパイル使用メモリ 202,824 KB
実行使用メモリ 6,676 KB
スコア 4,952,703
最終ジャッジ日時 2023-12-26 01:42:53
合計ジャッジ時間 45,883 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 280 ms
6,676 KB
testcase_01 AC 153 ms
6,676 KB
testcase_02 AC 232 ms
6,676 KB
testcase_03 AC 308 ms
6,676 KB
testcase_04 AC 339 ms
6,676 KB
testcase_05 AC 241 ms
6,676 KB
testcase_06 AC 334 ms
6,676 KB
testcase_07 AC 255 ms
6,676 KB
testcase_08 AC 197 ms
6,676 KB
testcase_09 AC 284 ms
6,676 KB
testcase_10 AC 223 ms
6,676 KB
testcase_11 AC 282 ms
6,676 KB
testcase_12 AC 164 ms
6,676 KB
testcase_13 AC 148 ms
6,676 KB
testcase_14 AC 319 ms
6,676 KB
testcase_15 AC 349 ms
6,676 KB
testcase_16 AC 157 ms
6,676 KB
testcase_17 AC 196 ms
6,676 KB
testcase_18 AC 252 ms
6,676 KB
testcase_19 AC 304 ms
6,676 KB
testcase_20 AC 357 ms
6,676 KB
testcase_21 AC 213 ms
6,676 KB
testcase_22 AC 294 ms
6,676 KB
testcase_23 AC 174 ms
6,676 KB
testcase_24 AC 340 ms
6,676 KB
testcase_25 AC 139 ms
6,676 KB
testcase_26 AC 260 ms
6,676 KB
testcase_27 AC 283 ms
6,676 KB
testcase_28 AC 164 ms
6,676 KB
testcase_29 AC 349 ms
6,676 KB
testcase_30 AC 242 ms
6,676 KB
testcase_31 AC 336 ms
6,676 KB
testcase_32 AC 190 ms
6,676 KB
testcase_33 AC 312 ms
6,676 KB
testcase_34 AC 289 ms
6,676 KB
testcase_35 AC 359 ms
6,676 KB
testcase_36 AC 358 ms
6,676 KB
testcase_37 AC 203 ms
6,676 KB
testcase_38 AC 325 ms
6,676 KB
testcase_39 AC 147 ms
6,676 KB
testcase_40 AC 198 ms
6,676 KB
testcase_41 AC 230 ms
6,676 KB
testcase_42 AC 135 ms
6,676 KB
testcase_43 AC 354 ms
6,676 KB
testcase_44 AC 160 ms
6,676 KB
testcase_45 AC 353 ms
6,676 KB
testcase_46 AC 179 ms
6,676 KB
testcase_47 AC 350 ms
6,676 KB
testcase_48 AC 151 ms
6,676 KB
testcase_49 AC 152 ms
6,676 KB
testcase_50 AC 351 ms
6,676 KB
testcase_51 AC 242 ms
6,676 KB
testcase_52 AC 211 ms
6,676 KB
testcase_53 AC 188 ms
6,676 KB
testcase_54 AC 142 ms
6,676 KB
testcase_55 AC 233 ms
6,676 KB
testcase_56 AC 128 ms
6,676 KB
testcase_57 AC 156 ms
6,676 KB
testcase_58 AC 234 ms
6,676 KB
testcase_59 AC 310 ms
6,676 KB
testcase_60 AC 160 ms
6,676 KB
testcase_61 AC 165 ms
6,676 KB
testcase_62 AC 316 ms
6,676 KB
testcase_63 AC 177 ms
6,676 KB
testcase_64 AC 192 ms
6,676 KB
testcase_65 AC 271 ms
6,676 KB
testcase_66 AC 169 ms
6,676 KB
testcase_67 AC 294 ms
6,676 KB
testcase_68 AC 234 ms
6,676 KB
testcase_69 AC 227 ms
6,676 KB
testcase_70 AC 314 ms
6,676 KB
testcase_71 AC 345 ms
6,676 KB
testcase_72 AC 162 ms
6,676 KB
testcase_73 AC 170 ms
6,676 KB
testcase_74 AC 338 ms
6,676 KB
testcase_75 AC 334 ms
6,676 KB
testcase_76 AC 148 ms
6,676 KB
testcase_77 AC 190 ms
6,676 KB
testcase_78 AC 324 ms
6,676 KB
testcase_79 AC 135 ms
6,676 KB
testcase_80 AC 175 ms
6,676 KB
testcase_81 AC 362 ms
6,676 KB
testcase_82 AC 137 ms
6,676 KB
testcase_83 AC 169 ms
6,676 KB
testcase_84 AC 251 ms
6,676 KB
testcase_85 AC 362 ms
6,676 KB
testcase_86 AC 311 ms
6,676 KB
testcase_87 AC 224 ms
6,676 KB
testcase_88 AC 184 ms
6,676 KB
testcase_89 AC 279 ms
6,676 KB
testcase_90 AC 340 ms
6,676 KB
testcase_91 AC 210 ms
6,676 KB
testcase_92 AC 131 ms
6,676 KB
testcase_93 AC 187 ms
6,676 KB
testcase_94 AC 189 ms
6,676 KB
testcase_95 AC 269 ms
6,676 KB
testcase_96 AC 132 ms
6,676 KB
testcase_97 AC 235 ms
6,676 KB
testcase_98 AC 231 ms
6,676 KB
testcase_99 AC 177 ms
6,676 KB
testcase_100 AC 134 ms
6,676 KB
testcase_101 AC 189 ms
6,676 KB
testcase_102 AC 271 ms
6,676 KB
testcase_103 AC 331 ms
6,676 KB
testcase_104 AC 166 ms
6,676 KB
testcase_105 AC 254 ms
6,676 KB
testcase_106 AC 143 ms
6,676 KB
testcase_107 AC 225 ms
6,676 KB
testcase_108 AC 163 ms
6,676 KB
testcase_109 AC 304 ms
6,676 KB
testcase_110 AC 345 ms
6,676 KB
testcase_111 AC 355 ms
6,676 KB
testcase_112 AC 171 ms
6,676 KB
testcase_113 AC 341 ms
6,676 KB
testcase_114 AC 228 ms
6,676 KB
testcase_115 AC 211 ms
6,676 KB
testcase_116 AC 140 ms
6,676 KB
testcase_117 AC 142 ms
6,676 KB
testcase_118 AC 217 ms
6,676 KB
testcase_119 AC 164 ms
6,676 KB
testcase_120 AC 198 ms
6,676 KB
testcase_121 AC 166 ms
6,676 KB
testcase_122 AC 156 ms
6,676 KB
testcase_123 AC 360 ms
6,676 KB
testcase_124 AC 216 ms
6,676 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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++;
      |          ^

ソースコード

diff #

#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],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},t={0,2N,2N,6N};decltype(A)*P[4]={&A,&C,&C,&E};Rand R;rep(n,3d5){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<(d[0]=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]]):false){O.I({d[0],d[1],d[2],d[3],d[4]}),P[p]->I({a[t[p]+c[p+1]],c[p+1]}),O.D({c[0],c[1],c[2],c[3],c[4]}),P[p]->D({a[t[p]+d[p+1]],d[p+1]});}}auto j=O.begin(),e=O.end();while(j!=e){auto&[V]=*j++;wt(u+1,v+1,w+1,x+1);}
0