QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#866304 | #8812. Library 3 | lgvc# | 21 | 36ms | 3840kb | C++23 | 401b | 2025-01-22 14:23:10 | 2025-01-22 14:23:15 |
Judging History
answer
#include "library3.h"
#include <bits/stdc++.h>
void solve(int N) {
std::vector<int> b;
b.resize(N);
std::mt19937 rng(114);
for(int i=0;i<N;i++) {
b[i]=i;
std::swap(b[i],b[rng()%(i+1)]);
}
int tp=query(b);
for(int i=0;i<N;i++) {
for(int j=i+1;j<N;j++) {
std::swap(b[i],b[j]);
int ak=query(b);
if(ak<tp) tp=ak;
else std::swap(b[i],b[j]);
}
}
answer(b);
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 2
Accepted
Test #1:
score: 2
Accepted
time: 0ms
memory: 3712kb
input:
2 0 1
output:
? 0 1 ? 1 0 ! 0 1 -
result:
ok Accepted
Test #2:
score: 2
Accepted
time: 0ms
memory: 3840kb
input:
3 1 2 0 1
output:
? 0 2 1 ? 2 0 1 ? 1 2 0 ? 1 0 2 ! 1 2 0 -
result:
ok Accepted
Test #3:
score: 2
Accepted
time: 1ms
memory: 3840kb
input:
4 1 2 2 0 1 1 1
output:
? 0 2 3 1 ? 2 0 3 1 ? 3 2 0 1 ? 1 2 3 0 ? 1 3 2 0 ? 1 0 3 2 ? 1 2 0 3 ! 1 2 3 0 -
result:
ok Accepted
Test #4:
score: 2
Accepted
time: 0ms
memory: 3712kb
input:
5 3 2 1 2 0 1 1 1 1 1 1
output:
? 0 2 4 1 3 ? 2 0 4 1 3 ? 4 0 2 1 3 ? 1 0 2 4 3 ? 3 0 2 1 4 ? 3 2 0 1 4 ? 3 1 2 0 4 ? 3 4 2 1 0 ? 3 0 1 2 4 ? 3 0 4 1 2 ? 3 0 2 4 1 ! 3 0 2 1 4 -
result:
ok Accepted
Test #5:
score: 2
Accepted
time: 1ms
memory: 3840kb
input:
5 4 3 2 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0 3 5 ? 2 3 4 6 1 0 5 ? 2 5 4 6 1 3 0 ? 2 0 6 4 1 3 5 ? 2 0 1 6 4 3 5 ? 2 0 3 6 1 4 5 ? 2 0 5 6 1 3 4 ? 2 0 4 1 6 3 5 ? 2 0 4 3 1 6 5 ? 2 0 4 5 1 ...
result:
ok Accepted
Test #12:
score: 19
Accepted
time: 3ms
memory: 3840kb
input:
50 43 44 44 44 44 44 44 44 42 43 43 43 43 43 41 42 42 42 42 40 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 39 40 40 40 40 40 38 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 37 38 38 38 38 38 38 38 38 38 38 38 36 ...
output:
? 30 20 7 21 29 44 46 23 17 27 49 32 39 43 5 38 41 3 6 24 18 33 28 34 45 47 36 16 35 31 37 25 48 12 9 26 22 13 8 19 42 4 11 0 2 1 10 15 40 14 ? 20 30 7 21 29 44 46 23 17 27 49 32 39 43 5 38 41 3 6 24 18 33 28 34 45 47 36 16 35 31 37 25 48 12 9 26 22 13 8 19 42 4 11 0 2 1 10 15 40 14 ? 7 20 30 21 29 ...
result:
ok Accepted
Test #13:
score: 19
Accepted
time: 36ms
memory: 3712kb
input:
98 91 90 91 89 90 88 89 89 89 89 89 89 89 89 89 89 89 87 88 88 88 88 88 88 88 88 88 88 88 86 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 85 86 86 86 86 86 86 86 86 84 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 83 ...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 94 51 0 2 1 86 53 40 84 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 ? 20 30 7 93 2...
result:
ok Accepted
Test #14:
score: 19
Accepted
time: 28ms
memory: 3712kb
input:
98 87 86 87 85 86 86 84 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 83 84 84 84 84 82 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 83 ...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 94 51 0 2 1 86 53 40 84 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 ? 20 30 7 93 2...
result:
ok Accepted
Test #15:
score: 19
Accepted
time: 21ms
memory: 3840kb
input:
99 97 96 95 96 96 96 96 96 94 95 95 95 95 95 95 95 93 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 92 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 91 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 ...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 98 51 0 2 1 86 53 40 84 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 94 ? 20 30 7 9...
result:
ok Accepted
Test #16:
score: 19
Accepted
time: 26ms
memory: 3840kb
input:
99 93 94 92 93 93 91 92 92 90 89 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 88 89 89 89 89 89 89 89 89 89 89 89 87 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 ...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 98 51 0 2 1 86 53 40 84 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 94 ? 20 30 7 9...
result:
ok Accepted
Test #17:
score: 19
Accepted
time: 30ms
memory: 3712kb
input:
99 95 94 95 95 93 92 93 93 93 93 93 93 93 93 93 93 93 93 93 93 91 92 92 92 92 92 92 92 92 92 92 92 92 92 92 90 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 ...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 98 51 0 2 1 86 53 40 84 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 94 ? 20 30 7 9...
result:
ok Accepted
Test #18:
score: 19
Accepted
time: 25ms
memory: 3712kb
input:
100 96 97 95 94 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 93 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 98 51 0 2 1 86 53 40 99 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 94 84 ? 20 30 ...
result:
ok Accepted
Test #19:
score: 19
Accepted
time: 27ms
memory: 3840kb
input:
100 92 93 93 93 93 93 93 93 93 91 92 90 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 89 90 90 90 90 90 90 90 90 90 90 88 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 98 51 0 2 1 86 53 40 99 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 94 84 ? 20 30 ...
result:
ok Accepted
Test #20:
score: 19
Accepted
time: 27ms
memory: 3840kb
input:
100 93 92 93 93 93 91 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 90 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 98 51 0 2 1 86 53 40 99 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 94 84 ? 20 30 ...
result:
ok Accepted
Test #21:
score: 19
Accepted
time: 32ms
memory: 3712kb
input:
100 93 94 94 94 92 91 92 92 92 92 92 92 92 92 90 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 89 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 98 51 0 2 1 86 53 40 99 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 94 84 ? 20 30 ...
result:
ok Accepted
Test #22:
score: 19
Accepted
time: 29ms
memory: 3712kb
input:
99 91 92 90 89 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 88 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 87 88 88 88 88 88 88 88 88 88 ...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 98 51 0 2 1 86 53 40 84 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 94 ? 20 30 7 9...
result:
ok Accepted
Test #23:
score: 19
Accepted
time: 23ms
memory: 3840kb
input:
100 97 96 97 97 97 97 95 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 94 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 98 51 0 2 1 86 53 40 99 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 94 84 ? 20 30 ...
result:
ok Accepted
Test #24:
score: 19
Accepted
time: 32ms
memory: 3840kb
input:
100 93 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 92 91 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92...
output:
? 30 20 7 93 29 44 71 23 82 70 49 50 64 63 5 38 41 57 88 24 75 56 28 34 77 72 79 16 35 62 37 25 92 12 78 26 54 13 8 19 42 98 51 0 2 1 86 53 40 99 32 68 61 15 22 59 96 65 80 6 67 66 74 43 39 69 18 21 11 87 27 90 85 14 31 52 76 45 89 36 55 91 17 60 73 47 10 3 58 9 46 95 48 83 4 81 97 33 94 84 ? 20 30 ...
result:
ok Accepted
Subtask #3:
score: 0
Time Limit Exceeded
Dependency #2:
100%
Accepted
Test #25:
score: 0
Time Limit Exceeded
input:
498 493 494 492 493 491 492 492 492 490 491 491 489 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 490 ...
output:
? 485 456 7 190 415 207 71 332 220 131 49 163 140 63 442 114 256 219 88 175 167 56 178 384 437 72 316 16 399 188 315 179 285 113 206 431 263 13 212 250 496 209 137 176 2 1 397 417 468 138 430 462 61 300 387 405 194 65 80 394 488 66 74 189 39 107 419 184 434 139 146 195 445 133 478 276 292 333 120 36...