QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#464340 | #4205. Art Collections | Dan4Life# | 35 | 1361ms | 4264kb | C++23 | 1.0kb | 2024-07-06 01:32:11 | 2024-07-06 01:32:11 |
Judging History
answer
#include "art.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
using ar2 = array<int,2>;
using ar3 = array<int,3>;
using ll = long long;
const int mxN = 4010;
int n;
vector<int> v;
bool better[mxN];
void recur(int l, int r){
if(l==r) return;
int xd = (r-l+1);
for(int i = l; i <= r; i++)
better[v[i]]=0;
int st = publish(v);
while(xd--){
int b = v[r];
v.erase(begin(v)+r);
v.insert(begin(v)+l,b);
int now = publish(v);
if(now <= st) better[b]=1;
st = now;
}
vector<int> nw; nw.clear();
for(int i = 0; i < l; i++) nw.pb(v[i]);
for(int i = l; i <= r; i++) if(better[v[i]]) nw.pb(v[i]);
for(int i = l; i <= r; i++) if(!better[v[i]]) nw.pb(v[i]);
for(int i = r+1; i < n; i++) nw.pb(v[i]);
v.clear(); for(auto u : nw) v.pb(u);
int mid = (l+r)/2; recur(l,mid); recur(mid+1,r);
}
void solve(int N) {
n = N; srand(time(NULL));
v.resize(N,0);
iota(all(v),1);
random_shuffle(all(v));
recur(0,N-1); answer(v);
}
詳細信息
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 0ms
memory: 3920kb
input:
6 8 11 8 7 2 7 8 2 2 4 2 1 2 1 1 1 3 1 0 1 0
output:
942318468 6 3 1 6 4 5 2 942318468 6 2 3 1 6 4 5 942318468 6 5 2 3 1 6 4 942318468 6 4 5 2 3 1 6 942318468 6 6 4 5 2 3 1 942318468 6 1 6 4 5 2 3 942318468 6 3 1 6 4 5 2 942318468 6 6 4 5 3 1 2 942318468 6 5 6 4 3 1 2 942318468 6 4 5 6 3 1 2 942318468 6 6 4 5 3 1 2 942318468 6 6 5 4 3 1 2 942318468 6 ...
result:
ok correct
Test #2:
score: 0
Accepted
time: 1ms
memory: 3896kb
input:
6 8 9 8 3 6 11 8 4 6 4 4 4 3 4 3 1 1 3 1 0 1
output:
942318468 6 3 1 6 4 5 2 942318468 6 2 3 1 6 4 5 942318468 6 5 2 3 1 6 4 942318468 6 4 5 2 3 1 6 942318468 6 6 4 5 2 3 1 942318468 6 1 6 4 5 2 3 942318468 6 3 1 6 4 5 2 942318468 6 3 4 5 1 6 2 942318468 6 5 3 4 1 6 2 942318468 6 4 5 3 1 6 2 942318468 6 3 4 5 1 6 2 942318468 6 3 4 5 1 6 2 942318468 6 ...
result:
ok correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 4176kb
input:
6 8 9 8 3 6 11 8 4 6 4 4 4 3 4 3 1 1 3 1 0 1
output:
942318468 6 3 1 6 4 5 2 942318468 6 2 3 1 6 4 5 942318468 6 5 2 3 1 6 4 942318468 6 4 5 2 3 1 6 942318468 6 6 4 5 2 3 1 942318468 6 1 6 4 5 2 3 942318468 6 3 1 6 4 5 2 942318468 6 3 4 5 1 6 2 942318468 6 5 3 4 1 6 2 942318468 6 4 5 3 1 6 2 942318468 6 3 4 5 1 6 2 942318468 6 3 4 5 1 6 2 942318468 6 ...
result:
ok correct
Test #4:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
6 8 9 8 3 6 11 8 4 6 4 4 4 3 4 3 1 1 3 1 0 1
output:
942318468 6 3 1 6 4 5 2 942318468 6 2 3 1 6 4 5 942318468 6 5 2 3 1 6 4 942318468 6 4 5 2 3 1 6 942318468 6 6 4 5 2 3 1 942318468 6 1 6 4 5 2 3 942318468 6 3 1 6 4 5 2 942318468 6 3 4 5 1 6 2 942318468 6 5 3 4 1 6 2 942318468 6 4 5 3 1 6 2 942318468 6 3 4 5 1 6 2 942318468 6 3 4 5 1 6 2 942318468 6 ...
result:
ok correct
Test #5:
score: 0
Accepted
time: 0ms
memory: 4176kb
input:
3 1 3 1 1 1 0 1
output:
942318468 3 3 1 2 942318468 3 2 3 1 942318468 3 1 2 3 942318468 3 3 1 2 942318468 3 3 1 2 942318468 3 1 3 2 942318468 3 3 1 2 539883183 3 1 3 2
result:
ok correct
Test #6:
score: 0
Accepted
time: 1ms
memory: 3892kb
input:
6 7 4 7 8 13 8 7 4 4 2 4 2 3 2 2 2 0 2 0 1 0
output:
942318468 6 3 1 6 4 5 2 942318468 6 2 3 1 6 4 5 942318468 6 5 2 3 1 6 4 942318468 6 4 5 2 3 1 6 942318468 6 6 4 5 2 3 1 942318468 6 1 6 4 5 2 3 942318468 6 3 1 6 4 5 2 942318468 6 3 1 2 6 4 5 942318468 6 2 3 1 6 4 5 942318468 6 1 2 3 6 4 5 942318468 6 3 1 2 6 4 5 942318468 6 1 2 3 6 4 5 942318468 6 ...
result:
ok correct
Test #7:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
6 8 9 8 3 6 11 8 4 6 4 4 4 3 4 3 1 1 3 1 0 1
output:
942318468 6 3 1 6 4 5 2 942318468 6 2 3 1 6 4 5 942318468 6 5 2 3 1 6 4 942318468 6 4 5 2 3 1 6 942318468 6 6 4 5 2 3 1 942318468 6 1 6 4 5 2 3 942318468 6 3 1 6 4 5 2 942318468 6 3 4 5 1 6 2 942318468 6 5 3 4 1 6 2 942318468 6 4 5 3 1 6 2 942318468 6 3 4 5 1 6 2 942318468 6 3 4 5 1 6 2 942318468 6 ...
result:
ok correct
Subtask #2:
score: 15
Accepted
Test #8:
score: 15
Accepted
time: 2ms
memory: 3916kb
input:
40 411 426 445 478 469 456 459 420 429 400 395 362 391 354 319 350 343 326 307 344 317 342 381 394 379 348 383 380 385 384 391 412 391 408 409 432 421 396 407 384 411 194 205 212 193 184 199 186 169 154 167 170 171 164 169 158 175 194 193 202 197 194 149 140 141 138 131 126 129 128 137 142 149 129 1...
output:
942318468 40 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 29 942318468 40 29 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 942318468 40 7 29 30 35 31 34 21 40 26 12 23 18 36 3...
result:
ok correct
Test #9:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
40 411 426 445 478 469 456 459 420 429 400 395 362 391 354 319 350 343 326 307 344 317 342 381 394 379 348 383 380 385 384 391 412 391 408 409 432 421 396 407 384 411 194 205 212 193 184 199 186 169 154 167 170 171 164 169 158 175 194 193 202 197 194 149 140 141 138 131 126 129 128 137 142 149 129 1...
output:
942318468 40 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 29 942318468 40 29 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 942318468 40 7 29 30 35 31 34 21 40 26 12 23 18 36 3...
result:
ok correct
Test #10:
score: 0
Accepted
time: 2ms
memory: 4144kb
input:
40 411 426 445 478 469 456 459 420 429 400 395 362 391 354 319 350 343 326 307 344 317 342 381 394 379 348 383 380 385 384 391 412 391 408 409 432 421 396 407 384 411 194 205 212 193 184 199 186 169 154 167 170 171 164 169 158 175 194 193 202 197 194 149 140 141 138 131 126 129 128 137 142 149 129 1...
output:
942318468 40 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 29 942318468 40 29 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 942318468 40 7 29 30 35 31 34 21 40 26 12 23 18 36 3...
result:
ok correct
Test #11:
score: 0
Accepted
time: 1ms
memory: 3888kb
input:
40 411 426 445 478 469 456 459 420 429 400 395 362 391 354 319 350 343 326 307 344 317 342 381 394 379 348 383 380 385 384 391 412 391 408 409 432 421 396 407 384 411 194 205 212 193 184 199 186 169 154 167 170 171 164 169 158 175 194 193 202 197 194 149 140 141 138 131 126 129 128 137 142 149 129 1...
output:
942318468 40 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 29 942318468 40 29 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 942318468 40 7 29 30 35 31 34 21 40 26 12 23 18 36 3...
result:
ok correct
Test #12:
score: 0
Accepted
time: 2ms
memory: 3844kb
input:
40 281 264 291 328 363 402 421 384 413 406 403 370 335 344 375 382 385 360 381 382 397 382 393 426 449 474 465 478 465 442 411 416 411 428 417 378 377 350 329 300 281 163 166 149 162 179 166 151 146 151 162 169 166 155 170 179 160 179 172 171 162 163 120 113 110 105 110 117 116 107 110 119 120 99 97...
output:
942318468 40 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 29 942318468 40 29 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 942318468 40 7 29 30 35 31 34 21 40 26 12 23 18 36 3...
result:
ok correct
Test #13:
score: 0
Accepted
time: 0ms
memory: 4124kb
input:
40 499 516 489 452 417 378 359 396 367 374 377 410 445 436 405 398 395 420 399 398 383 398 387 354 331 306 315 302 315 338 369 364 369 352 363 402 403 430 451 480 499 217 210 193 178 159 160 151 162 151 164 181 180 199 204 213 200 197 192 199 214 217 145 148 141 136 127 128 127 136 133 140 145 128 1...
output:
942318468 40 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 29 942318468 40 29 30 35 31 34 21 40 26 12 23 18 36 32 27 14 25 8 9 4 15 28 13 20 10 33 19 17 5 16 38 37 22 24 6 39 11 1 3 2 7 942318468 40 7 29 30 35 31 34 21 40 26 12 23 18 36 3...
result:
ok correct
Subtask #3:
score: 15
Accepted
Test #14:
score: 15
Accepted
time: 32ms
memory: 4164kb
input:
250 14789 14922 14795 14582 14379 14130 14017 13998 14205 14130 14213 14278 14431 14562 14369 14140 13997 13862 14107 14092 13855 13696 13799 13974 14187 14006 13921 14168 14177 13968 13799 13872 13671 13778 13793 13988 13757 13608 13549 13360 13185 13142 12951 12788 12967 13182 13219 13186 13065 13...
output:
942318468 250 245 237 50 152 195 106 223 82 73 192 202 172 185 97 95 239 179 162 69 63 191 180 144 149 79 99 126 92 228 37 243 236 113 238 137 141 112 224 211 29 96 194 177 201 173 123 181 52 8 56 94 127 203 45 122 64 199 231 178 150 13 41 219 31 229 57 34 111 249 248 120 88 66 83 184 46 160 233 218...
result:
ok correct
Test #15:
score: 0
Accepted
time: 25ms
memory: 3844kb
input:
250 15711 15542 15623 15726 15841 16084 15949 15732 15753 15852 15907 15896 15713 15626 15519 15428 15301 15204 15189 15110 15293 15428 15643 15712 15713 15936 15791 15644 15447 15664 15539 15440 15379 15588 15471 15332 15469 15492 15461 15262 15027 15118 15193 15190 15261 15106 15277 15220 15193 15...
output:
942318468 250 245 237 50 152 195 106 223 82 73 192 202 172 185 97 95 239 179 162 69 63 191 180 144 149 79 99 126 92 228 37 243 236 113 238 137 141 112 224 211 29 96 194 177 201 173 123 181 52 8 56 94 127 203 45 122 64 199 231 178 150 13 41 219 31 229 57 34 111 249 248 120 88 66 83 184 46 160 233 218...
result:
ok correct
Test #16:
score: 0
Accepted
time: 28ms
memory: 3864kb
input:
250 16336 16203 16330 16543 16746 16995 17108 17127 16920 16995 16912 16847 16694 16563 16756 16985 17128 17263 17018 17033 17270 17429 17326 17151 16938 17119 17204 16957 16948 17157 17326 17253 17454 17347 17332 17137 17368 17517 17576 17765 17940 17983 18174 18337 18158 17943 17906 17939 18060 18...
output:
942318468 250 245 237 50 152 195 106 223 82 73 192 202 172 185 97 95 239 179 162 69 63 191 180 144 149 79 99 126 92 228 37 243 236 113 238 137 141 112 224 211 29 96 194 177 201 173 123 181 52 8 56 94 127 203 45 122 64 199 231 178 150 13 41 219 31 229 57 34 111 249 248 120 88 66 83 184 46 160 233 218...
result:
ok correct
Test #17:
score: 0
Accepted
time: 38ms
memory: 3912kb
input:
250 15201 15292 15045 15082 15039 15060 14891 14902 15117 14916 14727 14872 15049 15088 15131 15314 15107 15172 15267 15330 15263 15144 15121 15042 14857 14630 14391 14548 14543 14574 14653 14764 14757 14920 14697 14580 14437 14436 14627 14742 14759 14808 14597 14724 14557 14716 14929 15058 15301 15...
output:
942318468 250 168 159 138 215 192 50 9 87 218 241 46 174 128 143 67 177 31 54 208 178 193 154 139 173 4 91 37 176 190 191 98 93 23 48 92 166 136 106 8 44 69 123 105 142 198 70 3 246 153 197 84 10 45 15 39 140 26 85 129 101 232 131 5 186 73 146 83 135 12 249 202 219 157 214 145 57 49 150 162 234 200 ...
result:
ok correct
Test #18:
score: 0
Accepted
time: 31ms
memory: 3912kb
input:
250 15201 15292 15045 15082 15039 15060 14891 14902 15117 14916 14727 14872 15049 15088 15131 15314 15107 15172 15267 15330 15263 15144 15121 15042 14857 14630 14391 14548 14543 14574 14653 14764 14757 14920 14697 14580 14437 14436 14627 14742 14759 14808 14597 14724 14557 14716 14929 15058 15301 15...
output:
942318468 250 168 159 138 215 192 50 9 87 218 241 46 174 128 143 67 177 31 54 208 178 193 154 139 173 4 91 37 176 190 191 98 93 23 48 92 166 136 106 8 44 69 123 105 142 198 70 3 246 153 197 84 10 45 15 39 140 26 85 129 101 232 131 5 186 73 146 83 135 12 249 202 219 157 214 145 57 49 150 162 234 200 ...
result:
ok correct
Test #19:
score: 0
Accepted
time: 39ms
memory: 3904kb
input:
250 15201 15292 15045 15082 15039 15060 14891 14902 15117 14916 14727 14872 15049 15088 15131 15314 15107 15172 15267 15330 15263 15144 15121 15042 14857 14630 14391 14548 14543 14574 14653 14764 14757 14920 14697 14580 14437 14436 14627 14742 14759 14808 14597 14724 14557 14716 14929 15058 15301 15...
output:
942318468 250 168 159 138 215 192 50 9 87 218 241 46 174 128 143 67 177 31 54 208 178 193 154 139 173 4 91 37 176 190 191 98 93 23 48 92 166 136 106 8 44 69 123 105 142 198 70 3 246 153 197 84 10 45 15 39 140 26 85 129 101 232 131 5 186 73 146 83 135 12 249 202 219 157 214 145 57 49 150 162 234 200 ...
result:
ok correct
Subtask #4:
score: 0
Wrong Answer
Test #20:
score: 0
Wrong Answer
time: 76ms
memory: 3904kb
input:
444 49310 48961 48740 49127 49042 49307 49708 49269 48916 49277 48898 49199 48880 49255 49012 48889 49050 48759 48976 49297 49664 50013 49628 49855 49738 49665 49650 49745 49750 49395 49098 49321 49640 49603 49856 49593 49358 49753 49420 49575 49272 49099 49092 49515 49580 49489 49472 49701 50016 49...
output:
942318468 444 168 373 138 215 389 50 356 381 218 423 387 174 128 300 67 355 31 351 327 178 428 154 429 173 4 91 37 176 190 191 366 93 23 48 92 354 136 345 8 44 69 341 105 142 198 285 3 376 153 197 84 438 311 400 39 251 324 85 129 359 232 131 5 422 362 365 83 347 357 375 202 277 332 361 145 57 49 150...
result:
wrong answer Too many queries
Subtask #5:
score: 0
Wrong Answer
Test #26:
score: 0
Wrong Answer
time: 594ms
memory: 4264kb
input:
2000 1015913 1016826 1015589 1014958 1013775 1013282 1011963 1012896 1012819 1011102 1011823 1013092 1014097 1014676 1016411 1015838 1016139 1016316 1015061 1014824 1013179 1011248 1009547 1008234 1007875 1006296 1008003 1009890 1010649 1011506 1012737 1014648 1012851 1012484 1014355 1014508 1015871...
output:
942318468 2000 815 199 1180 1768 1941 627 102 465 398 388 1469 1064 1564 1950 279 1965 739 148 1714 1619 1315 1585 395 62 1735 993 333 1595 405 697 1829 1402 525 1160 511 1358 547 1577 14 699 1823 71 1600 1213 1139 1074 620 1365 311 1682 1678 1935 234 1190 81 86 1875 1706 1452 1014 1417 775 807 644 ...
result:
wrong answer Too many queries
Subtask #6:
score: 0
Wrong Answer
Test #32:
score: 0
Wrong Answer
time: 1361ms
memory: 4208kb
input:
4000 3946673 3945990 3944113 3945440 3947013 3949694 3951893 3953366 3956191 3953198 3956903 3954290 3953735 3956618 3954915 3952916 3953703 3952696 3952199 3949116 3946965 3943790 3941695 3944956 3948787 3946338 3943769 3946530 3943899 3940376 3941305 3942764 3940631 3940966 3938265 3935392 3933923...
output:
942318468 4000 3469 3391 1355 1642 2620 1967 1326 2507 337 3643 971 2479 3122 3135 922 53 66 1738 1552 3805 504 3816 2566 2460 3032 412 1661 3488 3367 1645 1541 3708 1206 1483 3068 1469 664 2590 189 3514 1891 2689 262 413 1622 134 2480 3130 2131 1038 2847 3287 1511 2373 3932 771 2879 95 3218 1451 26...
result:
wrong answer Too many queries