QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#151577 | #2789. Sorting | AbdelmagedNour# | 74 | 60ms | 26932kb | C++20 | 1.0kb | 2023-08-27 02:07:25 | 2024-07-04 01:51:53 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
//#include "grader.cpp"
#include "sorting.h"
bool check(int T,int N,int M,int S[],int X[],int Y[],int P[],int Q[]){
vector<vector<int>>nxt(T+1,vector<int>(N));
for(int i=0;i<N;i++)nxt[T][i]=i;
for(int i=T-1;i>=0;i--){
for(int j=0;j<N;j++){
nxt[i][j]=nxt[i+1][j];
}
swap(nxt[i][X[i]],nxt[i][Y[i]]);
}
int a[N];
for(int i=0;i<N;i++)a[i]=S[i];
for(int i=0;i<T;i++){
int j=0;
swap(a[X[i]],a[Y[i]]);
while(j<N&&a[j]==nxt[i+1][j])j++;
if(j==N)P[i]=Q[i]=0;
else P[i]=j,Q[i]=find(nxt[i+1].begin(),nxt[i+1].end(),a[j])-nxt[i+1].begin();
swap(a[P[i]],a[Q[i]]);
}
return is_sorted(a,a+N);
}
int findSwapPairs(int N,int S[],int M,int X[],int Y[],int P[],int Q[]){
int l=1,r=M,res=1;
if(is_sorted(S,S+N))return 0;
while(l<=r){
int md=(l+r)>>1;
if(check(md,N,M,S,X,Y,P,Q))r=(res=md)-1;
else l=md+1;
}
check(res,N,M,S,X,Y,P,Q);
return res;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 8
Accepted
Test #1:
score: 8
Accepted
time: 0ms
memory: 3980kb
input:
1 0 1 0 0
output:
0
result:
ok correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3976kb
input:
2 0 1 4 0 0 0 0 0 0 0 0
output:
0
result:
ok correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 3736kb
input:
2 1 0 4 0 0 0 0 0 0 0 0
output:
1 0 1
result:
ok correct
Test #4:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
3 1 0 2 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
1 0 1
result:
ok correct
Test #5:
score: 0
Accepted
time: 1ms
memory: 3664kb
input:
4 3 2 0 1 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
3 0 3 0 1 0 2
result:
ok correct
Test #6:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
5 1 4 2 3 0 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
2 0 1 0 4
result:
ok correct
Test #7:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
5 4 2 1 0 3 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
3 0 4 0 3 1 2
result:
ok correct
Subtask #2:
score: 12
Accepted
Test #8:
score: 12
Accepted
time: 0ms
memory: 3724kb
input:
1 0 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
0
result:
ok correct
Test #9:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
2 0 1 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
0
result:
ok correct
Test #10:
score: 0
Accepted
time: 1ms
memory: 3964kb
input:
98 82 70 31 12 27 51 84 90 66 8 49 52 74 91 46 7 96 67 63 85 34 50 87 83 58 78 26 39 77 48 2 55 94 25 61 56 53 13 32 86 72 20 37 73 9 93 65 28 18 11 71 59 88 35 76 40 24 36 33 3 17 29 38 5 21 15 79 30 62 92 45 80 64 95 43 75 97 23 16 57 22 60 41 69 0 42 14 10 47 68 19 4 1 6 44 81 54 89 2940 0 0 0 0 ...
output:
93 0 82 0 41 0 20 0 34 0 61 0 29 0 48 0 18 0 63 0 5 0 51 0 59 0 3 0 12 0 74 0 43 0 73 0 95 0 81 0 60 0 17 0 67 0 30 0 2 0 31 0 55 0 40 0 72 0 64 0 21 0 50 0 71 0 80 0 22 0 87 0 10 0 49 0 11 0 52 0 88 0 47 0 28 0 77 0 23 0 83 0 69 0 92 0 1 0 70 0 45 0 93 0 6 0 84 4 27 4 39 4 86 4 14 4 46 4 65 4 15 4 ...
result:
ok correct
Test #11:
score: 0
Accepted
time: 1ms
memory: 4216kb
input:
99 8 14 3 0 98 74 18 10 50 93 49 23 80 2 54 79 90 31 66 38 81 36 42 83 39 7 9 71 59 62 67 4 68 5 70 72 34 95 25 27 45 61 97 48 29 15 46 12 87 22 26 63 77 84 11 85 30 24 40 78 41 1 96 69 94 19 6 65 33 13 52 75 88 82 86 20 92 43 89 47 28 73 35 32 53 60 21 16 37 58 44 76 57 56 17 55 91 51 64 2970 0 0 0...
output:
92 0 8 0 50 0 26 0 9 0 93 0 56 0 30 0 67 0 65 0 19 0 38 0 25 0 7 0 10 0 49 0 22 0 42 0 97 0 51 0 63 0 69 0 13 0 2 0 3 1 14 1 54 1 11 1 23 1 83 1 32 1 68 1 33 1 5 1 74 1 86 1 21 1 36 1 34 1 70 1 52 1 77 1 43 1 48 1 87 1 16 1 90 1 44 1 29 1 62 1 96 1 91 1 76 1 92 1 57 1 24 1 39 1 27 1 71 1 75 1 20 1 8...
result:
ok correct
Test #12:
score: 0
Accepted
time: 0ms
memory: 3964kb
input:
96 12 91 75 59 44 30 52 63 41 13 93 79 82 60 85 78 50 53 57 8 80 67 34 24 87 17 47 33 83 21 81 40 89 49 32 70 26 9 43 7 11 37 94 36 23 28 90 42 35 25 62 56 20 84 55 45 46 22 77 51 0 69 1 31 54 2 3 58 88 76 5 6 65 92 39 66 15 95 10 27 14 86 72 4 68 18 38 19 64 73 71 74 48 29 61 16 2880 0 0 0 0 0 0 0 ...
output:
95 0 12 0 82 0 72 0 65 0 2 0 75 0 66 0 3 0 59 0 51 0 56 0 46 0 90 0 71 0 6 0 52 0 20 0 80 0 14 0 85 0 18 0 57 0 22 0 34 0 32 0 89 0 73 0 92 0 48 0 35 0 70 0 5 0 30 0 81 0 86 0 38 0 43 0 36 0 26 0 47 0 42 0 94 0 61 0 69 0 76 0 15 0 78 0 10 0 93 0 29 0 21 0 67 0 58 0 77 0 95 0 16 0 50 0 62 0 1 0 91 0 ...
result:
ok correct
Subtask #3:
score: 16
Accepted
Test #13:
score: 16
Accepted
time: 0ms
memory: 3728kb
input:
2 0 1 60 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
output:
0
result:
ok correct
Test #14:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
5 0 4 1 3 2 150 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ...
output:
2 0 4 1 2
result:
ok correct
Test #15:
score: 0
Accepted
time: 1ms
memory: 3940kb
input:
96 7 15 12 95 11 50 20 42 81 29 58 80 56 71 63 66 44 6 64 39 2 22 73 1 24 27 69 28 45 25 60 61 5 94 14 65 9 86 68 32 79 37 3 57 34 35 10 88 76 78 21 93 19 53 84 52 4 33 38 55 62 67 77 41 31 48 91 49 51 43 90 8 87 54 16 17 70 46 85 0 75 92 74 47 36 89 30 13 59 26 40 18 82 83 72 23 2880 0 1 0 1 0 1 0 ...
output:
91 0 15 0 7 0 66 0 42 0 91 0 3 0 18 0 95 0 64 0 23 0 31 1 61 0 67 1 49 0 78 1 85 0 89 1 26 0 69 1 43 0 57 1 33 0 94 1 72 0 87 1 13 0 71 1 8 0 81 1 92 0 82 1 74 0 16 1 44 0 34 1 14 0 63 1 41 0 37 1 86 0 30 1 60 0 62 1 77 0 46 1 10 0 58 1 38 0 68 1 51 0 93 1 83 0 47 1 88 0 59 1 55 0 52 1 19 0 39 1 32 ...
result:
ok correct
Test #16:
score: 0
Accepted
time: 1ms
memory: 3924kb
input:
99 28 2 16 95 73 6 30 90 18 46 82 69 59 4 40 49 33 29 66 86 97 56 22 96 38 35 67 15 83 44 36 72 81 41 76 47 34 87 65 9 92 57 0 55 68 5 32 17 61 50 14 19 58 24 98 48 53 60 45 12 39 3 8 74 88 77 13 85 84 42 79 51 94 70 10 25 75 31 62 27 64 1 80 78 21 37 7 63 52 23 71 20 54 26 43 91 89 93 11 2970 0 1 0...
output:
92 0 2 0 28 0 16 0 83 0 33 0 78 0 41 0 62 0 57 0 8 0 60 0 18 0 39 0 66 0 9 0 13 0 46 0 4 0 32 0 73 0 81 0 70 1 79 0 27 1 15 0 49 1 50 0 14 1 40 0 92 1 54 0 98 1 11 0 69 1 42 3 95 3 91 3 20 3 97 3 93 3 26 3 67 3 85 3 37 3 87 3 63 3 74 3 10 3 82 3 80 3 64 3 88 3 52 3 58 3 45 3 5 3 6 3 30 3 36 3 34 3 7...
result:
ok correct
Test #17:
score: 0
Accepted
time: 0ms
memory: 3988kb
input:
99 52 0 59 91 38 87 65 75 48 11 64 60 95 71 62 79 49 30 47 56 33 16 94 8 78 36 13 68 9 35 74 77 80 24 15 83 28 66 12 51 92 84 43 40 4 46 63 57 17 85 42 25 81 14 50 31 72 34 70 88 67 53 6 37 44 45 96 69 2 86 76 55 3 82 22 5 93 39 26 41 98 7 27 1 20 29 23 19 54 18 61 90 89 32 97 73 10 58 21 2970 0 1 0...
output:
97 1 52 0 81 1 7 0 75 1 5 0 87 1 19 0 56 1 72 0 3 1 91 0 90 1 61 0 53 1 14 0 62 1 6 0 65 1 45 0 46 1 63 0 37 1 66 0 96 1 10 0 64 1 44 0 4 1 38 0 12 1 95 0 73 1 82 0 27 1 68 0 2 1 59 0 88 1 54 0 50 1 42 0 43 1 40 0 92 1 89 0 18 1 47 0 57 1 34 0 15 1 79 0 41 1 84 0 20 1 33 0 24 1 78 0 26 1 13 0 71 1 5...
result:
ok correct
Test #18:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
4 0 1 3 2 120 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...
output:
2 2 3 0 0
result:
ok correct
Subtask #4:
score: 18
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #19:
score: 18
Accepted
time: 0ms
memory: 3784kb
input:
1 0 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
0
result:
ok correct
Test #20:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
2 0 1 60 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 0 1 0 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 0 0 1 0 1 0 1 0 1 1 0 0 1 1 0 1 0 1 0
output:
0
result:
ok correct
Test #21:
score: 0
Accepted
time: 3ms
memory: 17012kb
input:
481 264 22 307 266 238 227 68 26 13 12 384 162 410 306 374 311 442 38 407 310 280 308 333 146 326 381 367 110 190 33 141 468 153 393 157 415 229 75 276 392 349 348 179 445 317 64 78 20 323 257 292 395 129 259 165 398 151 219 14 116 338 188 243 61 150 84 72 340 155 133 459 464 248 433 124 399 177 62 ...
output:
473 0 362 0 472 0 413 0 210 0 415 0 419 0 121 0 351 0 97 0 18 0 126 0 299 0 361 0 343 0 169 0 72 0 227 0 266 0 74 0 281 0 79 0 336 0 230 0 56 0 440 0 471 0 89 0 445 0 388 0 4 0 70 0 302 0 305 0 286 0 33 0 183 0 421 0 64 0 254 0 469 0 48 0 120 0 178 0 439 0 234 0 208 0 366 0 185 0 103 0 9 0 371 0 431...
result:
ok correct
Test #22:
score: 0
Accepted
time: 11ms
memory: 16752kb
input:
478 458 446 125 326 318 327 263 67 453 296 46 116 270 440 323 38 181 235 415 412 95 365 133 397 157 441 348 223 459 449 149 168 59 107 171 262 328 450 289 314 141 139 29 393 211 477 146 239 433 142 269 145 342 155 238 172 206 23 108 31 48 117 180 424 50 147 325 468 161 291 272 130 93 472 245 207 154...
output:
476 0 227 0 364 0 425 0 205 0 215 0 477 0 248 0 371 0 260 0 153 0 431 0 321 0 449 0 163 0 450 0 346 0 477 0 104 0 146 0 228 0 54 0 267 0 209 0 436 0 319 0 302 0 40 0 210 0 148 0 403 0 265 0 217 0 351 0 83 0 118 0 240 0 201 0 177 0 164 0 35 0 468 0 59 0 56 0 88 0 326 0 245 0 95 0 418 0 345 0 306 0 41...
result:
ok correct
Test #23:
score: 0
Accepted
time: 12ms
memory: 17756kb
input:
496 426 495 20 100 83 50 3 247 94 52 290 45 179 160 344 239 270 133 492 398 131 476 271 436 69 351 401 494 111 76 393 432 431 207 53 350 24 288 278 359 413 253 181 166 186 336 35 173 209 448 352 364 188 434 203 38 439 32 328 285 213 112 47 128 136 303 49 180 444 132 177 114 287 475 161 483 14 108 66...
output:
490 0 123 0 165 0 325 0 294 0 207 0 118 0 408 0 144 0 132 0 477 0 241 0 227 0 180 0 95 0 356 0 370 0 322 0 290 0 286 0 429 0 206 0 115 0 481 0 269 0 432 0 467 0 96 0 31 0 44 0 174 0 299 0 382 0 452 0 438 0 386 0 484 0 201 0 117 0 74 0 32 0 63 0 116 0 41 0 206 0 425 0 193 0 205 0 344 0 406 0 59 0 285...
result:
ok correct
Test #24:
score: 0
Accepted
time: 4ms
memory: 17280kb
input:
484 307 290 7 454 181 133 142 213 413 207 146 153 236 111 320 453 476 103 316 158 235 388 150 155 329 297 196 345 335 197 173 0 156 59 357 85 161 280 229 98 412 187 42 226 244 203 99 475 223 81 56 309 273 87 159 317 50 313 199 366 185 409 172 483 447 427 71 284 330 30 73 414 154 70 302 417 113 107 2...
output:
422 0 405 0 70 0 73 0 91 0 456 0 282 0 426 0 449 0 118 0 171 0 462 0 307 0 31 1 206 1 122 1 120 1 188 1 285 1 367 1 341 1 423 1 92 1 397 1 125 1 19 1 158 1 296 1 224 1 270 1 364 1 76 1 411 1 445 1 138 1 68 1 358 1 50 1 330 1 275 1 132 1 468 1 201 1 305 1 146 1 10 1 435 1 264 1 408 1 350 1 472 1 45 1...
result:
ok correct
Test #25:
score: 0
Accepted
time: 11ms
memory: 17744kb
input:
496 145 300 465 228 235 186 373 183 142 208 278 11 410 286 392 245 44 470 211 368 283 240 265 120 30 68 71 158 263 356 439 243 27 311 86 134 201 33 319 371 254 181 231 89 214 435 113 59 48 151 317 143 320 195 377 426 408 303 22 47 149 330 180 175 412 140 102 204 381 441 50 258 232 105 266 52 122 423...
output:
145 2 465 4 235 7 183 9 208 12 410 12 438 14 392 19 239 20 283 21 240 23 120 23 165 24 30 25 68 27 158 27 32 31 243 33 37 34 86 34 110 35 476 36 201 38 319 40 363 42 231 42 342 43 89 45 435 46 113 49 151 50 317 50 70 51 143 52 320 54 377 54 148 55 426 55 417 3 198 58 265 61 330 65 140 65 446 67 204 ...
result:
ok correct
Test #26:
score: 0
Accepted
time: 13ms
memory: 16700kb
input:
478 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 365 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
270 1 246 1 89 1 17 1 233 1 132 1 436 1 376 1 298 1 290 1 163 1 189 1 265 1 197 1 453 1 102 1 28 1 270 1 174 1 393 1 227 1 470 1 159 1 266 1 262 1 255 1 148 1 112 1 456 1 462 1 127 1 319 1 368 1 256 1 82 2 277 2 190 2 381 2 21 2 211 2 238 2 381 2 49 2 49 2 380 2 360 2 335 2 355 2 384 2 396 2 193 2 3...
result:
ok correct
Test #27:
score: 0
Accepted
time: 3ms
memory: 16860kb
input:
476 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 129 91 92 93 94 95 96 97 98 99 100 1...
output:
473 0 361 0 285 0 136 0 121 0 219 0 282 0 137 0 444 0 77 0 152 0 273 0 264 0 316 0 156 0 313 0 167 0 388 0 314 0 35 0 42 0 57 0 329 0 274 0 127 0 146 0 199 0 337 0 408 0 141 0 111 0 357 0 233 0 464 0 181 0 457 0 201 0 18 0 61 0 8 0 287 0 251 0 435 0 81 0 384 0 367 0 36 0 359 0 100 0 118 0 456 0 415 ...
result:
ok correct
Subtask #5:
score: 20
Accepted
Test #28:
score: 20
Accepted
time: 28ms
memory: 22464kb
input:
1800 530 1775 466 953 230 1179 944 752 990 1316 275 1029 158 152 1673 1706 172 115 599 1661 131 699 1112 454 551 1059 291 495 28 67 773 480 839 462 1210 757 879 285 439 3 1429 820 26 1023 942 199 356 625 1705 1421 144 1529 716 7 1485 1027 1599 696 517 1353 456 1389 273 1363 1414 1177 718 41 777 1621...
output:
1794 0 530 0 288 0 1704 0 346 0 1543 0 941 0 475 0 576 0 965 0 1091 0 194 0 1005 0 1734 0 1664 0 139 0 1736 0 1406 0 713 0 1157 0 1310 0 1342 0 1323 0 1671 0 1156 0 1727 0 486 0 633 0 513 0 1499 0 104 0 1712 0 492 0 1480 0 282 0 512 0 910 0 491 0 863 0 1015 0 980 0 1198 0 192 0 212 0 880 0 508 0 651...
result:
ok correct
Test #29:
score: 0
Accepted
time: 60ms
memory: 25560kb
input:
1950 1718 335 1071 714 1080 1828 1472 410 553 1269 297 401 1021 621 1763 528 205 1231 406 5 715 876 1474 1110 653 862 838 291 1092 549 955 1334 1044 300 1070 720 1877 484 1597 1948 1078 28 87 1193 505 1024 1259 63 852 960 633 1573 713 504 15 820 1852 752 1601 1168 471 1903 499 693 1209 1492 56 908 9...
output:
1944 0 1718 0 1717 0 688 0 1910 0 683 0 969 0 625 0 692 0 1932 0 1788 0 1452 0 580 0 1787 0 898 0 794 0 1648 0 551 0 884 0 518 0 595 0 1337 0 1890 0 591 0 1801 0 1364 0 198 0 1444 0 1883 0 1942 0 1464 0 265 0 1426 0 949 0 964 0 1336 0 384 0 1267 0 350 0 1867 0 854 0 1744 0 997 0 1491 0 987 0 134 0 7...
result:
ok correct
Test #30:
score: 0
Accepted
time: 43ms
memory: 23364kb
input:
1853 452 1299 444 1527 510 1801 34 1178 1589 1782 342 1800 735 761 879 999 1122 1772 236 566 1459 1256 1149 1498 1827 1027 715 1377 6 306 1811 950 500 890 196 1825 1568 1157 943 1422 475 1237 1792 1796 1363 1217 889 968 1439 1116 322 795 1088 1358 1833 96 118 543 1337 207 876 1144 805 215 1433 903 1...
output:
1844 0 157 0 1669 0 959 0 615 0 952 0 1745 0 335 0 1646 0 718 0 184 0 599 0 363 0 1009 0 1486 0 1747 0 456 0 814 0 1536 0 711 0 336 0 871 0 1476 0 278 0 1611 0 475 0 1577 0 1344 0 608 0 1396 0 424 0 419 0 562 0 71 0 183 0 1068 0 1428 0 351 0 279 0 246 0 255 0 1549 0 1037 0 455 0 1743 0 969 0 159 0 1...
result:
ok correct
Test #31:
score: 0
Accepted
time: 1ms
memory: 3780kb
input:
1957 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
0
result:
ok correct
Test #32:
score: 0
Accepted
time: 16ms
memory: 26576kb
input:
1993 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
134 5 540 25 1610 27 1604 39 1305 65 831 66 679 66 295 67 776 68 1991 69 121 71 1306 81 1381 90 101 93 1892 113 133 115 955 124 885 157 563 169 1479 200 1256 201 1739 205 1580 206 1896 206 1693 206 1200 210 1912 213 1583 214 1829 214 1486 230 1057 237 460 245 271 245 1156 248 1383 250 1006 263 1957 ...
result:
ok correct
Test #33:
score: 0
Accepted
time: 20ms
memory: 25340kb
input:
1935 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
377 0 475 0 516 1 1156 1 591 1 848 5 355 5 640 18 1612 18 1317 18 1185 18 570 20 883 26 247 26 173 27 62 27 1638 27 593 27 508 27 420 27 1196 27 459 34 1504 39 855 39 199 39 1929 43 554 46 359 46 1259 53 514 54 1017 56 389 59 870 59 336 59 1226 60 1205 63 178 63 1685 65 250 65 502 66 961 66 816 68 5...
result:
ok correct
Test #34:
score: 0
Accepted
time: 25ms
memory: 26932kb
input:
1999 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 127 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
1080 2 1901 2 229 2 192 2 1396 2 907 2 1983 2 1763 2 1526 2 1317 2 1969 2 579 2 242 2 1885 2 657 2 1411 2 352 2 1246 2 1461 2 606 2 767 2 1687 2 329 2 177 2 1264 2 1471 2 1766 2 1171 2 1934 2 595 2 1274 2 1356 2 65 2 247 2 1218 2 590 2 1511 2 1059 2 1040 2 362 2 6 2 248 2 16 2 1013 2 1675 2 434 2 83...
result:
ok correct
Test #35:
score: 0
Accepted
time: 43ms
memory: 24412kb
input:
1901 952 410 986 1281 736 1411 1256 622 375 1423 718 1153 1238 643 120 1336 1097 881 1140 1395 1195 847 925 967 280 1859 966 360 815 770 634 1774 1359 1871 1589 618 991 571 1704 170 1548 1791 225 741 1561 35 1334 1632 203 894 728 1681 1849 22 1152 1719 701 1886 1037 1309 1576 993 1350 1643 893 1888 ...
output:
1897 0 639 0 1555 0 859 0 68 0 1468 0 1823 0 1154 0 792 0 1435 0 1319 0 1559 0 1327 0 1481 0 855 0 1052 0 884 0 1672 0 760 0 781 0 1428 0 1363 0 15 0 1526 0 915 0 799 0 1467 0 1811 0 176 0 486 0 167 0 1420 0 759 0 1888 0 1833 0 1803 0 1056 0 1092 0 459 0 1182 0 701 0 377 0 1114 0 703 0 1846 0 927 0 ...
result:
ok correct
Test #36:
score: 0
Accepted
time: 42ms
memory: 25264kb
input:
1931 1361 1614 1425 1627 1210 1778 166 420 1747 1792 1060 1914 611 833 1280 86 1754 1194 762 185 488 1368 1794 1153 1466 1689 1185 168 1622 1582 959 197 103 1809 1586 436 633 853 463 738 820 630 159 398 150 1370 558 281 1849 483 1691 350 1867 1871 1392 1791 1697 926 639 1865 1063 1726 262 1009 495 1...
output:
1923 0 161 0 1468 0 997 0 379 0 1333 0 1254 0 1065 0 469 0 946 0 1495 0 1708 0 311 0 1104 0 27 0 168 0 500 0 579 0 805 0 1581 0 750 0 1757 0 1298 0 491 0 34 0 346 0 560 0 1270 0 95 0 1022 0 1259 0 1044 0 318 0 1808 0 434 0 297 0 1771 0 868 0 471 0 147 0 98 0 1135 0 848 0 395 0 1920 0 63 0 1723 0 191...
result:
ok correct
Test #37:
score: 0
Accepted
time: 43ms
memory: 25304kb
input:
1938 428 1641 1051 1154 1556 814 986 237 1557 1082 84 1382 1823 1591 1779 1565 193 574 1683 1259 405 393 366 644 612 562 303 1567 997 1422 868 132 74 1508 1002 965 1752 500 1148 529 1119 1841 930 1608 1472 310 1435 261 705 908 588 1710 722 1427 1825 1256 1175 379 45 902 1861 62 729 1303 759 766 1022...
output:
1928 0 1238 0 1719 0 1235 0 1494 0 479 0 1053 0 101 0 1931 0 729 0 626 0 181 0 1127 0 806 0 1623 0 1461 0 779 0 1562 0 1359 0 1101 0 1892 0 612 0 791 0 957 0 783 0 761 0 396 0 1158 0 1884 0 1691 0 1029 0 792 0 1126 0 363 0 1076 0 274 0 1525 0 1721 0 1575 0 1556 0 885 0 804 0 86 0 1752 0 1165 0 520 0...
result:
ok correct
Test #38:
score: 0
Accepted
time: 55ms
memory: 26616kb
input:
1997 1053 110 1738 1025 1245 1257 472 471 13 1215 1811 1371 476 1631 1028 892 1191 20 1323 868 435 1063 870 758 1538 155 1105 27 987 1345 1228 1473 452 1092 1561 1874 1417 95 252 565 1315 1389 533 1078 1259 1440 772 0 1588 1750 1451 644 659 1161 173 200 1680 1040 1827 1567 1069 12 1730 866 1493 65 5...
output:
1693 0 1207 0 893 0 1053 0 30 0 1228 0 47 1 110 1 71 1 1749 1 1043 1 1822 1 569 1 180 1 1694 1 174 1 137 2 562 2 308 2 1320 2 1677 2 498 2 625 2 1417 2 36 2 1661 2 1034 2 1000 2 497 2 1692 2 1814 2 837 2 96 2 687 2 399 2 937 2 1341 2 432 2 1016 2 83 2 1613 2 1961 2 661 2 241 2 1921 2 692 2 890 2 110...
result:
ok correct
Test #39:
score: 0
Accepted
time: 23ms
memory: 26600kb
input:
1989 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
1091 1 1898 1 239 1 249 1 257 1 1136 1 1348 1 1067 1 221 1 71 1 1835 1 931 1 934 1 1934 1 1859 1 969 1 1357 1 1016 1 1618 1 585 1 1565 1 1928 1 327 1 645 1 1412 1 463 1 393 1 10 1 538 1 1368 1 434 1 877 1 1541 1 929 1 1658 1 288 1 1144 1 1199 1 989 1 1685 1 1269 1 1594 1 637 1 983 1 1829 1 151 1 785...
result:
ok correct
Test #40:
score: 0
Accepted
time: 51ms
memory: 25876kb
input:
1961 0 1 272 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...
output:
1959 0 59 0 1813 0 1624 0 902 0 107 0 837 0 1669 0 12 0 1280 0 1006 0 1690 0 386 0 134 0 583 0 1261 0 1176 0 1908 0 183 0 866 0 596 0 229 0 1796 0 1565 0 447 0 507 0 352 0 153 0 1703 0 1818 0 398 0 1917 0 1882 0 939 0 1340 0 1170 0 1095 0 496 0 1829 0 1412 0 1467 0 208 0 1616 0 317 0 1824 0 1076 0 4...
result:
ok correct
Test #41:
score: 0
Accepted
time: 3ms
memory: 24364kb
input:
1905 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
2 1471 1779 0 0
result:
ok correct
Subtask #6:
score: 0
Time Limit Exceeded
Dependency #5:
100%
Accepted
Test #42:
score: 0
Time Limit Exceeded
input:
176900 167810 159384 90550 63101 76883 19925 161149 18578 132157 136198 141834 156609 167914 129523 2878 165972 95279 65282 30261 94853 37236 41515 166488 123502 141101 86565 153657 72526 396 92614 23189 1661 167567 100107 155037 35542 99140 171977 171544 123048 107611 71527 111368 88756 149185 9360...
output:
Unauthorized output