結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 819 ms
6,676 KB
testcase_01 AC 437 ms
6,676 KB
testcase_02 AC 742 ms
6,676 KB
testcase_03 AC 1,003 ms
6,676 KB
testcase_04 AC 983 ms
6,676 KB
testcase_05 AC 722 ms
6,676 KB
testcase_06 AC 1,023 ms
6,676 KB
testcase_07 AC 803 ms
6,676 KB
testcase_08 AC 561 ms
6,676 KB
testcase_09 AC 837 ms
6,676 KB
testcase_10 AC 660 ms
6,676 KB
testcase_11 AC 824 ms
6,676 KB
testcase_12 AC 496 ms
6,676 KB
testcase_13 AC 436 ms
6,676 KB
testcase_14 AC 961 ms
6,676 KB
testcase_15 AC 1,068 ms
6,676 KB
testcase_16 AC 457 ms
6,676 KB
testcase_17 AC 590 ms
6,676 KB
testcase_18 AC 767 ms
6,676 KB
testcase_19 AC 895 ms
6,676 KB
testcase_20 AC 1,087 ms
6,676 KB
testcase_21 AC 617 ms
6,676 KB
testcase_22 AC 886 ms
6,676 KB
testcase_23 AC 506 ms
6,676 KB
testcase_24 AC 990 ms
6,676 KB
testcase_25 AC 414 ms
6,676 KB
testcase_26 AC 784 ms
6,676 KB
testcase_27 AC 876 ms
6,676 KB
testcase_28 AC 463 ms
6,676 KB
testcase_29 AC 1,047 ms
6,676 KB
testcase_30 AC 724 ms
6,676 KB
testcase_31 AC 1,016 ms
6,676 KB
testcase_32 AC 550 ms
6,676 KB
testcase_33 AC 922 ms
6,676 KB
testcase_34 AC 876 ms
6,676 KB
testcase_35 AC 975 ms
6,676 KB
testcase_36 AC 1,085 ms
6,676 KB
testcase_37 AC 597 ms
6,676 KB
testcase_38 AC 1,011 ms
6,676 KB
testcase_39 AC 424 ms
6,676 KB
testcase_40 AC 595 ms
6,676 KB
testcase_41 AC 688 ms
6,676 KB
testcase_42 AC 388 ms
6,676 KB
testcase_43 AC 1,108 ms
6,676 KB
testcase_44 AC 471 ms
6,676 KB
testcase_45 AC 1,071 ms
6,676 KB
testcase_46 AC 520 ms
6,676 KB
testcase_47 AC 1,033 ms
6,676 KB
testcase_48 AC 461 ms
6,676 KB
testcase_49 AC 442 ms
6,676 KB
testcase_50 AC 1,067 ms
6,676 KB
testcase_51 AC 715 ms
6,676 KB
testcase_52 AC 610 ms
6,676 KB
testcase_53 AC 588 ms
6,676 KB
testcase_54 AC 424 ms
6,676 KB
testcase_55 AC 666 ms
6,676 KB
testcase_56 AC 386 ms
6,676 KB
testcase_57 AC 448 ms
6,676 KB
testcase_58 AC 682 ms
6,676 KB
testcase_59 AC 962 ms
6,676 KB
testcase_60 AC 472 ms
6,676 KB
testcase_61 AC 506 ms
6,676 KB
testcase_62 AC 932 ms
6,676 KB
testcase_63 AC 518 ms
6,676 KB
testcase_64 AC 565 ms
6,676 KB
testcase_65 AC 830 ms
6,676 KB
testcase_66 AC 494 ms
6,676 KB
testcase_67 AC 881 ms
6,676 KB
testcase_68 AC 670 ms
6,676 KB
testcase_69 AC 649 ms
6,676 KB
testcase_70 AC 973 ms
6,676 KB
testcase_71 AC 992 ms
6,676 KB
testcase_72 AC 501 ms
6,676 KB
testcase_73 AC 515 ms
6,676 KB
testcase_74 AC 979 ms
6,676 KB
testcase_75 AC 1,024 ms
6,676 KB
testcase_76 AC 428 ms
6,676 KB
testcase_77 AC 600 ms
6,676 KB
testcase_78 AC 970 ms
6,676 KB
testcase_79 AC 398 ms
6,676 KB
testcase_80 AC 511 ms
6,676 KB
testcase_81 AC 1,022 ms
6,676 KB
testcase_82 AC 396 ms
6,676 KB
testcase_83 AC 498 ms
6,676 KB
testcase_84 AC 756 ms
6,676 KB
testcase_85 AC 1,017 ms
6,676 KB
testcase_86 AC 915 ms
6,676 KB
testcase_87 AC 698 ms
6,676 KB
testcase_88 AC 536 ms
6,676 KB
testcase_89 AC 742 ms
6,676 KB
testcase_90 AC 1,044 ms
6,676 KB
testcase_91 AC 613 ms
6,676 KB
testcase_92 AC 402 ms
6,676 KB
testcase_93 AC 451 ms
6,676 KB
testcase_94 AC 553 ms
6,676 KB
testcase_95 AC 849 ms
6,676 KB
testcase_96 AC 380 ms
6,676 KB
testcase_97 AC 692 ms
6,676 KB
testcase_98 AC 712 ms
6,676 KB
testcase_99 AC 514 ms
6,676 KB
testcase_100 AC 386 ms
6,676 KB
testcase_101 AC 566 ms
6,676 KB
testcase_102 AC 740 ms
6,676 KB
testcase_103 AC 976 ms
6,676 KB
testcase_104 AC 476 ms
6,676 KB
testcase_105 AC 735 ms
6,676 KB
testcase_106 AC 408 ms
6,676 KB
testcase_107 AC 647 ms
6,676 KB
testcase_108 AC 471 ms
6,676 KB
testcase_109 AC 913 ms
6,676 KB
testcase_110 AC 931 ms
6,676 KB
testcase_111 AC 1,072 ms
6,676 KB
testcase_112 AC 515 ms
6,676 KB
testcase_113 AC 1,008 ms
6,676 KB
testcase_114 AC 665 ms
6,676 KB
testcase_115 AC 634 ms
6,676 KB
testcase_116 AC 412 ms
6,676 KB
testcase_117 AC 432 ms
6,676 KB
testcase_118 AC 545 ms
6,676 KB
testcase_119 AC 468 ms
6,676 KB
testcase_120 AC 599 ms
6,676 KB
testcase_121 AC 490 ms
6,676 KB
testcase_122 AC 464 ms
6,676 KB
testcase_123 AC 1,054 ms
6,676 KB
testcase_124 AC 640 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,9d5){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