QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#696080 | #2009. 树上的数 | hos_lyric | 100 ✓ | 381ms | 4408kb | C++14 | 3.8kb | 2024-10-31 21:29:37 | 2024-10-31 21:29:37 |
Judging History
answer
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")
vector<int> uf;
int root(int u) {
return (uf[u] < 0) ? u : (uf[u] = root(uf[u]));
}
bool connect(int u, int v) {
u = root(u);
v = root(v);
if (u == v) return false;
if (uf[u] > uf[v]) swap(u, v);
uf[u] += uf[v];
uf[v] = u;
return true;
}
/*
determined by operation order around u
condition for path s i[0] u[1] i[1] ... i[d-2] u[d-1] i[d-1] t
s: (first ->) i[0]
u[1]: i[0] -> i[1]
...
u[d-1]: i[d-2] -> i[d-1]
t: i[d-1] (-> last)
*/
int N;
vector<int> U;
vector<int> A, B;
int M;
int ver(int u) { return ((N - 1) << 1) + u; }
vector<int> as, bs;
vector<vector<int>> G;
vector<int> to, fr;
bool check(int u, int i, int j) {
// cerr<<"[check] "<<u<<" "<<i<<" "<<j<<endl;
if (~to[i]) return false;
if (~fr[j]) return false;
if (root(i) == root(j) && -uf[root(i)] != 1 + (int)G[u].size()) return false;
return true;
}
void add(int u, int i, int j) {
to[i] = j;
fr[j] = i;
connect(i, j);
}
vector<int> pari;
int dfs(int u, int i) {
int ret = N;
if (check(u, i, ver(u))) {
chmin(ret, u);
}
for (const int j : G[u]) if (i != j) {
const int v = (!(j & 1)) ? B[j >> 1] : A[j >> 1];
pari[v] = j;
if (check(u, i, j)) {
const int res = dfs(v, j ^ 1);
chmin(ret, res);
}
}
return ret;
}
int main() {
for (int numCases; ~scanf("%d", &numCases); ) { for (int caseId = 1; caseId <= numCases; ++caseId) {
scanf("%d", &N);
U.resize(N);
for (int x = 0; x < N; ++x) {
scanf("%d", &U[x]);
--U[x];
}
A.resize(N - 1);
B.resize(N - 1);
for (int i = 0; i < N - 1; ++i) {
scanf("%d%d", &A[i], &B[i]);
--A[i];
--B[i];
}
M = ((N - 1) << 1) + N;
G.assign(N, {});
for (int i = 0; i < N - 1; ++i) {
G[A[i]].push_back(i << 1 | 0);
G[B[i]].push_back(i << 1 | 1);
}
uf.assign(M, -1);
to.assign(M, -1);
fr.assign(M, -1);
vector<int> ans(N, -1);
pari.assign(N, -1);
for (int x = 0; x < N; ++x) {
// U[x] -> ans[x]
ans[x] = dfs(U[x], ver(U[x]));
// cerr<<"ans = "<<ans<<endl;
assert(ans[x] < N);
int j = ver(ans[x]);
for (int v = ans[x]; v != U[x]; ) {
const int i = pari[v];
add(v, i ^ 1, j);
v = (!(i & 1)) ? A[i >> 1] : B[i >> 1];
j = i;
}
add(U[x], ver(U[x]), j);
}
for (int x = 0; x < N; ++x) {
if (x) printf(" ");
printf("%d", ans[x] + 1);
}
puts("");
}
#ifndef LOCAL
break;
#endif
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Final Tests
Test #1:
score: 5
Accepted
time: 1ms
memory: 3768kb
input:
10 10 6 2 7 8 5 10 9 1 4 3 7 4 5 7 2 4 3 4 10 5 8 10 1 5 9 10 6 8 10 2 8 1 9 6 7 5 4 10 3 6 7 2 7 5 6 3 7 1 5 9 7 10 9 8 1 4 9 10 1 3 8 2 6 9 4 5 7 10 1 4 3 1 9 3 7 9 6 7 8 9 10 3 5 7 2 7 10 8 4 10 3 1 5 6 7 9 2 6 9 2 6 5 6 7 5 3 2 1 7 4 5 8 9 10 7 10 3 8 2 10 7 6 4 9 1 5 6 1 10 1 5 1 7 5 4 1 2 1 8 ...
output:
1 3 2 6 7 8 10 5 9 4 1 5 8 2 3 4 6 10 9 7 2 4 9 5 7 10 1 6 8 3 1 2 5 6 7 4 9 10 8 3 1 2 9 4 5 7 6 3 10 8 1 2 3 5 7 10 8 9 4 6 1 2 4 5 8 3 9 6 10 7 1 2 4 3 5 7 6 9 10 8 1 2 4 10 3 9 5 6 7 8 1 5 3 2 7 6 4 9 8 10
result:
ok 100 tokens
Test #2:
score: 5
Accepted
time: 0ms
memory: 3800kb
input:
10 10 2 3 10 9 8 1 4 7 6 5 9 7 6 7 2 6 8 6 1 2 3 7 5 2 10 9 4 9 10 10 4 3 9 7 8 2 1 5 6 6 8 3 6 10 8 7 3 5 8 9 5 2 7 4 7 1 8 10 2 10 3 6 7 5 9 8 4 1 1 2 3 1 7 2 10 2 5 10 9 1 4 2 8 5 6 5 10 4 1 7 3 9 2 6 10 5 8 3 1 9 3 5 9 7 3 2 1 10 2 6 1 8 9 4 7 10 5 7 8 10 1 9 6 3 2 4 4 1 6 1 9 1 5 4 10 4 7 6 3 1...
output:
1 2 3 4 6 5 10 9 7 8 1 2 4 3 6 5 7 8 9 10 1 2 4 5 6 8 3 10 7 9 1 2 4 5 7 10 3 6 8 9 1 2 9 3 6 4 7 5 8 10 2 3 1 4 10 8 5 6 9 7 1 2 4 5 9 3 10 6 8 7 1 4 2 5 10 6 7 9 3 8 1 2 3 6 5 7 9 4 8 10 2 1 3 4 9 8 10 6 7 5
result:
ok 100 tokens
Test #3:
score: 5
Accepted
time: 2ms
memory: 3824kb
input:
10 160 87 10 152 84 150 132 51 136 109 77 33 128 97 98 82 21 26 148 146 121 112 81 92 13 19 45 15 68 155 114 138 35 94 61 22 83 75 78 154 49 48 70 126 137 93 23 29 159 3 108 88 69 62 104 158 124 120 1 147 27 157 79 145 107 105 140 113 95 102 41 141 36 119 30 153 90 16 80 31 103 14 66 43 20 47 39 76 ...
output:
1 2 16 40 3 4 5 7 45 19 63 79 73 144 18 127 6 10 108 15 66 41 120 88 35 55 104 12 21 67 123 111 153 81 135 57 42 100 110 117 17 56 72 43 119 52 26 82 60 34 145 58 157 133 159 13 38 106 83 112 22 109 28 24 97 139 151 124 54 20 30 101 8 107 138 99 118 146 103 142 92 78 59 36 27 9 91 32 39 50 155 84 47...
result:
ok 1565 tokens
Test #4:
score: 5
Accepted
time: 2ms
memory: 3828kb
input:
10 160 62 23 10 93 138 70 66 33 111 98 28 125 53 104 114 57 43 84 82 149 157 88 87 21 115 75 58 47 144 153 135 110 65 113 15 39 156 59 11 78 148 152 52 41 63 159 130 61 68 2 74 34 90 145 122 151 120 60 20 102 44 126 71 35 133 79 27 55 146 81 31 64 134 73 94 160 12 85 42 124 154 127 30 101 45 7 24 48...
output:
1 2 3 10 15 4 88 19 36 51 137 5 108 74 39 64 160 50 54 8 21 119 139 49 153 93 26 31 56 143 120 47 20 126 18 97 117 52 124 96 110 11 41 72 103 92 136 42 48 70 140 57 69 37 46 128 17 38 121 109 145 24 80 122 59 98 67 40 34 144 33 113 84 101 43 150 134 77 100 123 63 71 9 158 44 14 118 25 95 12 132 125 ...
result:
ok 1565 tokens
Test #5:
score: 5
Accepted
time: 194ms
memory: 4172kb
input:
10 2000 280 867 1111 895 1600 1529 1353 331 631 858 1618 291 1396 1871 57 1514 1855 661 1062 580 1258 1561 982 1082 595 181 137 1728 505 1097 329 220 160 1872 1244 625 1840 550 264 275 748 1347 640 693 223 1914 1929 479 418 1332 766 256 1781 569 344 728 929 1556 1481 1311 1257 455 545 1415 1151 1096...
output:
1 25 135 1831 421 1112 854 870 1347 37 957 1706 1431 19 1190 708 272 1549 253 622 111 1871 1221 1300 1720 811 600 1948 1882 1497 70 1364 1836 1127 1119 453 740 824 1377 1214 124 1202 42 41 81 1605 1685 1832 487 1827 1067 859 1338 484 147 1280 1718 1315 98 624 990 1910 569 362 1494 1375 529 809 1348 ...
result:
ok 19965 tokens
Test #6:
score: 5
Accepted
time: 194ms
memory: 4200kb
input:
10 2000 1816 1366 1220 1118 452 1937 1395 1976 1944 82 567 296 1845 1993 1556 141 1959 1805 647 1710 1423 1553 63 1673 1285 1137 103 223 958 1215 606 1478 854 1272 48 404 1969 1399 351 34 1731 821 1460 1054 723 1335 1684 1353 1425 1077 1668 491 1448 1512 280 1470 1340 742 1027 1473 1794 982 608 462 ...
output:
1 4 1096 1797 1421 542 490 3 763 168 1401 10 225 425 240 138 864 82 16 1747 668 392 28 87 1610 1382 572 839 195 342 1771 130 110 390 1752 757 1331 139 933 1033 1476 1832 1408 1241 885 898 30 851 1210 365 70 13 334 1984 141 326 1237 1444 121 261 497 1130 1601 826 1739 174 129 860 1405 315 1505 896 32...
result:
ok 19965 tokens
Test #7:
score: 5
Accepted
time: 190ms
memory: 4168kb
input:
10 2000 1006 640 240 1875 89 903 661 1812 649 223 396 394 1434 519 1593 1246 1777 189 1639 1417 245 1687 1728 1145 593 465 928 845 1902 532 856 700 1224 1736 619 857 321 749 38 1011 239 1611 261 1715 1412 883 605 548 388 1990 1855 121 967 1091 847 207 286 1633 10 1473 1849 1148 835 1618 1393 965 107...
output:
1 519 1702 177 1885 1213 1276 8 321 1372 1496 784 5 626 3 883 74 7 10 146 869 30 1193 742 73 482 13 1865 42 11 159 163 406 287 157 1584 1514 1305 194 41 1695 72 1447 567 1601 1555 810 189 1272 1019 1232 1815 1133 1905 937 48 1303 18 109 779 1451 1675 1099 198 1600 1661 935 1296 1077 1638 704 44 1418...
result:
ok 19965 tokens
Test #8:
score: 5
Accepted
time: 3ms
memory: 3840kb
input:
10 160 4 123 140 79 137 132 122 6 59 124 76 73 115 39 55 77 26 114 151 45 86 91 154 89 85 109 62 41 138 50 82 158 126 148 108 116 99 25 14 38 66 141 78 139 29 88 64 80 98 105 56 83 106 15 21 136 31 28 10 46 159 127 110 153 18 43 11 54 42 160 57 48 17 30 33 49 5 101 51 95 53 84 111 112 7 87 96 104 65...
output:
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 40 39 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 102 ...
result:
ok 1600 tokens
Test #9:
score: 5
Accepted
time: 3ms
memory: 3908kb
input:
10 160 114 104 79 52 122 37 81 151 117 13 128 83 106 146 69 82 94 76 123 102 139 51 44 22 23 54 86 135 6 43 88 32 67 28 27 153 33 26 42 98 7 113 156 17 73 105 1 20 103 38 152 18 57 59 119 108 10 29 15 2 41 78 127 53 46 134 64 160 90 125 47 39 111 115 16 141 40 65 112 121 149 126 155 138 148 75 74 4 ...
output:
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 33 32 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 102 ...
result:
ok 1600 tokens
Test #10:
score: 5
Accepted
time: 377ms
memory: 4092kb
input:
10 2000 1069 519 700 955 1013 104 1328 812 192 1577 1313 1881 1863 984 1183 1479 1236 1618 1300 621 1773 96 1351 1632 489 1270 1999 1875 326 1129 1348 1135 1436 954 1215 1352 601 447 1627 1717 207 299 199 1736 1958 986 445 409 1041 226 850 749 1928 1742 1250 1220 828 1376 1740 513 518 818 227 742 11...
output:
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 102 ...
result:
ok 20000 tokens
Test #11:
score: 5
Accepted
time: 376ms
memory: 4368kb
input:
10 2000 172 1977 199 1507 339 767 484 1156 1541 200 939 1526 979 572 1315 1028 1826 744 1630 387 1503 355 741 592 680 1972 15 209 1546 1821 1976 1177 1612 1393 1484 1093 883 1154 208 601 843 1208 25 269 1007 583 287 1052 1242 1617 1380 839 261 1422 1271 1616 300 1897 1254 135 1590 1215 379 1895 715 ...
output:
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 102 ...
result:
ok 20000 tokens
Test #12:
score: 5
Accepted
time: 381ms
memory: 4408kb
input:
10 2000 449 529 646 257 1368 1819 19 1238 680 1320 287 621 692 1036 1895 1003 626 497 432 1962 130 143 1044 628 1798 255 980 503 761 962 745 308 1578 958 330 247 670 1050 1300 1795 121 1516 406 1084 1850 263 1376 596 1499 1921 12 704 1429 950 1287 789 1152 475 1575 1027 1574 611 1939 570 527 391 143...
output:
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 102 ...
result:
ok 20000 tokens
Test #13:
score: 5
Accepted
time: 0ms
memory: 3832kb
input:
10 160 95 93 74 42 94 113 109 152 141 28 34 45 89 158 18 86 121 119 39 63 155 132 6 24 20 50 108 19 61 122 124 111 22 78 21 11 157 53 116 130 71 54 112 80 118 76 138 149 88 154 126 9 125 142 143 13 129 145 103 16 27 73 26 77 115 144 44 7 107 147 92 117 65 134 114 41 96 64 105 59 46 10 12 67 49 69 51...
output:
1 2 141 81 3 21 90 6 111 76 8 119 53 35 4 28 9 121 120 5 125 115 13 18 30 24 48 110 10 26 159 154 136 153 94 155 23 83 101 71 16 14 109 86 100 15 70 12 50 56 51 150 127 52 41 58 112 146 61 135 39 29 37 31 47 133 158 92 36 132 74 55 60 7 32 79 73 122 57 87 34 89 65 106 143 62 22 108 38 105 68 123 145...
result:
ok 1600 tokens
Test #14:
score: 5
Accepted
time: 1ms
memory: 3824kb
input:
10 160 72 114 57 37 84 89 23 71 95 1 59 43 85 83 159 74 147 121 143 119 151 93 120 145 42 111 36 123 146 135 70 60 20 127 35 53 7 139 22 54 16 17 28 126 2 49 157 10 41 31 24 9 55 65 94 39 81 160 90 122 80 125 82 118 30 32 103 131 136 96 150 154 3 67 113 27 107 134 132 14 11 140 78 69 73 4 77 45 110 ...
output:
1 2 133 54 66 129 150 22 152 3 56 149 91 69 65 148 81 26 153 9 146 107 23 108 46 39 57 17 119 43 34 14 128 30 131 106 52 20 70 120 124 41 132 95 154 101 134 33 140 77 102 138 130 48 117 147 64 15 99 32 58 42 78 141 13 8 127 137 55 24 115 118 5 37 88 113 139 94 4 10 87 82 105 28 25 100 160 6 74 59 15...
result:
ok 1600 tokens
Test #15:
score: 5
Accepted
time: 1ms
memory: 3824kb
input:
10 160 115 48 83 103 76 109 37 116 35 77 55 102 3 2 81 137 54 19 129 1 93 75 12 6 106 130 58 108 131 122 42 15 40 32 9 150 118 158 146 60 159 120 89 29 18 104 45 88 66 7 127 133 124 96 28 74 52 113 57 70 91 123 22 24 141 85 107 82 126 142 135 97 49 156 44 90 61 34 160 128 132 41 121 65 138 147 68 14...
output:
1 3 2 47 6 11 104 4 53 139 40 87 29 18 20 21 8 38 14 106 64 9 65 42 159 108 15 49 50 36 129 138 70 156 34 77 147 128 89 119 58 24 26 158 154 103 78 84 68 17 118 13 81 116 122 57 44 155 75 85 132 56 134 111 135 48 5 127 41 46 153 62 107 7 137 149 120 126 45 110 150 54 112 143 69 80 43 88 91 105 142 8...
result:
ok 1600 tokens
Test #16:
score: 5
Accepted
time: 0ms
memory: 4120kb
input:
10 160 145 113 85 36 71 90 133 11 128 98 48 23 149 34 38 134 30 88 41 119 124 103 156 137 47 84 53 6 76 146 123 16 73 10 141 37 12 69 35 57 42 93 8 51 78 49 3 159 116 63 21 65 157 112 60 138 126 106 115 29 31 121 62 72 139 91 125 5 18 97 131 39 111 40 26 43 80 66 27 155 83 79 1 64 147 87 74 117 55 1...
output:
1 61 2 18 25 12 83 3 88 132 63 19 22 65 79 51 5 139 31 118 34 87 54 92 29 73 14 146 68 7 147 48 16 93 95 10 78 144 40 97 75 117 59 142 153 6 60 37 56 20 64 121 70 76 33 27 91 41 11 67 114 96 123 66 158 145 42 151 44 155 58 105 45 85 152 128 137 107 82 8 55 36 138 39 49 154 129 120 81 57 84 86 100 43...
result:
ok 1600 tokens
Test #17:
score: 5
Accepted
time: 81ms
memory: 4156kb
input:
10 2000 543 1512 275 1560 115 422 829 1825 1661 989 1040 446 1587 772 340 1265 606 511 1008 913 366 1272 486 287 760 1549 852 259 1463 258 1783 687 822 1239 632 1439 837 1500 1573 1853 1176 895 625 826 334 836 428 1721 1318 923 656 220 1289 633 1805 1300 1868 1053 1774 490 507 67 1894 614 145 1967 1...
output:
1 1918 2 6 1099 1558 1130 34 1936 1713 1242 8 305 325 13 9 45 14 41 1226 1719 1500 1238 12 1213 572 358 604 81 1458 443 17 919 44 981 1229 1948 371 76 93 1618 647 340 1681 1137 1140 518 1210 204 56 1507 645 3 1998 1400 809 75 142 126 1236 383 878 67 1733 1648 1488 92 1991 270 694 495 1421 721 1121 6...
result:
ok 20000 tokens
Test #18:
score: 5
Accepted
time: 82ms
memory: 4196kb
input:
10 2000 643 798 1692 1036 71 1697 756 12 1275 591 509 516 1638 867 151 664 83 1558 828 764 281 1259 631 1081 780 1497 651 567 728 379 1057 300 297 1480 1190 234 1159 893 939 1713 1101 1662 982 561 1842 1448 748 931 918 1596 476 615 705 274 1914 517 172 1973 888 1658 396 8 44 1845 411 1332 446 1549 9...
output:
1 3 8 802 9 2 228 14 32 517 1108 131 68 477 1424 6 43 416 501 113 1038 1886 46 826 1526 243 635 536 1846 1751 579 1943 576 1430 90 527 130 1047 1001 686 1189 1376 187 621 142 1676 1868 137 1966 1288 1058 1494 459 1235 394 1799 1812 54 1805 252 1899 12 544 273 1876 1455 156 1188 1146 453 63 1650 748 ...
result:
ok 20000 tokens
Test #19:
score: 5
Accepted
time: 81ms
memory: 4216kb
input:
10 2000 1182 760 1167 896 770 1625 234 193 718 487 1416 1714 40 1814 47 1646 1058 755 672 1156 1191 1514 1479 1306 252 1045 1216 666 681 1542 25 23 1844 149 1744 328 1494 1566 597 1150 1225 796 14 879 1478 423 1074 615 344 1923 1599 1103 1715 1005 1152 789 476 1826 720 283 1665 1830 650 1154 1078 19...
output:
1 2 3 4 5 12 17 1771 1260 1746 485 1739 1079 6 147 19 1143 81 202 940 37 1410 1709 82 222 1534 197 1485 349 35 72 1528 321 291 48 1122 231 9 1178 422 688 1500 355 907 1382 817 53 786 18 1741 210 454 44 782 396 78 1104 24 1201 1716 385 666 43 1092 985 240 330 1657 1076 1902 1908 1694 1660 642 55 237 ...
result:
ok 20000 tokens
Test #20:
score: 5
Accepted
time: 82ms
memory: 4196kb
input:
10 2000 901 437 1497 1505 644 62 1823 1545 175 513 1737 1677 621 101 1850 1844 746 1928 233 1417 1150 781 443 1129 1818 396 935 260 1463 371 677 1058 1159 346 834 1223 1580 1804 1444 1824 749 1613 237 143 1065 863 1602 1846 1175 1224 1766 1660 1597 424 1743 573 494 1012 1622 161 1370 329 1215 1732 1...
output:
1 2 1641 3 1492 1472 7 35 663 210 325 1941 523 579 10 928 595 1771 587 500 1373 66 1623 1716 286 17 337 202 1083 466 1943 651 27 297 38 1097 1155 96 1978 1802 31 43 39 13 1648 1015 1339 883 1777 1807 675 1172 126 1533 1640 208 1740 1095 1336 967 750 245 1666 44 1469 90 149 143 148 1537 1210 1262 371...
result:
ok 20000 tokens
Extra Test:
score: 0
Extra Test Passed