QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#783289 | #9641. Two permutations | JWRuixi | 100 ✓ | 599ms | 19488kb | C++17 | 1.3kb | 2024-11-26 07:36:36 | 2024-11-26 07:36:37 |
Judging History
answer
#ifdef LOCAL
#include "stdafx.h"
#else
#include <bits/stdc++.h>
#define IL inline
#define LL long long
#define eb emplace_back
#define sz(v) ((int) (v).size())
#define me(f, x) memset(f, x, sizeof(f))
#define mc(f, g) memcpy(f, g, sizeof(g))
#define L(i, j, k) for (int i = (j); i <= (k); ++i)
#define R(i, j, k) for (int i = (j); i >= (k); --i)
#define FIO(FILE) freopen(FILE".in", "r", stdin), freopen(FILE".out", "w", stdout)
using namespace std;
using vi = vector<int>;
#endif
constexpr int N = 2e5 + 9;
int n, p[N], d[N];
list<int>::iterator it[N];
void slv () {
cin >> n;
L (i, 1, n) {
cin >> p[i];
}
L (i, 1, n) {
if (p[i] > i) {
cout << "No\n";
return;
}
}
L (i, 1, n) {
d[i] = d[p[i]] ^ 1;
}
list<int> lis;
L (i, 1, n) {
if (p[i] == i || !d[i]) {
it[i] = lis.insert(lis.end(), i);
} else {
it[i] = lis.insert(it[p[i]], i);
}
}
L (i, 1, n) {
if (p[i] == i || d[i]) {
it[i] = lis.insert(lis.end(), i);
} else {
it[i] = lis.insert(it[p[i]], i);
}
}
cout << "Yes\n";
for (int x : lis) {
cout << x << ' ';
}
cout << '\n';
}
int main () {
ios::sync_with_stdio(0), cin.tie(0);
int T;
cin >> T;
while (T--) {
slv();
}
}
// I love WHQ!
详细
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 1ms
memory: 5080kb
input:
10 1 1 2 1 1 3 1 2 2 4 1 1 3 2 5 1 2 1 2 1 2 1 1 1 1 3 1 2 2 1 1 5 1 1 1 3 2
output:
Yes 1 1 Yes 2 1 1 2 Yes 1 3 2 1 2 3 Yes 2 1 3 4 1 4 2 3 Yes 1 4 2 3 5 3 5 1 2 4 Yes 2 1 1 2 Yes 1 1 Yes 1 3 2 1 2 3 Yes 1 1 Yes 2 3 1 4 5 1 5 2 4 3
result:
ok Correct!
Test #2:
score: 10
Accepted
time: 1ms
memory: 5072kb
input:
10 4 1 2 3 3 1 1 5 1 2 1 4 2 1 1 3 1 1 1 5 1 1 1 1 1 3 1 2 1 5 1 1 2 3 4 5 1 1 1 3 2 5 1 1 3 1 5
output:
Yes 1 2 3 4 1 2 4 3 Yes 1 1 Yes 1 5 2 3 4 3 1 2 4 5 Yes 1 1 Yes 1 2 3 2 3 1 Yes 2 3 4 5 1 1 2 3 4 5 Yes 1 2 3 3 1 2 Yes 2 1 4 3 5 1 3 2 5 4 Yes 1 5 2 4 3 2 3 1 4 5 Yes 2 4 1 3 5 1 2 3 4 5
result:
ok Correct!
Test #3:
score: 10
Accepted
time: 0ms
memory: 6120kb
input:
10 5 1 2 3 4 5 5 1 1 2 3 4 5 1 2 2 3 4 5 1 1 3 2 5 5 1 1 1 1 1 5 1 2 3 4 4 5 1 2 2 2 2 5 1 1 1 2 3 5 1 2 1 2 1 5 1 2 1 2 2
output:
Yes 1 2 3 4 5 1 2 3 4 5 Yes 2 1 4 3 5 1 3 2 5 4 Yes 1 3 2 5 4 1 2 4 3 5 Yes 2 1 3 4 5 1 4 2 3 5 Yes 1 2 3 4 5 2 3 4 5 1 Yes 1 2 3 4 5 1 2 3 5 4 Yes 1 3 4 5 2 1 2 3 4 5 Yes 2 3 1 4 5 1 4 2 5 3 Yes 1 4 2 3 5 3 5 1 2 4 Yes 3 1 2 4 5 1 4 5 2 3
result:
ok Correct!
Subtask #2:
score: 10
Accepted
Test #4:
score: 10
Accepted
time: 1ms
memory: 6752kb
input:
10 10 1 2 3 4 3 1 2 4 3 8 10 1 2 1 1 4 6 4 5 2 9 10 1 2 2 4 5 3 7 7 2 3 10 1 1 2 4 5 4 3 5 7 7 10 1 2 2 4 4 1 6 6 6 10 10 1 2 2 4 1 3 7 7 1 10 10 1 2 3 4 2 1 3 3 1 7 10 1 1 1 4 5 1 3 5 4 7 10 1 2 2 1 1 2 6 5 8 5 10 1 2 2 2 5 3 6 2 4 5
output:
Yes 1 2 3 4 5 6 7 10 8 9 6 1 7 2 5 9 3 8 4 10 Yes 3 4 1 9 2 8 5 6 7 10 1 2 3 5 7 4 6 8 10 9 Yes 1 2 6 10 3 4 5 7 8 9 1 3 9 2 4 5 6 8 7 10 Yes 2 1 7 3 4 8 5 6 9 10 1 3 2 6 4 5 9 10 7 8 Yes 1 3 2 5 4 7 8 9 6 10 6 1 2 3 4 5 7 8 9 10 Yes 5 9 1 2 6 3 4 8 7 10 1 3 2 4 5 6 7 8 9 10 Yes 1 5 2 3 4 6 10...
result:
ok Correct!
Test #5:
score: 10
Accepted
time: 1ms
memory: 5956kb
input:
10 10 1 1 3 1 1 1 2 3 5 7 10 1 2 2 1 4 5 6 7 9 8 10 1 2 2 1 5 4 2 3 6 8 10 1 1 1 4 5 3 1 2 2 3 10 1 1 2 4 5 2 6 2 6 3 10 1 2 3 3 5 4 6 1 9 6 10 1 1 1 4 1 4 1 2 8 10 10 1 2 2 2 1 3 1 1 5 8 10 1 1 3 1 5 3 2 5 6 5 10 1 2 3 4 1 5 7 8 4 2
output:
Yes 1 7 2 3 4 9 5 6 8 10 2 4 5 6 1 8 3 10 7 9 Yes 4 1 2 3 6 5 8 7 9 10 1 3 2 5 4 7 6 10 8 9 Yes 1 3 7 2 6 4 5 10 8 9 4 1 2 8 3 5 9 6 7 10 Yes 2 3 7 1 4 5 6 8 9 10 1 8 9 2 6 10 3 4 5 7 Yes 1 3 6 8 2 4 5 7 9 10 2 1 10 3 4 5 7 9 6 8 Yes 8 1 2 4 3 5 7 10 6 9 1 2 3 6 4 5 7 8 9 10 Yes 1 8 2 3 6 4 5 ...
result:
ok Correct!
Test #6:
score: 10
Accepted
time: 1ms
memory: 6444kb
input:
10 10 1 1 1 3 5 4 1 2 8 9 10 1 2 2 1 2 2 5 4 5 1 10 1 1 1 1 1 2 5 2 1 10 10 1 2 2 3 2 1 3 4 7 4 9 1 1 4 3 3 5 5 4 5 9 1 1 2 2 5 4 6 3 3 9 1 2 1 4 3 5 2 5 3 10 1 2 2 4 2 5 5 3 1 9 9 1 2 3 2 4 5 6 8 9 10 1 1 1 1 4 6 4 5 7 10
output:
Yes 1 8 2 4 3 5 6 7 10 9 2 3 7 1 6 4 5 9 8 10 Yes 4 10 1 2 3 7 9 5 6 8 1 3 5 6 2 8 4 7 9 10 Yes 1 6 8 2 3 4 7 5 9 10 2 3 4 5 9 1 6 7 8 10 Yes 6 1 2 4 7 3 5 8 9 10 1 3 5 2 8 10 4 6 9 7 No Yes 1 3 4 2 5 7 6 8 9 2 1 8 9 3 6 4 5 7 Yes 3 1 2 4 6 8 5 7 9 1 7 2 5 9 3 4 6 8 Yes 1 3 5 2 4 6 7 8 10 9 9 ...
result:
ok Correct!
Subtask #3:
score: 15
Accepted
Test #7:
score: 15
Accepted
time: 172ms
memory: 17600kb
input:
10 177329 1 1 2 2 1 4 1 2 3 3 2 3 4 1 2 3 3 2 2 2 2 3 4 3 1 2 4 2 4 1 4 2 2 4 1 3 3 4 1 1 1 3 2 4 3 3 2 4 2 2 4 1 1 4 3 1 4 4 4 3 1 4 1 3 2 1 2 3 2 4 2 4 4 2 1 3 2 2 2 3 3 1 4 1 3 1 2 4 1 4 2 3 4 3 1 4 4 1 2 2 3 3 4 1 4 4 3 4 3 2 1 2 4 3 1 1 4 4 4 2 3 4 3 3 3 1 4 4 1 1 2 4 4 1 3 4 4 4 2 1 2 2 1 2 3 ...
output:
Yes 1 3 4 8 11 15 18 19 20 21 26 28 32 33 43 47 49 50 65 67 69 71 74 77 78 79 87 91 99 100 110 112 120 131 139 141 142 144 147 157 159 162 164 167 171 172 176 178 185 186 194 195 196 200 213 216 219 220 222 223 225 227 229 230 232 236 241 245 247 250 251 253 255 257 260 269 271 279 280 283 285 286 2...
result:
ok Correct!
Test #8:
score: 15
Accepted
time: 207ms
memory: 18448kb
input:
10 42861 1 2 1 2 3 1 2 2 1 1 3 4 3 1 2 3 2 2 3 2 3 4 2 2 2 4 2 3 1 2 1 4 4 2 4 3 1 1 4 3 1 1 4 1 1 4 3 3 1 3 3 3 2 4 4 1 3 2 1 1 1 1 1 1 4 3 1 1 2 4 1 1 2 4 2 3 4 4 4 2 4 3 3 3 2 1 3 4 4 3 1 3 4 4 4 1 4 4 1 3 2 4 4 3 3 4 3 3 4 3 1 4 2 1 2 3 2 4 3 4 1 2 3 4 2 4 1 3 4 1 1 1 4 3 4 2 1 4 3 1 3 3 2 1 1 4...
output:
Yes 1 2 5 11 13 16 19 21 28 36 40 47 48 50 51 52 57 66 76 82 83 84 87 90 92 100 104 105 107 108 110 116 119 123 128 134 139 141 142 147 150 151 157 161 163 164 176 177 179 180 188 203 204 206 214 216 219 221 223 225 229 234 237 239 244 246 259 261 263 265 266 268 269 273 277 278 279 284 286 290 294 ...
result:
ok Correct!
Test #9:
score: 15
Accepted
time: 153ms
memory: 18300kb
input:
10 45364 1 1 1 1 1 1 1 2 2 2 2 1 2 4 3 3 1 4 1 3 2 2 3 1 2 2 3 2 3 3 3 2 3 3 2 3 2 1 1 3 4 2 2 4 4 3 1 2 4 1 3 4 4 1 3 4 1 4 3 2 1 2 3 3 4 4 1 3 3 3 2 3 4 4 2 1 2 1 2 1 1 2 2 2 3 1 3 3 1 4 1 3 1 2 3 4 2 2 3 3 1 3 3 4 4 4 4 1 1 4 4 1 4 2 2 1 1 4 3 3 4 3 4 4 4 4 4 1 4 4 1 4 3 1 3 1 3 3 4 1 1 2 1 2 1 3...
output:
Yes 1 8 9 10 11 13 21 22 25 26 28 32 35 37 42 43 48 60 62 71 75 77 79 82 83 84 94 97 98 114 115 142 144 157 160 165 166 167 172 188 189 199 202 206 207 215 217 223 229 231 234 239 240 244 246 249 250 255 264 266 273 283 290 294 296 299 302 305 308 315 316 319 321 324 330 336 339 340 341 342 347 349 ...
result:
ok Correct!
Test #10:
score: 15
Accepted
time: 181ms
memory: 15460kb
input:
10 60502 1 1 3 2 4 3 2 4 4 1 2 2 3 3 4 3 3 4 3 1 3 4 1 2 1 1 2 1 4 2 2 2 4 4 4 3 3 1 4 1 3 4 4 4 4 2 1 3 1 2 4 4 2 1 4 4 1 2 3 3 1 2 2 4 1 3 3 1 4 1 2 2 4 1 1 4 2 1 3 3 4 4 4 4 2 2 2 2 4 4 4 3 4 3 2 4 4 4 1 4 2 3 2 3 2 3 2 1 3 2 4 2 1 1 1 3 2 3 2 2 1 2 1 4 2 2 4 4 2 3 2 4 2 1 4 2 3 2 1 1 1 1 3 2 2 3...
output:
Yes 1 4 7 11 12 24 27 30 31 32 46 50 53 58 62 63 71 72 77 85 86 87 88 95 101 103 105 107 110 112 117 119 120 122 125 126 129 131 133 136 138 144 145 149 150 157 167 169 175 181 185 190 200 211 213 217 224 229 242 247 248 249 252 255 256 257 262 265 266 270 279 282 286 290 295 298 306 307 310 314 315...
result:
ok Correct!
Test #11:
score: 15
Accepted
time: 195ms
memory: 18332kb
input:
10 192651 1 2 4 1 3 2 3 1 1 4 2 2 2 2 1 3 2 3 1 1 1 1 2 4 3 4 2 2 1 2 3 4 4 3 1 3 1 4 1 3 4 1 4 2 4 1 2 1 2 2 4 2 4 4 1 4 3 2 2 1 1 3 1 3 2 2 3 1 4 3 4 4 3 1 3 2 2 2 3 3 3 1 1 2 3 3 2 3 2 3 3 4 2 4 1 1 2 1 4 4 1 1 1 1 1 2 2 2 2 4 3 3 4 4 2 3 2 1 2 3 2 2 1 4 3 4 1 4 2 4 4 4 2 1 1 3 2 1 2 1 3 1 2 3 1 ...
output:
No Yes 1 4 7 13 14 24 26 31 33 37 38 39 41 43 48 53 55 63 64 65 67 74 77 79 80 88 90 91 92 93 100 103 105 106 113 114 123 125 127 135 136 137 140 141 144 152 155 156 158 159 163 166 168 169 170 173 176 179 184 186 193 198 201 207 208 209 212 217 220 224 225 232 233 234 239 240 250 261 266 268 273 27...
result:
ok Correct!
Test #12:
score: 15
Accepted
time: 154ms
memory: 17572kb
input:
10 96064 1 1 1 1 4 4 1 4 1 1 2 1 3 4 3 2 2 2 1 1 1 2 1 1 3 4 1 2 2 3 2 2 3 4 4 3 3 3 4 3 2 3 3 4 3 4 3 4 2 3 2 2 3 4 1 1 1 2 3 2 3 3 4 1 4 4 3 1 2 3 3 3 3 2 4 4 2 2 3 4 4 1 4 1 1 2 1 4 2 3 3 2 4 2 1 4 3 4 1 4 4 2 1 3 1 2 4 2 2 4 3 3 4 4 4 3 3 4 1 3 2 1 2 1 2 1 2 1 2 4 3 4 1 4 4 4 2 1 2 1 4 3 3 4 2 1...
output:
Yes 1 11 16 17 18 22 28 29 31 32 41 49 51 52 58 60 69 74 77 78 86 89 92 94 102 106 108 109 121 123 125 127 129 137 139 145 152 167 168 172 180 181 189 190 191 194 195 200 202 205 218 222 230 232 237 248 251 253 255 260 262 263 268 270 273 284 285 287 289 291 292 293 297 301 303 307 312 314 315 316 3...
result:
ok Correct!
Subtask #4:
score: 15
Accepted
Test #13:
score: 15
Accepted
time: 280ms
memory: 19180kb
input:
10 199850 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 10...
output:
Yes 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 101 ...
result:
ok Correct!
Test #14:
score: 15
Accepted
time: 398ms
memory: 19292kb
input:
10 199997 1 1 1 4 4 6 4 8 4 10 11 10 6 14 15 16 17 15 19 15 14 4 15 10 25 26 27 1 29 30 31 26 33 15 30 36 37 38 39 38 33 4 10 44 25 33 33 11 49 50 31 1 53 54 55 14 50 58 8 49 36 6 63 39 65 6 33 10 69 29 19 72 29 74 1 76 63 49 4 80 50 82 83 15 4 86 87 50 89 36 27 89 93 11 95 63 1 37 99 100 101 102 10...
output:
Yes 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 101 ...
result:
ok Correct!
Test #15:
score: 15
Accepted
time: 500ms
memory: 19184kb
input:
10 199730 1 2 2 2 1 2 2 1 2 10 2 12 13 10 15 16 17 13 19 20 1 13 16 24 19 2 27 28 29 17 28 12 1 16 28 1 17 13 24 17 41 42 24 17 41 28 47 2 2 2 51 52 51 15 42 56 57 42 59 20 51 62 47 64 47 66 42 12 69 70 69 15 51 74 10 47 77 78 13 69 81 82 83 84 64 2 87 28 10 90 91 10 13 74 70 96 97 12 99 17 15 17 87...
output:
Yes 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 101 ...
result:
ok Correct!
Test #16:
score: 15
Accepted
time: 540ms
memory: 19192kb
input:
10 199782 1 2 2 2 1 1 1 1 1 2 2 2 2 2 2 2 1 1 1 1 2 2 1 2 1 1 2 1 1 2 2 1 33 33 33 33 1 2 1 1 2 2 1 2 2 33 2 1 1 1 33 33 2 33 2 1 2 2 1 1 2 1 1 33 2 2 1 33 2 1 33 1 1 2 2 33 2 33 2 1 33 33 33 2 2 1 1 1 1 1 33 2 2 2 2 33 1 1 2 33 1 33 1 1 1 2 2 2 33 33 33 2 2 1 33 2 33 2 2 2 33 33 1 1 33 1 33 2 1 2 3...
output:
Yes 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 101 ...
result:
ok Correct!
Test #17:
score: 15
Accepted
time: 357ms
memory: 19172kb
input:
10 199768 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
Yes 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 101 ...
result:
ok Correct!
Test #18:
score: 15
Accepted
time: 89ms
memory: 5904kb
input:
10 199897 1 133473 137888 154846 104937 137888 3569 104774 144338 186307 16043 175982 174471 97731 56127 91564 38890 40649 89585 22112 91564 169703 102594 111754 96581 132350 39595 142435 3652 102405 58841 71649 89585 104964 111754 27732 141427 45005 177850 292 102734 71015 113628 177036 16043 30227...
output:
No No No No No No No No No No
result:
ok Correct!
Subtask #5:
score: 50
Accepted
Test #19:
score: 50
Accepted
time: 567ms
memory: 19488kb
input:
10 199755 1 2 1 3 5 1 6 7 2 1 5 6 10 9 12 2 4 14 2 18 5 17 23 4 6 7 4 6 20 27 16 24 29 8 33 26 33 27 17 39 5 33 34 41 4 16 24 19 42 8 29 48 48 27 37 24 43 13 4 28 38 27 38 23 29 55 14 62 26 9 62 20 35 31 57 74 69 5 26 60 33 59 5 19 21 45 15 87 3 54 17 2 57 36 18 67 25 62 47 53 89 27 5 59 75 77 29 9 ...
output:
Yes 1 2 4 89 552 13736 18205 44148 3 5 7 12 25 28 720 7551 56126 150925 158751 6 34 50 3594 5623 18042 39952 147309 8 14 70 108 260 18908 22540 197288 9 13 681 746 784 1532 3944 4960 15809 10 7391 9787 45366 11 87 152 185 194 203 218 318 1012 1038 1489 3784 34754 158134 185481 15 31 46 772 820 866 1...
result:
ok Correct!
Test #20:
score: 50
Accepted
time: 568ms
memory: 19244kb
input:
10 199738 1 1 2 1 5 4 6 6 2 8 7 1 5 13 11 9 7 13 3 8 7 14 8 24 17 12 1 11 20 28 4 20 17 12 6 15 32 36 19 11 25 37 26 43 4 37 22 5 18 10 46 51 41 20 23 52 7 28 49 49 27 62 25 7 17 55 59 27 19 1 32 51 9 54 4 24 13 26 7 78 11 40 30 63 31 8 71 61 24 26 57 35 36 76 49 4 89 51 48 100 72 100 58 3 59 66 36 ...
output:
Yes 1 3 9 296 520 699 1294 1364 5415 23771 2 6 31 45 75 96 125 3512 20860 30012 48028 185413 4 5 11 17 21 57 64 79 137 768 2341 5598 22840 43670 56069 7 10 20 23 86 273 385 422 435 538 23708 33410 42491 51389 62647 87633 104244 8 26 34 871 5781 37673 44557 63040 134319 174436 12 14 18 77 746 2327 34...
result:
ok Correct!
Test #21:
score: 50
Accepted
time: 558ms
memory: 19136kb
input:
10 199701 1 1 3 2 5 6 6 1 1 5 7 10 13 12 1 12 5 16 10 19 16 6 21 20 21 17 18 26 8 17 13 18 9 34 32 1 24 10 35 15 26 31 37 42 1 19 22 40 32 3 16 48 19 11 47 17 31 24 27 54 20 7 55 9 24 4 24 25 21 12 65 62 38 11 50 13 43 69 53 54 78 61 80 19 6 9 55 77 60 26 42 19 16 60 32 94 25 39 29 57 4 93 56 56 86 ...
output:
Yes 1 4 39551 57892 2 3 5 6 11 62 500 990 1912 2322 12723 26754 32964 7 29 570 1153 8933 40550 47187 71880 84814 134685 194923 8 33 64 86 168 9141 19263 29746 98854 179296 9 12 19 38 574 2309 8245 18379 10 13 460 545 604 992 54894 14 40 786 941 1270 1350 2655 4542 8149 31841 70412 72850 112450 15 18...
result:
ok Correct!
Test #22:
score: 50
Accepted
time: 275ms
memory: 19256kb
input:
10 199753 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 10...
output:
Yes 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 101 ...
result:
ok Correct!
Test #23:
score: 50
Accepted
time: 278ms
memory: 19180kb
input:
10 199750 1 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 ...
output:
Yes 1 3 2 5 4 7 6 9 8 11 10 13 12 15 14 17 16 19 18 21 20 23 22 25 24 27 26 29 28 31 30 33 32 35 34 37 36 39 38 41 40 43 42 45 44 47 46 49 48 51 50 53 52 55 54 57 56 59 58 61 60 63 62 65 64 67 66 69 68 71 70 73 72 75 74 77 76 79 78 81 80 83 82 85 84 87 86 89 88 91 90 93 92 95 94 97 96 99 98 101 100 ...
result:
ok Correct!
Test #24:
score: 50
Accepted
time: 558ms
memory: 19132kb
input:
10 200000 1 2 2 2 5 3 6 2 9 1 9 5 6 1 15 12 9 15 9 19 7 14 16 23 7 16 6 14 17 20 24 8 32 6 14 11 15 30 4 38 17 37 24 11 27 2 27 17 19 32 36 25 31 26 35 1 10 31 46 17 4 39 28 3 49 22 24 47 33 4 28 26 20 74 67 73 57 33 23 62 73 14 16 67 37 83 8 4 51 2 2 81 88 27 28 11 49 45 25 31 37 77 83 99 8 44 63 3...
output:
Yes 1 2 6 64 396 3487 4999 8177 31044 81115 143734 3 39 61 70 88 159 839 2172 9567 21112 32886 110967 120113 4 5 21 25 128 455 502 1607 5006 7883 8639 16541 59320 94450 101292 120837 129956 7 32 87 105 150 845 1514 1933 5549 12812 15729 21718 36395 8 9 57 376 410 2025 2698 5943 12799 33779 38795 490...
result:
ok Correct!
Test #25:
score: 50
Accepted
time: 599ms
memory: 19184kb
input:
10 199804 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 4 3 6 2 5 1 5 6 2 7 1 12 12 14 16 16 3 10 7 16 5 25 17 20 5 13 15 6 7 7 21 9 18 26 8 26 6 22 34 25 24 21 9 16 3 13 48 42 41 50 43 26 17 12 53 57 43 56 60 63 42 29 63 20 40 7 6 65 66 64 36 25 72 49 14 27 37 32 59 61 9 85 31 70 21 2 54 12 50 31 7...
output:
Yes 1 22 23 27 32 109 403 548 1928 2352 3241 4146 13794 15835 16840 32500 37408 2 25 40 68 228 622 848 1120 1889 2421 6512 13796 48187 131508 167673 3 24 3691 4692 170658 4 28 30 44 48 196 341 368 485 1071 1318 9920 5 26 31 51 60 90 507 6315 32150 37485 149483 6 33 42 52 53 89 1554 3460 5356 8790 10...
result:
ok Correct!
Test #26:
score: 50
Accepted
time: 587ms
memory: 19244kb
input:
10 199826 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 2 3 6 5 4 1 10 9 7 7 3 6 4 5 7 10 6 7 5 6 3 20 22 11 11 27 27 21 17 5 32 17 26 10 4 29 29 11 24 14 27 32 11 43 36 21 22 13 28 43 33 17 51 7 15 30 37 38 8 28 61 4 38 65 65 4 23 22 35 4 8 1 43 75 39 12 38 73 50 42 71 80 82 69 88 9 44 84 12 49 83 ...
output:
Yes 1 22 24 131 142 246 312 409 946 2130 4502 56304 163442 175827 2 23 25 34 44 208 273 410 794 1148 3181 3187 6701 10084 12729 172281 3 28 36 58 85 89 93 227 322 1165 6352 95927 103464 144016 160812 170423 4 27 37 42 53 375 1652 3454 11003 16351 5 26 35 40 43 152 175 320 373 714 723 771 6825 7798 5...
result:
ok Correct!
Test #27:
score: 50
Accepted
time: 577ms
memory: 19284kb
input:
10 199955 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 4 1 6 7 1 8 8 1 7 12 10 8 9 13 5 3 19 18 8 15 24 5 5 14 23 13 14 6 29 28 12 13 3 7...
output:
Yes 1 178 396 726 851 1641 11267 47823 169187 2 104 120 137 139 210 229 273 638 712 3091 11003 19184 81195 3 105 141 156 158 183 222 275 2068 2870 16885 19565 45651 51220 77313 4 119 126 127 143 443 684 798 2326 12341 14207 19744 27441 45910 54797 5 107 132 430 1594 3354 9709 12108 13731 14229 42388...
result:
ok Correct!
Test #28:
score: 50
Accepted
time: 532ms
memory: 19288kb
input:
10 199833 1 1 1 1 9 5 4 7 2 6 7 2 12 2 4 7 6 4 6 19 18 2 8 6 18 22 21 7 25 18 22 24 24 29 1 3 10 18 28 26 33 3 25 42 17 37 31 14 26 39 18 25 35 6 21 4 5 37 34 56 25 7 26 25 17 22 31 42 54 6 17 35 13 34 15 1 35 37 43 19 50 70 59 70 34 45 63 37 29 4 82 52 35 8 4 10 45 33 40 40 58 23 73 74 86 3 54 55 4...
output:
No Yes 1 2 9 11 23 38 1382 1491 2404 3807 13082 18073 24434 40158 44074 62830 64000 79647 3 5 6 15 143 517 937 4642 37959 120602 151980 4 121 1709 5808 11227 30228 40240 44839 54803 105388 133678 7 10 12 13 14 32 93 276 2957 5774 11046 101136 135099 143955 8 22 107 309 2246 2903 9296 66435 82931 157...
result:
ok Correct!