結果
問題 | No.5010 Better Mo's Algorithm is Needed!! (Unweighted) |
ユーザー | tails |
提出日時 | 2022-12-17 04:01:19 |
言語 | cLay (20240714-1) |
結果 |
AC
|
実行時間 | 3,211 ms / 5,000 ms |
コード長 | 843 bytes |
コンパイル時間 | 3,703 ms |
実行使用メモリ | 16,448 KB |
スコア | 18,585,840,294 |
最終ジャッジ日時 | 2022-12-17 04:08:32 |
合計ジャッジ時間 | 426,168 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3,174 ms
16,368 KB |
testcase_01 | AC | 3,211 ms
16,288 KB |
testcase_02 | AC | 3,152 ms
16,356 KB |
testcase_03 | AC | 3,110 ms
16,336 KB |
testcase_04 | AC | 3,097 ms
16,352 KB |
testcase_05 | AC | 3,170 ms
16,340 KB |
testcase_06 | AC | 3,110 ms
16,436 KB |
testcase_07 | AC | 3,154 ms
16,400 KB |
testcase_08 | AC | 3,169 ms
16,432 KB |
testcase_09 | AC | 3,132 ms
16,372 KB |
testcase_10 | AC | 3,108 ms
16,368 KB |
testcase_11 | AC | 3,179 ms
16,368 KB |
testcase_12 | AC | 3,157 ms
16,328 KB |
testcase_13 | AC | 3,148 ms
16,348 KB |
testcase_14 | AC | 3,153 ms
16,396 KB |
testcase_15 | AC | 3,142 ms
16,284 KB |
testcase_16 | AC | 3,113 ms
16,400 KB |
testcase_17 | AC | 3,106 ms
16,400 KB |
testcase_18 | AC | 3,142 ms
16,368 KB |
testcase_19 | AC | 3,125 ms
16,336 KB |
testcase_20 | AC | 3,112 ms
16,364 KB |
testcase_21 | AC | 3,144 ms
16,360 KB |
testcase_22 | AC | 3,141 ms
16,332 KB |
testcase_23 | AC | 3,130 ms
16,368 KB |
testcase_24 | AC | 3,115 ms
16,332 KB |
testcase_25 | AC | 3,176 ms
16,440 KB |
testcase_26 | AC | 3,117 ms
16,280 KB |
testcase_27 | AC | 3,122 ms
16,444 KB |
testcase_28 | AC | 3,130 ms
16,440 KB |
testcase_29 | AC | 3,198 ms
16,368 KB |
testcase_30 | AC | 3,120 ms
16,400 KB |
testcase_31 | AC | 3,140 ms
16,368 KB |
testcase_32 | AC | 3,186 ms
16,288 KB |
testcase_33 | AC | 3,125 ms
16,284 KB |
testcase_34 | AC | 3,116 ms
16,408 KB |
testcase_35 | AC | 3,142 ms
16,432 KB |
testcase_36 | AC | 3,094 ms
16,288 KB |
testcase_37 | AC | 3,153 ms
16,280 KB |
testcase_38 | AC | 3,118 ms
16,364 KB |
testcase_39 | AC | 3,145 ms
16,332 KB |
testcase_40 | AC | 3,089 ms
16,288 KB |
testcase_41 | AC | 3,120 ms
16,332 KB |
testcase_42 | AC | 3,122 ms
16,420 KB |
testcase_43 | AC | 3,124 ms
16,396 KB |
testcase_44 | AC | 3,169 ms
16,288 KB |
testcase_45 | AC | 3,185 ms
16,440 KB |
testcase_46 | AC | 3,169 ms
16,348 KB |
testcase_47 | AC | 3,159 ms
16,400 KB |
testcase_48 | AC | 3,133 ms
16,288 KB |
testcase_49 | AC | 3,177 ms
16,280 KB |
testcase_50 | AC | 3,201 ms
16,288 KB |
testcase_51 | AC | 3,087 ms
16,416 KB |
testcase_52 | AC | 3,120 ms
16,356 KB |
testcase_53 | AC | 3,172 ms
16,284 KB |
testcase_54 | AC | 3,120 ms
16,288 KB |
testcase_55 | AC | 3,161 ms
16,348 KB |
testcase_56 | AC | 3,142 ms
16,448 KB |
testcase_57 | AC | 3,144 ms
16,408 KB |
testcase_58 | AC | 2,966 ms
16,408 KB |
testcase_59 | AC | 3,161 ms
16,356 KB |
testcase_60 | AC | 3,076 ms
16,280 KB |
testcase_61 | AC | 2,970 ms
16,336 KB |
testcase_62 | AC | 3,121 ms
16,444 KB |
testcase_63 | AC | 2,987 ms
16,372 KB |
testcase_64 | AC | 3,125 ms
16,288 KB |
testcase_65 | AC | 2,910 ms
16,284 KB |
testcase_66 | AC | 3,168 ms
16,436 KB |
testcase_67 | AC | 3,181 ms
16,336 KB |
testcase_68 | AC | 3,169 ms
16,336 KB |
testcase_69 | AC | 3,143 ms
16,412 KB |
testcase_70 | AC | 2,966 ms
16,436 KB |
testcase_71 | AC | 3,131 ms
16,340 KB |
testcase_72 | AC | 3,139 ms
16,444 KB |
testcase_73 | AC | 3,074 ms
16,368 KB |
testcase_74 | AC | 3,125 ms
16,312 KB |
testcase_75 | AC | 3,083 ms
16,336 KB |
testcase_76 | AC | 3,185 ms
16,348 KB |
testcase_77 | AC | 3,191 ms
16,348 KB |
testcase_78 | AC | 3,174 ms
16,336 KB |
testcase_79 | AC | 2,951 ms
16,436 KB |
testcase_80 | AC | 3,207 ms
16,332 KB |
testcase_81 | AC | 3,153 ms
16,364 KB |
testcase_82 | AC | 3,115 ms
16,288 KB |
testcase_83 | AC | 3,096 ms
16,348 KB |
testcase_84 | AC | 3,114 ms
16,412 KB |
testcase_85 | AC | 3,069 ms
16,444 KB |
testcase_86 | AC | 3,094 ms
16,368 KB |
testcase_87 | AC | 3,112 ms
16,340 KB |
testcase_88 | AC | 3,203 ms
16,428 KB |
testcase_89 | AC | 3,118 ms
16,432 KB |
testcase_90 | AC | 3,091 ms
16,400 KB |
testcase_91 | AC | 3,084 ms
16,368 KB |
testcase_92 | AC | 3,117 ms
16,428 KB |
testcase_93 | AC | 3,091 ms
16,440 KB |
testcase_94 | AC | 3,143 ms
16,408 KB |
testcase_95 | AC | 3,142 ms
16,356 KB |
testcase_96 | AC | 3,112 ms
16,440 KB |
testcase_97 | AC | 3,179 ms
16,448 KB |
testcase_98 | AC | 3,151 ms
16,428 KB |
testcase_99 | AC | 2,946 ms
16,332 KB |
testcase_100 | AC | 3,080 ms
16,432 KB |
testcase_101 | AC | 3,085 ms
16,432 KB |
testcase_102 | AC | 3,069 ms
16,284 KB |
testcase_103 | AC | 3,030 ms
16,288 KB |
testcase_104 | AC | 3,081 ms
16,284 KB |
testcase_105 | AC | 3,126 ms
16,336 KB |
testcase_106 | AC | 3,105 ms
16,440 KB |
testcase_107 | AC | 3,127 ms
16,288 KB |
testcase_108 | AC | 3,087 ms
16,336 KB |
testcase_109 | AC | 3,050 ms
16,440 KB |
testcase_110 | AC | 3,091 ms
16,332 KB |
testcase_111 | AC | 3,107 ms
16,328 KB |
testcase_112 | AC | 3,091 ms
16,332 KB |
testcase_113 | AC | 3,070 ms
16,444 KB |
testcase_114 | AC | 2,998 ms
16,348 KB |
testcase_115 | AC | 3,122 ms
16,284 KB |
testcase_116 | AC | 3,072 ms
16,332 KB |
testcase_117 | AC | 2,951 ms
16,352 KB |
testcase_118 | AC | 3,115 ms
16,332 KB |
testcase_119 | AC | 3,037 ms
16,444 KB |
ソースコード
ull xs[2d5]; ll ys[2d5]; ll ls[2d5],rs[2d5]; ll d(ll i,ll j){ return abs(ls[ys[j]]-ls[ys[i]])+abs(rs[ys[j]]-rs[ys[i]]); } void opt1(ll b){ rep(i,2d5-1-b){ if(d(i,i+1)+d(i+b,i+b+1)>d(i,i+b)+d(i+1,i+b+1)){ reverse(ys+(i+1),ys+(i+1+b)); } } rrep(i,2d5-1-b){ if(d(i,i+1)+d(i+b,i+b+1)>d(i,i+b)+d(i+1,i+b+1)){ reverse(ys+(i+1),ys+(i+1+b)); } } } { ll@n,@q,@wt,@st,@w[n]; rep(i,q){ ll@--l,@--r; ls[i]=l; rs[i]=r; ull x=0; rep(32){ x<<=2; if(r<1d5){ x|=0; (l,r)=(l,r); }else if(l>=1d5){ x|=3; (l,r)=(l-1d5,r-1d5); }else if(l+r<2d5){ x|=1; (l,r)=(r-1d5,1d5-1-l); }else{ x|=2; (l,r)=(2d5-1-r,l); } l*=2; r*=2; } xs[i]=x; ys[i]=i; } sortA(q,xs,ys); rep(i,1,512){ opt1(i%192+2); } opt1(2); opt1(2); opt1(2); rep(i,q){ ys[i]+=1; } wt(ys(q)); }