QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#424874 | #7278. Brought Down the Grading Server? | 5ab | 35 | 108ms | 26512kb | C++20 | 2.9kb | 2024-05-29 19:22:10 | 2024-05-29 19:22:13 |
Judging History
answer
/* name: 7278
* author: 5ab
* created at: 2024-05-29
*/
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define ssz(x) (int((x).size()))
auto chmax = [](auto& x, auto y) { if (x < y) x = y; };
auto chmin = [](auto& x, auto y) { if (y < x) x = y; };
using ll = long long;
const int N = 1e5, NS = 5e5;
vector<int> a[N], b[N], c[N];
int hd[N * 2], des[NS * 2], nxt[NS * 2], deg[N * 2], ec = 0;
bool inst[N * 2], vis[NS];
void add(int s, int t)
{
// cerr << s << " --> " << t << endl;
des[ec] = t, deg[s]++;
nxt[ec] = hd[s];
hd[s] = ec++;
}
int n, t;
vector<int> stk;
void dfs(int id)
{
stk = { id };
auto sv = [&](int x, int y)
{
if (x >= n)
{
// cerr << "b " << y << " " << x - n << endl;
b[y].push_back(x - n);
}
else
{
// cerr << "c " << x << " " << y - n << endl;
c[x].push_back(y - n);
}
};
// cerr << "start ";
while (true)
{
int p = hd[id];
// cerr << id << " ";
while (p != -1 && vis[p >> 1]) p = nxt[p];
if (p == -1)
{
for (int j = 1; j < ssz(stk); j++)
sv(stk[j - 1], stk[j]);
for (int x : stk)
inst[x] = 0;
return;
}
int dst = des[p];
deg[id]--, deg[dst]--, vis[p >> 1] = 1;
stk.push_back(dst);
if (inst[dst])
{
do {
int x = stk.back();
stk.pop_back(), inst[x] = 0;
sv(stk.back(), x);
} while (stk.back() != dst);
}
inst[dst] = 1;
id = dst;
}
inst[id] = 0;
}
vector<int> ci;
void solve(int l, int r)
{
if (l == r)
return;
ci.clear();
for (int j = 0; j < n; j++)
ci.push_back(j), b[j].clear(), c[j].clear();
ec = 0;
for (int i = l; i <= r; i++)
for (int j = 0; j < n; j++)
{
add(j, n + a[j][i]);
add(n + a[j][i], j);
ci.push_back(n + a[j][i]);
}
fill(vis, vis + ec / 2, 0);
// for (int x : ci)
// cerr << x << ": " << deg[x] << endl;
for (int i : ci)
if (deg[i] & 1)
{
// cerr << "deg " << i << " " << deg[i] << endl;
dfs(i);
}
for (int i : ci)
if (hd[i] != -1)
dfs(i);
for (int x : ci)
hd[x] = -1;
int mid = (l + r) >> 1;
for (int i = 0; i < n; i++)
{
// cerr << i << " " << ssz(b[i]) << " " << ssz(c[i]) << endl;
assert(ssz(b[i]) == mid - l + 1), assert(ssz(c[i]) == r - mid);
for (int j = l; j <= mid; j++)
a[i][j] = b[i][j - l];
for (int j = mid + 1; j <= r; j++)
a[i][j] = c[i][j - mid - 1];
}
solve(l, mid), solve(mid + 1, r);
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int s;
cin >> n >> s >> t;
for (int i = 0; i < n; i++)
{
a[i].resize(s);
for (int j = 0; j < s; j++)
cin >> a[i][j], a[i][j]--;
}
fill(hd, hd + n + t, -1);
solve(0, s - 1);
for (int i = 0; i < n; i++)
for (int j = 0; j < s; j++)
cout << a[i][j] + 1 << " \n"[j == s - 1];
return 0;
}
// started coding at: 05-29 17:33:31
詳細信息
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 1ms
memory: 3724kb
input:
3 2 3 1 2 2 3 2 3
output:
1 2 3 2 2 3
result:
ok
Test #2:
score: 10
Accepted
time: 1ms
memory: 3728kb
input:
20 2 20 18 2 12 5 20 9 4 2 17 4 7 15 9 2 5 5 13 15 19 5 3 5 10 19 8 5 7 10 9 11 3 16 7 18 9 5 3 8 18 4
output:
18 2 12 5 9 20 4 2 17 4 7 15 2 9 5 5 15 13 19 5 5 3 10 19 5 8 7 10 9 11 3 16 18 7 5 9 8 3 4 18
result:
ok
Test #3:
score: 10
Accepted
time: 1ms
memory: 3728kb
input:
20 2 12 12 11 1 9 12 12 3 4 3 9 8 3 8 11 10 9 4 3 6 7 11 6 11 3 7 10 12 10 11 10 11 11 11 2 1 12 6 12 2 7
output:
11 12 1 9 12 12 4 3 3 9 8 3 11 8 9 10 3 4 7 6 6 11 3 11 7 10 10 12 10 11 11 11 11 2 12 1 12 6 2 7
result:
ok
Test #4:
score: 10
Accepted
time: 1ms
memory: 3652kb
input:
20 2 8 7 7 7 8 6 4 7 4 6 2 4 6 1 3 2 3 8 3 6 7 1 5 6 3 2 5 1 4 2 2 6 2 6 3 2 5 5 3 3 3
output:
7 7 8 7 4 6 7 4 2 6 6 4 1 3 3 2 3 8 7 6 1 5 6 3 5 2 4 1 2 2 2 6 6 3 5 2 3 5 3 3
result:
ok
Test #5:
score: 10
Accepted
time: 0ms
memory: 3708kb
input:
12 2 20 13 1 4 14 14 13 17 1 8 15 14 5 3 7 20 6 1 9 19 11 6 20 11 13
output:
13 1 4 14 14 13 1 17 8 15 14 5 3 7 20 6 1 9 11 19 6 20 13 11
result:
ok
Test #6:
score: 10
Accepted
time: 1ms
memory: 3712kb
input:
20 2 19 2 15 16 8 1 11 15 18 7 17 19 7 14 2 3 10 12 5 14 10 8 5 17 11 16 11 3 13 12 9 4 17 1 6 6 4 13 19 18 5
output:
15 2 16 8 1 11 18 15 7 17 19 7 2 14 10 3 5 12 14 10 8 5 17 11 11 16 3 13 12 9 17 4 6 1 4 6 13 19 5 18
result:
ok
Test #7:
score: 10
Accepted
time: 1ms
memory: 3728kb
input:
18 2 18 12 15 7 18 12 13 9 14 8 5 5 3 4 1 10 9 17 7 4 2 10 14 16 6 1 2 16 11 3 8 15 13 17 18 11 6
output:
12 15 7 18 13 12 9 14 8 5 5 3 4 1 10 9 17 7 2 4 14 10 16 6 1 2 11 16 3 8 15 13 18 17 6 11
result:
ok
Subtask #2:
score: 0
Time Limit Exceeded
Test #8:
score: 15
Accepted
time: 93ms
memory: 25932kb
input:
100000 2 100000 70318 14894 32116 90327 63866 29061 53683 63612 70370 78264 42647 76881 39251 31741 61186 66491 57686 65819 53278 59145 71962 26052 81040 55279 50859 51310 46800 24546 85013 91165 61530 21890 84003 29099 33573 86182 49212 10639 91851 97312 57682 14067 5243 69674 99007 62508 26290 555...
output:
70318 14894 90327 32116 63866 29061 63612 53683 70370 78264 42647 76881 31741 39251 66491 61186 65819 57686 53278 59145 26052 71962 81040 55279 51310 50859 24546 46800 85013 91165 21890 61530 84003 29099 86182 33573 49212 10639 97312 91851 14067 57682 69674 5243 62508 99007 26290 55524 15519 43794 5...
result:
ok
Test #9:
score: 15
Accepted
time: 29ms
memory: 26512kb
input:
100000 2 100000 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 5...
output:
2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53...
result:
ok
Test #10:
score: 15
Accepted
time: 31ms
memory: 26480kb
input:
99555 2 99555 2 1 3 2 3 4 4 5 6 5 7 6 7 8 8 9 10 9 11 10 11 12 12 13 14 13 15 14 15 16 16 17 18 17 19 18 19 20 20 21 22 21 23 22 23 24 24 25 26 25 27 26 27 28 28 29 30 29 31 30 31 32 32 33 34 33 35 34 35 36 36 37 38 37 39 38 39 40 40 41 42 41 43 42 43 44 44 45 46 45 47 46 47 48 48 49 50 49 51 50 51 ...
output:
2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53...
result:
ok
Test #11:
score: 0
Time Limit Exceeded
input:
98045 2 95001 27085 59126 75021 23663 67175 78883 3919 90698 20718 67504 49374 44011 1660 3236 71971 79270 24502 90540 54202 9732 14395 88659 56600 52635 21912 17986 92420 56526 40254 3472 64330 20431 9381 56003 57750 45529 45230 9388 83797 53437 75562 47526 63126 45219 71020 87437 50298 2016 21982 ...
output:
result:
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%
Subtask #5:
score: 15
Accepted
Test #56:
score: 15
Accepted
time: 1ms
memory: 3712kb
input:
3 4 3 2 3 2 2 2 3 3 2 2 2 3 2
output:
2 2 3 2 3 3 2 2 2 2 2 3
result:
ok
Test #57:
score: 15
Accepted
time: 0ms
memory: 4428kb
input:
2450 4 2450 540 475 1156 2334 2421 2439 1328 750 471 1051 2007 1792 1776 786 705 2269 1277 755 1674 1622 590 1378 1217 603 967 239 1658 1920 857 2307 1589 78 2172 861 2322 1634 2077 2021 1381 2179 1126 345 1547 2126 994 1214 1477 412 1857 2085 831 978 281 1844 2406 2174 521 2334 2254 1779 1508 905 1...
output:
540 475 1156 2334 2421 2439 750 1328 1792 471 2007 1051 1776 705 2269 786 1622 755 1674 1277 1217 1378 590 603 1658 967 1920 239 857 1589 78 2307 2322 861 1634 2172 2179 2021 2077 1381 1547 1126 2126 345 1477 994 1214 412 1857 978 831 2085 2174 281 1844 2406 2254 2334 521 1779 905 1903 284 1508 345 ...
result:
ok
Test #58:
score: 15
Accepted
time: 3ms
memory: 4344kb
input:
2499 4 2499 1 2 2 3 1429 1 1 1429 3 4 4 7 1430 3 3 1430 5 6 6 1 1431 5 5 1431 7 8 8 11 1432 7 7 1432 9 10 10 5 1433 9 9 1433 11 12 12 15 1434 11 11 1434 13 14 14 9 1435 13 13 1435 15 16 16 19 1436 15 15 1436 17 18 18 13 1437 17 17 1437 19 20 20 23 1438 19 19 1438 21 22 22 17 1439 21 21 1439 23 24 24...
output:
2 1 2 3 1 1429 1 1429 7 3 4 4 3 1430 3 1430 5 6 6 1 1431 5 5 1431 8 8 11 7 1432 7 7 1432 9 10 10 5 1433 9 9 1433 15 11 12 12 11 1434 1434 11 13 14 14 9 1435 13 13 1435 16 16 19 15 1436 15 15 1436 17 18 18 13 1437 17 17 1437 23 19 20 20 19 1438 1438 19 21 22 22 17 1439 21 21 1439 24 24 27 23 1440 23 ...
result:
ok
Test #59:
score: 15
Accepted
time: 0ms
memory: 4948kb
input:
5000 2 5000 3581 2773 462 1582 1171 208 74 4865 1018 10 1962 2532 578 1491 1140 4567 3640 4785 1051 3325 4545 2135 1152 286 309 4874 1953 3646 1794 234 1223 3529 3751 1002 3427 4740 4638 2554 933 1988 3177 1846 2440 2671 1315 3502 1382 2669 3145 443 438 2418 420 1154 671 3875 3152 1807 3618 1093 359...
output:
3581 2773 1582 462 208 1171 74 4865 1018 10 1962 2532 578 1491 4567 1140 3640 4785 1051 3325 4545 2135 286 1152 4874 309 1953 3646 1794 234 1223 3529 1002 3751 3427 4740 2554 4638 1988 933 1846 3177 2440 2671 3502 1315 2669 1382 3145 443 2418 438 1154 420 671 3875 1807 3152 1093 3618 359 3471 4738 3...
result:
ok
Test #60:
score: 15
Accepted
time: 3ms
memory: 4892kb
input:
4900 2 4900 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51...
output:
2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53...
result:
ok
Test #61:
score: 15
Accepted
time: 0ms
memory: 4896kb
input:
4900 2 4900 2 1 3 2 3 4 4 5 6 5 7 6 7 8 8 9 10 9 11 10 11 12 12 13 14 13 15 14 15 16 16 17 18 17 19 18 19 20 20 21 22 21 23 22 23 24 24 25 26 25 27 26 27 28 28 29 30 29 31 30 31 32 32 33 34 33 35 34 35 36 36 37 38 37 39 38 39 40 40 41 42 41 43 42 43 44 44 45 46 45 47 46 47 48 48 49 50 49 51 50 51 52...
output:
2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53...
result:
ok
Test #62:
score: 15
Accepted
time: 11ms
memory: 4024kb
input:
156 64 156 29 104 122 93 114 102 62 151 145 125 155 109 97 116 62 72 83 122 60 109 125 19 14 101 80 125 76 155 123 128 123 57 7 154 36 60 123 36 19 89 12 3 29 36 145 66 9 13 132 26 97 89 4 95 92 19 86 140 33 89 55 5 102 119 148 71 119 10 75 47 27 30 4 109 92 63 55 28 2 156 3 123 84 10 60 13 5 93 125...
output:
97 102 76 33 57 60 12 104 14 3 62 95 13 155 123 102 55 97 72 9 145 109 36 114 128 145 4 86 36 80 123 29 89 125 125 92 7 122 26 122 116 19 29 140 132 151 154 5 101 109 36 66 19 125 60 93 19 83 155 89 89 62 123 119 109 52 13 25 27 148 109 156 71 47 93 123 127 123 3 156 27 25 28 93 122 62 123 28 84 33 ...
result:
ok
Test #63:
score: 15
Accepted
time: 107ms
memory: 4016kb
input:
9 1024 9 1 6 8 8 4 1 1 5 8 6 8 4 6 6 1 6 6 1 4 4 5 1 6 6 8 6 4 1 1 1 5 8 6 4 1 6 4 8 6 4 1 1 8 1 6 6 8 1 8 8 1 4 1 8 6 5 1 1 6 8 6 4 4 5 1 5 1 8 6 8 8 1 8 5 5 6 1 8 4 6 8 1 1 8 8 1 4 8 6 4 4 8 1 8 1 8 1 1 1 1 8 8 6 4 6 1 1 5 8 4 1 6 5 8 1 6 1 6 4 1 6 5 4 8 4 5 4 6 1 8 6 8 1 4 1 8 6 1 4 1 4 1 5 8 8 1...
output:
5 4 6 8 5 6 5 6 8 1 5 6 6 1 6 5 4 5 1 6 4 1 8 8 1 8 1 4 1 1 6 6 8 6 4 8 4 4 5 8 6 8 8 6 8 1 4 5 1 1 6 8 5 8 6 6 1 8 1 8 8 8 8 8 1 4 6 8 1 4 1 1 6 4 1 6 8 1 6 8 6 8 8 4 4 4 1 8 1 1 1 6 8 1 1 1 6 1 4 6 1 1 8 4 4 4 6 6 1 8 6 1 1 8 6 1 8 6 1 6 1 1 1 4 8 1 1 1 8 8 1 4 1 4 1 6 1 6 8 6 4 8 5 6 1 1 1 6 1 8 ...
result:
ok
Test #64:
score: 15
Accepted
time: 25ms
memory: 4388kb
input:
2462 4 2401 595 1986 967 1326 19 173 880 2187 961 1645 843 1179 177 1102 1566 1225 1065 1553 961 354 1276 625 611 1814 1110 1097 572 845 780 2178 2041 1291 1531 415 1138 2390 1131 1649 499 584 752 1296 754 1982 2295 498 1627 1853 1647 1628 974 1282 265 2321 1271 2097 1161 123 2252 1776 439 723 487 4...
output:
595 1986 967 1326 19 173 2187 880 843 1645 1179 961 177 1566 1225 1102 1553 961 354 1065 611 1276 625 1814 1097 845 572 1110 780 1291 2178 2041 1138 1531 415 2390 1649 584 499 1131 1982 752 754 1296 2295 1853 1627 498 1628 1282 1647 974 265 2097 2321 1271 1776 1161 2252 123 723 424 487 439 1558 333 ...
result:
ok
Test #65:
score: 15
Accepted
time: 95ms
memory: 4728kb
input:
4990 2 3 1 2 2 2 1 2 2 2 2 1 1 1 1 2 2 1 2 1 1 1 2 2 1 1 2 2 2 2 2 2 1 2 1 1 2 1 2 1 1 1 2 1 1 1 2 2 1 2 2 1 2 2 1 1 2 2 1 1 1 2 2 2 1 2 1 1 2 1 1 1 2 2 1 2 2 1 2 1 2 2 2 1 2 2 1 1 2 1 1 2 1 2 2 1 1 2 1 2 1 1 2 2 1 2 2 1 1 1 2 2 1 2 1 2 2 2 2 2 1 2 2 1 1 2 1 1 1 1 2 1 1 1 1 2 1 2 2 1 1 2 2 2 1 2 2 2...
output:
1 2 2 2 2 1 2 2 1 2 1 1 1 2 1 2 1 2 1 1 2 2 1 1 2 2 2 2 2 2 2 1 1 1 1 2 1 2 1 1 1 2 1 1 2 2 1 2 1 2 2 2 1 1 2 2 1 1 2 1 2 2 1 2 1 1 1 2 1 1 2 2 2 1 1 2 1 2 2 2 1 2 2 2 1 1 1 2 1 2 2 1 1 2 1 2 2 1 1 1 2 2 1 2 1 2 1 1 2 2 2 1 1 2 2 2 2 2 2 1 1 2 1 2 1 1 1 1 1 2 1 1 2 1 1 2 1 2 2 1 2 2 1 2 2 2 1 2 1 2 ...
result:
ok
Test #66:
score: 15
Accepted
time: 47ms
memory: 4848kb
input:
5000 2 5000 2970 2674 1208 2674 4977 2674 2674 3028 2674 36 1712 2674 3561 2674 2674 3033 4699 2674 2674 1785 2674 4345 2674 3302 2493 2674 2674 4280 2674 3999 4850 2674 2674 4508 3742 2674 2674 2718 2674 3461 260 2674 2674 4223 2069 2674 2674 1144 1975 2674 527 2674 2674 3260 2806 2674 3636 2674 26...
output:
2970 2674 1208 2674 2674 4977 2674 3028 36 2674 2674 1712 2674 3561 3033 2674 2674 4699 1785 2674 4345 2674 3302 2674 2674 2493 4280 2674 3999 2674 2674 4850 4508 2674 2674 3742 2718 2674 3461 2674 2674 260 4223 2674 2069 2674 1144 2674 1975 2674 2674 527 3260 2674 2806 2674 2674 3636 1254 2674 1143...
result:
ok
Test #67:
score: 15
Accepted
time: 48ms
memory: 4372kb
input:
2450 4 2401 317 417 657 793 1237 1460 1990 507 1030 1744 1155 1114 486 868 1284 2376 2391 704 1441 665 173 1283 789 1607 1309 1045 1466 2192 734 766 284 254 1814 1752 1181 937 1459 1638 1329 2346 1155 1205 443 1744 430 1096 1050 1098 930 2224 1622 186 1772 1916 1833 2196 2066 739 114 757 1180 786 99...
output:
417 317 657 793 1237 1460 1990 507 1155 1744 1114 1030 1284 486 2376 868 2391 1441 665 704 1283 1607 789 173 1309 1466 1045 2192 284 766 254 734 1814 937 1181 1752 1459 1329 2346 1638 1205 1155 1744 443 430 1050 1096 1098 930 1622 186 2224 1772 2196 1833 1916 739 2066 757 114 786 277 996 1180 1508 2...
result:
ok
Test #68:
score: 15
Accepted
time: 4ms
memory: 4176kb
input:
1250 8 1000 580 788 926 830 833 861 67 795 768 582 227 113 421 701 823 566 188 868 745 494 910 981 644 76 572 751 409 665 210 771 875 742 131 442 387 298 3 151 455 145 550 78 74 694 250 672 85 118 857 807 977 695 431 855 944 533 523 881 432 789 742 787 649 615 159 29 942 894 619 538 114 42 834 480 6...
output:
788 67 830 580 926 861 833 795 768 823 582 701 421 227 566 113 981 188 76 745 644 868 494 910 409 572 875 210 742 751 665 771 145 298 151 442 3 131 387 455 78 250 85 550 74 118 672 694 977 533 431 807 857 944 855 695 432 649 789 523 615 742 881 787 538 29 894 42 942 619 114 159 210 834 355 558 614 4...
result:
ok
Test #69:
score: 15
Accepted
time: 0ms
memory: 4104kb
input:
1248 8 1248 161 598 1246 131 374 981 761 969 119 257 749 837 658 163 674 826 564 891 1166 207 863 733 802 929 233 964 311 507 202 314 77 400 376 1093 71 445 709 408 1247 388 1020 581 966 19 468 403 48 566 1201 785 822 946 479 132 730 703 349 861 731 188 37 1202 18 183 882 126 896 333 614 1226 648 52...
output:
374 1246 981 161 598 761 131 969 674 658 119 257 837 163 826 749 1166 802 207 564 863 733 891 929 507 202 311 233 77 964 400 314 408 445 71 376 1247 709 1093 388 966 468 403 1020 48 19 566 581 822 730 785 1201 946 132 479 703 183 731 1202 349 18 188 861 37 126 523 614 882 333 648 896 1226 363 956 11...
result:
ok
Subtask #6:
score: 5
Accepted
Dependency #5:
100%
Accepted
Test #70:
score: 5
Accepted
time: 1ms
memory: 3708kb
input:
3 4 3 2 3 2 2 2 3 3 2 2 2 3 2
output:
2 2 3 2 3 3 2 2 2 2 2 3
result:
ok
Test #71:
score: 5
Accepted
time: 0ms
memory: 4408kb
input:
2450 4 2450 540 475 1156 2334 2421 2439 1328 750 471 1051 2007 1792 1776 786 705 2269 1277 755 1674 1622 590 1378 1217 603 967 239 1658 1920 857 2307 1589 78 2172 861 2322 1634 2077 2021 1381 2179 1126 345 1547 2126 994 1214 1477 412 1857 2085 831 978 281 1844 2406 2174 521 2334 2254 1779 1508 905 1...
output:
540 475 1156 2334 2421 2439 750 1328 1792 471 2007 1051 1776 705 2269 786 1622 755 1674 1277 1217 1378 590 603 1658 967 1920 239 857 1589 78 2307 2322 861 1634 2172 2179 2021 2077 1381 1547 1126 2126 345 1477 994 1214 412 1857 978 831 2085 2174 281 1844 2406 2254 2334 521 1779 905 1903 284 1508 345 ...
result:
ok
Test #72:
score: 5
Accepted
time: 3ms
memory: 4492kb
input:
2499 4 2499 1 2 2 3 1429 1 1 1429 3 4 4 7 1430 3 3 1430 5 6 6 1 1431 5 5 1431 7 8 8 11 1432 7 7 1432 9 10 10 5 1433 9 9 1433 11 12 12 15 1434 11 11 1434 13 14 14 9 1435 13 13 1435 15 16 16 19 1436 15 15 1436 17 18 18 13 1437 17 17 1437 19 20 20 23 1438 19 19 1438 21 22 22 17 1439 21 21 1439 23 24 24...
output:
2 1 2 3 1 1429 1 1429 7 3 4 4 3 1430 3 1430 5 6 6 1 1431 5 5 1431 8 8 11 7 1432 7 7 1432 9 10 10 5 1433 9 9 1433 15 11 12 12 11 1434 1434 11 13 14 14 9 1435 13 13 1435 16 16 19 15 1436 15 15 1436 17 18 18 13 1437 17 17 1437 23 19 20 20 19 1438 1438 19 21 22 22 17 1439 21 21 1439 24 24 27 23 1440 23 ...
result:
ok
Test #73:
score: 5
Accepted
time: 0ms
memory: 4816kb
input:
5000 2 5000 3581 2773 462 1582 1171 208 74 4865 1018 10 1962 2532 578 1491 1140 4567 3640 4785 1051 3325 4545 2135 1152 286 309 4874 1953 3646 1794 234 1223 3529 3751 1002 3427 4740 4638 2554 933 1988 3177 1846 2440 2671 1315 3502 1382 2669 3145 443 438 2418 420 1154 671 3875 3152 1807 3618 1093 359...
output:
3581 2773 1582 462 208 1171 74 4865 1018 10 1962 2532 578 1491 4567 1140 3640 4785 1051 3325 4545 2135 286 1152 4874 309 1953 3646 1794 234 1223 3529 1002 3751 3427 4740 2554 4638 1988 933 1846 3177 2440 2671 3502 1315 2669 1382 3145 443 2418 438 1154 420 671 3875 1807 3152 1093 3618 359 3471 4738 3...
result:
ok
Test #74:
score: 5
Accepted
time: 3ms
memory: 4860kb
input:
4900 2 4900 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51...
output:
2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53...
result:
ok
Test #75:
score: 5
Accepted
time: 3ms
memory: 4808kb
input:
4900 2 4900 2 1 3 2 3 4 4 5 6 5 7 6 7 8 8 9 10 9 11 10 11 12 12 13 14 13 15 14 15 16 16 17 18 17 19 18 19 20 20 21 22 21 23 22 23 24 24 25 26 25 27 26 27 28 28 29 30 29 31 30 31 32 32 33 34 33 35 34 35 36 36 37 38 37 39 38 39 40 40 41 42 41 43 42 43 44 44 45 46 45 47 46 47 48 48 49 50 49 51 50 51 52...
output:
2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53...
result:
ok
Test #76:
score: 5
Accepted
time: 14ms
memory: 4020kb
input:
156 64 50 36 22 8 7 45 26 10 16 37 31 13 17 1 6 48 13 36 23 46 30 47 28 11 34 21 43 3 3 22 40 38 2 38 25 2 1 42 36 10 41 36 17 26 37 41 49 8 24 20 5 20 18 6 6 21 13 3 45 28 32 32 15 38 10 30 6 47 18 29 14 27 4 4 4 4 24 13 28 38 32 36 25 16 42 35 41 15 47 39 46 50 46 3 17 12 24 46 45 28 22 43 26 45 1...
output:
13 10 40 36 22 6 30 49 3 31 25 47 5 26 17 43 2 2 8 28 17 24 11 13 26 3 10 18 32 36 1 41 28 42 16 20 15 21 8 48 45 23 1 37 6 22 36 36 7 21 10 34 6 38 41 38 38 46 13 20 3 32 45 37 6 41 18 30 6 24 43 17 28 28 42 20 46 49 26 27 15 10 47 13 32 34 45 46 25 13 14 31 4 24 24 20 36 26 29 24 50 41 13 20 6 27 ...
result:
ok
Test #77:
score: 5
Accepted
time: 4ms
memory: 4372kb
input:
2500 4 2500 648 780 1555 2479 544 2007 2025 186 2208 783 346 2150 462 975 240 1243 1693 1777 2390 522 1126 1859 505 1731 991 684 1608 751 1605 129 1236 1271 121 1073 2079 409 882 1636 2432 2416 2125 1519 1046 79 315 1906 679 2452 86 669 2191 1467 326 397 286 1986 1299 2409 2259 2166 854 1437 620 330...
output:
1555 648 2479 780 2025 544 186 2007 783 2150 346 2208 240 975 1243 462 522 1777 1693 2390 1126 1731 1859 505 684 751 1608 991 1271 1605 129 1236 1073 409 121 2079 2416 1636 2432 882 79 1519 1046 2125 679 1906 2452 315 86 2191 1467 669 397 1986 326 286 2166 2409 2259 1299 854 620 1437 330 1946 979 59...
result:
ok
Test #78:
score: 5
Accepted
time: 4ms
memory: 4116kb
input:
1250 8 1250 1143 47 853 56 15 316 165 820 768 1167 447 1006 696 621 491 431 301 1068 674 1050 1107 235 256 499 702 264 364 1158 959 489 450 966 972 83 910 399 944 744 202 196 433 893 553 1010 13 847 917 296 199 788 380 1018 442 1066 1064 1059 1206 686 399 975 298 730 439 781 964 398 283 449 241 788 ...
output:
165 47 853 15 1143 316 56 820 447 431 621 1167 768 491 696 1006 1068 499 1050 235 1107 674 301 256 264 959 1158 450 364 489 702 966 972 744 399 202 910 196 83 944 893 296 553 847 433 917 1010 13 788 1059 1066 199 1064 1018 442 380 399 1206 439 975 686 781 730 298 964 241 788 449 398 337 788 283 766 ...
result:
ok
Test #79:
score: 5
Accepted
time: 3ms
memory: 4384kb
input:
2500 4 2500 11 34 1064 1548 2120 1668 2 1223 1208 390 12 1204 482 830 1427 2204 312 1940 1551 1432 2282 1122 2271 1334 1702 344 623 224 258 20 288 1335 262 308 1502 992 474 345 2403 2254 1466 930 1281 1642 2151 434 786 1345 64 464 2265 51 2054 274 435 2007 171 867 395 544 1766 358 872 1478 345 474 2...
output:
11 1064 34 1548 2 2120 1668 1223 1204 1208 12 390 482 1427 830 2204 1551 312 1940 1432 1122 2282 2271 1334 344 623 1702 224 258 20 1335 288 1502 262 992 308 2254 474 2403 345 1281 930 1642 1466 786 434 2151 1345 2265 464 51 64 435 2054 274 2007 395 867 544 171 358 872 1766 1478 2403 345 2254 474 156...
result:
ok
Test #80:
score: 5
Accepted
time: 12ms
memory: 4088kb
input:
156 64 156 29 104 122 93 114 102 62 151 145 125 155 109 97 116 62 72 83 122 60 109 125 19 14 101 80 125 76 155 123 128 123 57 7 154 36 60 123 36 19 89 12 3 29 36 145 66 9 13 132 26 97 89 4 95 92 19 86 140 33 89 55 5 102 119 148 71 119 10 75 47 27 30 4 109 92 63 55 28 2 156 3 123 84 10 60 13 5 93 125...
output:
97 102 76 33 57 60 12 104 14 3 62 95 13 155 123 102 55 97 72 9 145 109 36 114 128 145 4 86 36 80 123 29 89 125 125 92 7 122 26 122 116 19 29 140 132 151 154 5 101 109 36 66 19 125 60 93 19 83 155 89 89 62 123 119 109 52 13 25 27 148 109 156 71 47 93 123 127 123 3 156 27 25 28 93 122 62 123 28 84 33 ...
result:
ok
Test #81:
score: 5
Accepted
time: 103ms
memory: 3952kb
input:
9 1024 9 1 6 8 8 4 1 1 5 8 6 8 4 6 6 1 6 6 1 4 4 5 1 6 6 8 6 4 1 1 1 5 8 6 4 1 6 4 8 6 4 1 1 8 1 6 6 8 1 8 8 1 4 1 8 6 5 1 1 6 8 6 4 4 5 1 5 1 8 6 8 8 1 8 5 5 6 1 8 4 6 8 1 1 8 8 1 4 8 6 4 4 8 1 8 1 8 1 1 1 1 8 8 6 4 6 1 1 5 8 4 1 6 5 8 1 6 1 6 4 1 6 5 4 8 4 5 4 6 1 8 6 8 1 4 1 8 6 1 4 1 4 1 5 8 8 1...
output:
5 4 6 8 5 6 5 6 8 1 5 6 6 1 6 5 4 5 1 6 4 1 8 8 1 8 1 4 1 1 6 6 8 6 4 8 4 4 5 8 6 8 8 6 8 1 4 5 1 1 6 8 5 8 6 6 1 8 1 8 8 8 8 8 1 4 6 8 1 4 1 1 6 4 1 6 8 1 6 8 6 8 8 4 4 4 1 8 1 1 1 6 8 1 1 1 6 1 4 6 1 1 8 4 4 4 6 6 1 8 6 1 1 8 6 1 8 6 1 6 1 1 1 4 8 1 1 1 8 8 1 4 1 4 1 6 1 6 8 6 4 8 5 6 1 1 1 6 1 8 ...
result:
ok
Test #82:
score: 5
Accepted
time: 22ms
memory: 4384kb
input:
2462 4 2401 595 1986 967 1326 19 173 880 2187 961 1645 843 1179 177 1102 1566 1225 1065 1553 961 354 1276 625 611 1814 1110 1097 572 845 780 2178 2041 1291 1531 415 1138 2390 1131 1649 499 584 752 1296 754 1982 2295 498 1627 1853 1647 1628 974 1282 265 2321 1271 2097 1161 123 2252 1776 439 723 487 4...
output:
595 1986 967 1326 19 173 2187 880 843 1645 1179 961 177 1566 1225 1102 1553 961 354 1065 611 1276 625 1814 1097 845 572 1110 780 1291 2178 2041 1138 1531 415 2390 1649 584 499 1131 1982 752 754 1296 2295 1853 1627 498 1628 1282 1647 974 265 2097 2321 1271 1776 1161 2252 123 723 424 487 439 1558 333 ...
result:
ok
Test #83:
score: 5
Accepted
time: 94ms
memory: 4824kb
input:
4990 2 3 1 2 2 2 1 2 2 2 2 1 1 1 1 2 2 1 2 1 1 1 2 2 1 1 2 2 2 2 2 2 1 2 1 1 2 1 2 1 1 1 2 1 1 1 2 2 1 2 2 1 2 2 1 1 2 2 1 1 1 2 2 2 1 2 1 1 2 1 1 1 2 2 1 2 2 1 2 1 2 2 2 1 2 2 1 1 2 1 1 2 1 2 2 1 1 2 1 2 1 1 2 2 1 2 2 1 1 1 2 2 1 2 1 2 2 2 2 2 1 2 2 1 1 2 1 1 1 1 2 1 1 1 1 2 1 2 2 1 1 2 2 2 1 2 2 2...
output:
1 2 2 2 2 1 2 2 1 2 1 1 1 2 1 2 1 2 1 1 2 2 1 1 2 2 2 2 2 2 2 1 1 1 1 2 1 2 1 1 1 2 1 1 2 2 1 2 1 2 2 2 1 1 2 2 1 1 2 1 2 2 1 2 1 1 1 2 1 1 2 2 2 1 1 2 1 2 2 2 1 2 2 2 1 1 1 2 1 2 2 1 1 2 1 2 2 1 1 1 2 2 1 2 1 2 1 1 2 2 2 1 1 2 2 2 2 2 2 1 1 2 1 2 1 1 1 1 1 2 1 1 2 1 1 2 1 2 2 1 2 2 1 2 2 2 1 2 1 2 ...
result:
ok
Test #84:
score: 5
Accepted
time: 51ms
memory: 4780kb
input:
5000 2 5000 2970 2674 1208 2674 4977 2674 2674 3028 2674 36 1712 2674 3561 2674 2674 3033 4699 2674 2674 1785 2674 4345 2674 3302 2493 2674 2674 4280 2674 3999 4850 2674 2674 4508 3742 2674 2674 2718 2674 3461 260 2674 2674 4223 2069 2674 2674 1144 1975 2674 527 2674 2674 3260 2806 2674 3636 2674 26...
output:
2970 2674 1208 2674 2674 4977 2674 3028 36 2674 2674 1712 2674 3561 3033 2674 2674 4699 1785 2674 4345 2674 3302 2674 2674 2493 4280 2674 3999 2674 2674 4850 4508 2674 2674 3742 2718 2674 3461 2674 2674 260 4223 2674 2069 2674 1144 2674 1975 2674 2674 527 3260 2674 2806 2674 2674 3636 1254 2674 1143...
result:
ok
Test #85:
score: 5
Accepted
time: 48ms
memory: 4400kb
input:
2450 4 2401 317 417 657 793 1237 1460 1990 507 1030 1744 1155 1114 486 868 1284 2376 2391 704 1441 665 173 1283 789 1607 1309 1045 1466 2192 734 766 284 254 1814 1752 1181 937 1459 1638 1329 2346 1155 1205 443 1744 430 1096 1050 1098 930 2224 1622 186 1772 1916 1833 2196 2066 739 114 757 1180 786 99...
output:
417 317 657 793 1237 1460 1990 507 1155 1744 1114 1030 1284 486 2376 868 2391 1441 665 704 1283 1607 789 173 1309 1466 1045 2192 284 766 254 734 1814 937 1181 1752 1459 1329 2346 1638 1205 1155 1744 443 430 1050 1096 1098 930 1622 186 2224 1772 2196 1833 1916 739 2066 757 114 786 277 996 1180 1508 2...
result:
ok
Test #86:
score: 5
Accepted
time: 0ms
memory: 4116kb
input:
1250 8 1000 580 788 926 830 833 861 67 795 768 582 227 113 421 701 823 566 188 868 745 494 910 981 644 76 572 751 409 665 210 771 875 742 131 442 387 298 3 151 455 145 550 78 74 694 250 672 85 118 857 807 977 695 431 855 944 533 523 881 432 789 742 787 649 615 159 29 942 894 619 538 114 42 834 480 6...
output:
788 67 830 580 926 861 833 795 768 823 582 701 421 227 566 113 981 188 76 745 644 868 494 910 409 572 875 210 742 751 665 771 145 298 151 442 3 131 387 455 78 250 85 550 74 118 672 694 977 533 431 807 857 944 855 695 432 649 789 523 615 742 881 787 538 29 894 42 942 619 114 159 210 834 355 558 614 4...
result:
ok
Test #87:
score: 5
Accepted
time: 3ms
memory: 4212kb
input:
1248 8 1248 161 598 1246 131 374 981 761 969 119 257 749 837 658 163 674 826 564 891 1166 207 863 733 802 929 233 964 311 507 202 314 77 400 376 1093 71 445 709 408 1247 388 1020 581 966 19 468 403 48 566 1201 785 822 946 479 132 730 703 349 861 731 188 37 1202 18 183 882 126 896 333 614 1226 648 52...
output:
374 1246 981 161 598 761 131 969 674 658 119 257 837 163 826 749 1166 802 207 564 863 733 891 929 507 202 311 233 77 964 400 314 408 445 71 376 1247 709 1093 388 966 468 403 1020 48 19 566 581 822 730 785 1201 946 132 479 703 183 731 1202 349 18 188 861 37 126 523 614 882 333 648 896 1226 363 956 11...
result:
ok
Subtask #7:
score: 5
Accepted
Dependency #6:
100%
Accepted
Test #88:
score: 5
Accepted
time: 1ms
memory: 3652kb
input:
3 4 3 2 3 2 2 2 3 3 2 2 2 3 2
output:
2 2 3 2 3 3 2 2 2 2 2 3
result:
ok
Test #89:
score: 5
Accepted
time: 3ms
memory: 4412kb
input:
2450 4 2450 540 475 1156 2334 2421 2439 1328 750 471 1051 2007 1792 1776 786 705 2269 1277 755 1674 1622 590 1378 1217 603 967 239 1658 1920 857 2307 1589 78 2172 861 2322 1634 2077 2021 1381 2179 1126 345 1547 2126 994 1214 1477 412 1857 2085 831 978 281 1844 2406 2174 521 2334 2254 1779 1508 905 1...
output:
540 475 1156 2334 2421 2439 750 1328 1792 471 2007 1051 1776 705 2269 786 1622 755 1674 1277 1217 1378 590 603 1658 967 1920 239 857 1589 78 2307 2322 861 1634 2172 2179 2021 2077 1381 1547 1126 2126 345 1477 994 1214 412 1857 978 831 2085 2174 281 1844 2406 2254 2334 521 1779 905 1903 284 1508 345 ...
result:
ok
Test #90:
score: 5
Accepted
time: 3ms
memory: 4348kb
input:
2499 4 2499 1 2 2 3 1429 1 1 1429 3 4 4 7 1430 3 3 1430 5 6 6 1 1431 5 5 1431 7 8 8 11 1432 7 7 1432 9 10 10 5 1433 9 9 1433 11 12 12 15 1434 11 11 1434 13 14 14 9 1435 13 13 1435 15 16 16 19 1436 15 15 1436 17 18 18 13 1437 17 17 1437 19 20 20 23 1438 19 19 1438 21 22 22 17 1439 21 21 1439 23 24 24...
output:
2 1 2 3 1 1429 1 1429 7 3 4 4 3 1430 3 1430 5 6 6 1 1431 5 5 1431 8 8 11 7 1432 7 7 1432 9 10 10 5 1433 9 9 1433 15 11 12 12 11 1434 1434 11 13 14 14 9 1435 13 13 1435 16 16 19 15 1436 15 15 1436 17 18 18 13 1437 17 17 1437 23 19 20 20 19 1438 1438 19 21 22 22 17 1439 21 21 1439 24 24 27 23 1440 23 ...
result:
ok
Test #91:
score: 5
Accepted
time: 3ms
memory: 4908kb
input:
5000 2 5000 3581 2773 462 1582 1171 208 74 4865 1018 10 1962 2532 578 1491 1140 4567 3640 4785 1051 3325 4545 2135 1152 286 309 4874 1953 3646 1794 234 1223 3529 3751 1002 3427 4740 4638 2554 933 1988 3177 1846 2440 2671 1315 3502 1382 2669 3145 443 438 2418 420 1154 671 3875 3152 1807 3618 1093 359...
output:
3581 2773 1582 462 208 1171 74 4865 1018 10 1962 2532 578 1491 4567 1140 3640 4785 1051 3325 4545 2135 286 1152 4874 309 1953 3646 1794 234 1223 3529 1002 3751 3427 4740 2554 4638 1988 933 1846 3177 2440 2671 3502 1315 2669 1382 3145 443 2418 438 1154 420 671 3875 1807 3152 1093 3618 359 3471 4738 3...
result:
ok
Test #92:
score: 5
Accepted
time: 3ms
memory: 4872kb
input:
4900 2 4900 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51...
output:
2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53...
result:
ok
Test #93:
score: 5
Accepted
time: 3ms
memory: 4856kb
input:
4900 2 4900 2 1 3 2 3 4 4 5 6 5 7 6 7 8 8 9 10 9 11 10 11 12 12 13 14 13 15 14 15 16 16 17 18 17 19 18 19 20 20 21 22 21 23 22 23 24 24 25 26 25 27 26 27 28 28 29 30 29 31 30 31 32 32 33 34 33 35 34 35 36 36 37 38 37 39 38 39 40 40 41 42 41 43 42 43 44 44 45 46 45 47 46 47 48 48 49 50 49 51 50 51 52...
output:
2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 54 53...
result:
ok
Test #94:
score: 5
Accepted
time: 14ms
memory: 4076kb
input:
156 64 50 36 22 8 7 45 26 10 16 37 31 13 17 1 6 48 13 36 23 46 30 47 28 11 34 21 43 3 3 22 40 38 2 38 25 2 1 42 36 10 41 36 17 26 37 41 49 8 24 20 5 20 18 6 6 21 13 3 45 28 32 32 15 38 10 30 6 47 18 29 14 27 4 4 4 4 24 13 28 38 32 36 25 16 42 35 41 15 47 39 46 50 46 3 17 12 24 46 45 28 22 43 26 45 1...
output:
13 10 40 36 22 6 30 49 3 31 25 47 5 26 17 43 2 2 8 28 17 24 11 13 26 3 10 18 32 36 1 41 28 42 16 20 15 21 8 48 45 23 1 37 6 22 36 36 7 21 10 34 6 38 41 38 38 46 13 20 3 32 45 37 6 41 18 30 6 24 43 17 28 28 42 20 46 49 26 27 15 10 47 13 32 34 45 46 25 13 14 31 4 24 24 20 36 26 29 24 50 41 13 20 6 27 ...
result:
ok
Test #95:
score: 5
Accepted
time: 3ms
memory: 4332kb
input:
2500 4 2500 648 780 1555 2479 544 2007 2025 186 2208 783 346 2150 462 975 240 1243 1693 1777 2390 522 1126 1859 505 1731 991 684 1608 751 1605 129 1236 1271 121 1073 2079 409 882 1636 2432 2416 2125 1519 1046 79 315 1906 679 2452 86 669 2191 1467 326 397 286 1986 1299 2409 2259 2166 854 1437 620 330...
output:
1555 648 2479 780 2025 544 186 2007 783 2150 346 2208 240 975 1243 462 522 1777 1693 2390 1126 1731 1859 505 684 751 1608 991 1271 1605 129 1236 1073 409 121 2079 2416 1636 2432 882 79 1519 1046 2125 679 1906 2452 315 86 2191 1467 669 397 1986 326 286 2166 2409 2259 1299 854 620 1437 330 1946 979 59...
result:
ok
Test #96:
score: 5
Accepted
time: 4ms
memory: 4172kb
input:
1250 8 1250 1143 47 853 56 15 316 165 820 768 1167 447 1006 696 621 491 431 301 1068 674 1050 1107 235 256 499 702 264 364 1158 959 489 450 966 972 83 910 399 944 744 202 196 433 893 553 1010 13 847 917 296 199 788 380 1018 442 1066 1064 1059 1206 686 399 975 298 730 439 781 964 398 283 449 241 788 ...
output:
165 47 853 15 1143 316 56 820 447 431 621 1167 768 491 696 1006 1068 499 1050 235 1107 674 301 256 264 959 1158 450 364 489 702 966 972 744 399 202 910 196 83 944 893 296 553 847 433 917 1010 13 788 1059 1066 199 1064 1018 442 380 399 1206 439 975 686 781 730 298 964 241 788 449 398 337 788 283 766 ...
result:
ok
Test #97:
score: 5
Accepted
time: 3ms
memory: 4384kb
input:
2500 4 2500 11 34 1064 1548 2120 1668 2 1223 1208 390 12 1204 482 830 1427 2204 312 1940 1551 1432 2282 1122 2271 1334 1702 344 623 224 258 20 288 1335 262 308 1502 992 474 345 2403 2254 1466 930 1281 1642 2151 434 786 1345 64 464 2265 51 2054 274 435 2007 171 867 395 544 1766 358 872 1478 345 474 2...
output:
11 1064 34 1548 2 2120 1668 1223 1204 1208 12 390 482 1427 830 2204 1551 312 1940 1432 1122 2282 2271 1334 344 623 1702 224 258 20 1335 288 1502 262 992 308 2254 474 2403 345 1281 930 1642 1466 786 434 2151 1345 2265 464 51 64 435 2054 274 2007 395 867 544 171 358 872 1766 1478 2403 345 2254 474 156...
result:
ok
Test #98:
score: 5
Accepted
time: 1ms
memory: 3764kb
input:
3 2 3 1 2 2 3 2 3
output:
1 2 3 2 2 3
result:
ok
Test #99:
score: 5
Accepted
time: 7ms
memory: 4092kb
input:
156 64 156 29 104 122 93 114 102 62 151 145 125 155 109 97 116 62 72 83 122 60 109 125 19 14 101 80 125 76 155 123 128 123 57 7 154 36 60 123 36 19 89 12 3 29 36 145 66 9 13 132 26 97 89 4 95 92 19 86 140 33 89 55 5 102 119 148 71 119 10 75 47 27 30 4 109 92 63 55 28 2 156 3 123 84 10 60 13 5 93 125...
output:
97 102 76 33 57 60 12 104 14 3 62 95 13 155 123 102 55 97 72 9 145 109 36 114 128 145 4 86 36 80 123 29 89 125 125 92 7 122 26 122 116 19 29 140 132 151 154 5 101 109 36 66 19 125 60 93 19 83 155 89 89 62 123 119 109 52 13 25 27 148 109 156 71 47 93 123 127 123 3 156 27 25 28 93 122 62 123 28 84 33 ...
result:
ok
Test #100:
score: 5
Accepted
time: 1ms
memory: 3656kb
input:
20 2 20 18 2 12 5 20 9 4 2 17 4 7 15 9 2 5 5 13 15 19 5 3 5 10 19 8 5 7 10 9 11 3 16 7 18 9 5 3 8 18 4
output:
18 2 12 5 9 20 4 2 17 4 7 15 2 9 5 5 15 13 19 5 5 3 10 19 5 8 7 10 9 11 3 16 18 7 5 9 8 3 4 18
result:
ok
Test #101:
score: 5
Accepted
time: 1ms
memory: 3784kb
input:
20 2 12 12 11 1 9 12 12 3 4 3 9 8 3 8 11 10 9 4 3 6 7 11 6 11 3 7 10 12 10 11 10 11 11 11 2 1 12 6 12 2 7
output:
11 12 1 9 12 12 4 3 3 9 8 3 11 8 9 10 3 4 7 6 6 11 3 11 7 10 10 12 10 11 11 11 11 2 12 1 12 6 2 7
result:
ok
Test #102:
score: 5
Accepted
time: 1ms
memory: 3644kb
input:
20 2 8 7 7 7 8 6 4 7 4 6 2 4 6 1 3 2 3 8 3 6 7 1 5 6 3 2 5 1 4 2 2 6 2 6 3 2 5 5 3 3 3
output:
7 7 8 7 4 6 7 4 2 6 6 4 1 3 3 2 3 8 7 6 1 5 6 3 5 2 4 1 2 2 2 6 6 3 5 2 3 5 3 3
result:
ok
Test #103:
score: 5
Accepted
time: 1ms
memory: 3648kb
input:
12 2 20 13 1 4 14 14 13 17 1 8 15 14 5 3 7 20 6 1 9 19 11 6 20 11 13
output:
13 1 4 14 14 13 1 17 8 15 14 5 3 7 20 6 1 9 11 19 6 20 13 11
result:
ok
Test #104:
score: 5
Accepted
time: 1ms
memory: 3656kb
input:
20 2 19 2 15 16 8 1 11 15 18 7 17 19 7 14 2 3 10 12 5 14 10 8 5 17 11 16 11 3 13 12 9 4 17 1 6 6 4 13 19 18 5
output:
15 2 16 8 1 11 18 15 7 17 19 7 2 14 10 3 5 12 14 10 8 5 17 11 11 16 3 13 12 9 17 4 6 1 4 6 13 19 5 18
result:
ok
Test #105:
score: 5
Accepted
time: 1ms
memory: 3656kb
input:
18 2 18 12 15 7 18 12 13 9 14 8 5 5 3 4 1 10 9 17 7 4 2 10 14 16 6 1 2 16 11 3 8 15 13 17 18 11 6
output:
12 15 7 18 13 12 9 14 8 5 5 3 4 1 10 9 17 7 2 4 14 10 16 6 1 2 11 16 3 8 15 13 18 17 6 11
result:
ok
Test #106:
score: 5
Accepted
time: 5ms
memory: 4932kb
input:
78 128 100000 81808 77744 77980 20344 56544 50739 70835 39983 68165 34656 3072 42835 82535 82728 67410 26960 83125 8567 68716 87268 1041 55994 57260 55232 2311 39201 31839 52222 97649 77452 99484 9817 25951 19307 89403 41701 29144 21015 97490 47889 80786 38025 80518 41671 15279 15331 14598 14750 388...
output:
81808 77744 20344 77980 39983 70835 56544 50739 83125 26960 82728 67410 68165 34656 42835 3072 25951 9817 77452 99484 39201 31839 97649 52222 8567 68716 1041 87268 2311 55232 55994 57260 72373 25161 95228 78904 28260 74570 11423 59023 38811 43890 89666 53954 99906 28549 72929 21831 19307 29144 41701...
result:
ok
Test #107:
score: 5
Accepted
time: 7ms
memory: 4880kb
input:
4 2048 95000 38783 19709 71675 15481 45011 21868 31035 86793 51119 32657 89325 16883 19411 82169 55236 12196 70200 53239 39110 1874 74802 92295 14936 39296 33336 21076 44167 41683 70853 46547 4147 92052 23634 43406 21048 62597 37396 48811 32118 56333 72463 15734 84750 74354 93564 26993 34448 9656 49...
output:
38783 19709 15481 71675 86793 21868 45011 41761 70200 55416 55236 12196 32657 89325 82169 19411 4147 46547 20931 70853 93526 21076 41683 44167 53239 39110 74802 1874 33336 39296 92295 14936 60598 91408 19768 31925 28262 53328 9700 402 23588 18381 62933 70654 93509 73979 42412 26611 23634 43406 62597...
result:
ok
Test #108:
score: 5
Accepted
time: 3ms
memory: 4260kb
input:
1250 8 8000 1142 5185 4039 4187 6143 3133 1453 6322 2826 1179 6307 4164 4163 1381 6393 5987 165 7650 2235 6199 1828 7154 1702 6555 1924 5298 6688 3890 2158 6145 6260 1593 6582 7121 595 566 1943 1749 498 4850 1658 2980 77 1807 19 5771 1887 1851 6975 6093 5956 6901 7876 3172 4955 7840 6805 5280 991 89...
output:
5185 1453 4187 1142 6322 3133 4039 6143 2826 6307 4164 1179 5987 6393 4163 1381 1828 7154 165 2235 6555 1702 7650 6199 1593 6145 6688 5298 6260 2158 1924 3890 595 4850 566 6582 1749 498 7121 1943 1658 1887 77 2980 1851 5771 1807 19 5956 7876 6093 3172 7840 4955 6975 6901 6805 5846 892 991 7036 4028 ...
result:
ok
Test #109:
score: 5
Accepted
time: 4ms
memory: 5060kb
input:
1250 8 100000 33559 35032 86872 2746 93799 19407 3978 35031 45242 19554 51244 7095 76508 73954 58274 17339 33768 22747 28465 45940 68882 8649 47192 74009 85827 61438 15635 42263 10935 25322 70609 29138 89239 2604 35343 91233 24911 24596 24352 4723 61239 30122 86493 3193 95509 53433 14784 66391 97818...
output:
35031 35032 33559 86872 93799 3978 2746 19407 17339 45242 51244 19554 76508 73954 7095 58274 22747 47192 28465 8649 74009 45940 33768 68882 85827 25322 15635 61438 29138 10935 42263 70609 89239 4723 24911 91233 24352 2604 35343 24596 53433 3193 61239 95509 86493 66391 30122 14784 8896 45345 66348 51...
result:
ok
Test #110:
score: 5
Accepted
time: 108ms
memory: 4064kb
input:
9 1024 9 1 6 8 8 4 1 1 5 8 6 8 4 6 6 1 6 6 1 4 4 5 1 6 6 8 6 4 1 1 1 5 8 6 4 1 6 4 8 6 4 1 1 8 1 6 6 8 1 8 8 1 4 1 8 6 5 1 1 6 8 6 4 4 5 1 5 1 8 6 8 8 1 8 5 5 6 1 8 4 6 8 1 1 8 8 1 4 8 6 4 4 8 1 8 1 8 1 1 1 1 8 8 6 4 6 1 1 5 8 4 1 6 5 8 1 6 1 6 4 1 6 5 4 8 4 5 4 6 1 8 6 8 1 4 1 8 6 1 4 1 4 1 5 8 8 1...
output:
5 4 6 8 5 6 5 6 8 1 5 6 6 1 6 5 4 5 1 6 4 1 8 8 1 8 1 4 1 1 6 6 8 6 4 8 4 4 5 8 6 8 8 6 8 1 4 5 1 1 6 8 5 8 6 6 1 8 1 8 8 8 8 8 1 4 6 8 1 4 1 1 6 4 1 6 8 1 6 8 6 8 8 4 4 4 1 8 1 1 1 6 8 1 1 1 6 1 4 6 1 1 8 4 4 4 6 6 1 8 6 1 1 8 6 1 8 6 1 6 1 1 1 4 8 1 1 1 8 8 1 4 1 4 1 6 1 6 8 6 4 8 5 6 1 1 1 6 1 8 ...
result:
ok
Test #111:
score: 5
Accepted
time: 22ms
memory: 4452kb
input:
2462 4 2401 595 1986 967 1326 19 173 880 2187 961 1645 843 1179 177 1102 1566 1225 1065 1553 961 354 1276 625 611 1814 1110 1097 572 845 780 2178 2041 1291 1531 415 1138 2390 1131 1649 499 584 752 1296 754 1982 2295 498 1627 1853 1647 1628 974 1282 265 2321 1271 2097 1161 123 2252 1776 439 723 487 4...
output:
595 1986 967 1326 19 173 2187 880 843 1645 1179 961 177 1566 1225 1102 1553 961 354 1065 611 1276 625 1814 1097 845 572 1110 780 1291 2178 2041 1138 1531 415 2390 1649 584 499 1131 1982 752 754 1296 2295 1853 1627 498 1628 1282 1647 974 265 2097 2321 1271 1776 1161 2252 123 723 424 487 439 1558 333 ...
result:
ok
Test #112:
score: 5
Accepted
time: 95ms
memory: 4800kb
input:
4990 2 3 1 2 2 2 1 2 2 2 2 1 1 1 1 2 2 1 2 1 1 1 2 2 1 1 2 2 2 2 2 2 1 2 1 1 2 1 2 1 1 1 2 1 1 1 2 2 1 2 2 1 2 2 1 1 2 2 1 1 1 2 2 2 1 2 1 1 2 1 1 1 2 2 1 2 2 1 2 1 2 2 2 1 2 2 1 1 2 1 1 2 1 2 2 1 1 2 1 2 1 1 2 2 1 2 2 1 1 1 2 2 1 2 1 2 2 2 2 2 1 2 2 1 1 2 1 1 1 1 2 1 1 1 1 2 1 2 2 1 1 2 2 2 1 2 2 2...
output:
1 2 2 2 2 1 2 2 1 2 1 1 1 2 1 2 1 2 1 1 2 2 1 1 2 2 2 2 2 2 2 1 1 1 1 2 1 2 1 1 1 2 1 1 2 2 1 2 1 2 2 2 1 1 2 2 1 1 2 1 2 2 1 2 1 1 1 2 1 1 2 2 2 1 1 2 1 2 2 2 1 2 2 2 1 1 1 2 1 2 2 1 1 2 1 2 2 1 1 1 2 2 1 2 1 2 1 1 2 2 2 1 1 2 2 2 2 2 2 1 1 2 1 2 1 1 1 1 1 2 1 1 2 1 1 2 1 2 2 1 2 2 1 2 2 2 1 2 1 2 ...
result:
ok
Test #113:
score: 5
Accepted
time: 51ms
memory: 4844kb
input:
5000 2 5000 2970 2674 1208 2674 4977 2674 2674 3028 2674 36 1712 2674 3561 2674 2674 3033 4699 2674 2674 1785 2674 4345 2674 3302 2493 2674 2674 4280 2674 3999 4850 2674 2674 4508 3742 2674 2674 2718 2674 3461 260 2674 2674 4223 2069 2674 2674 1144 1975 2674 527 2674 2674 3260 2806 2674 3636 2674 26...
output:
2970 2674 1208 2674 2674 4977 2674 3028 36 2674 2674 1712 2674 3561 3033 2674 2674 4699 1785 2674 4345 2674 3302 2674 2674 2493 4280 2674 3999 2674 2674 4850 4508 2674 2674 3742 2718 2674 3461 2674 2674 260 4223 2674 2069 2674 1144 2674 1975 2674 2674 527 3260 2674 2806 2674 2674 3636 1254 2674 1143...
result:
ok
Test #114:
score: 5
Accepted
time: 48ms
memory: 4452kb
input:
2450 4 2401 317 417 657 793 1237 1460 1990 507 1030 1744 1155 1114 486 868 1284 2376 2391 704 1441 665 173 1283 789 1607 1309 1045 1466 2192 734 766 284 254 1814 1752 1181 937 1459 1638 1329 2346 1155 1205 443 1744 430 1096 1050 1098 930 2224 1622 186 1772 1916 1833 2196 2066 739 114 757 1180 786 99...
output:
417 317 657 793 1237 1460 1990 507 1155 1744 1114 1030 1284 486 2376 868 2391 1441 665 704 1283 1607 789 173 1309 1466 1045 2192 284 766 254 734 1814 937 1181 1752 1459 1329 2346 1638 1205 1155 1744 443 430 1050 1096 1098 930 1622 186 2224 1772 2196 1833 1916 739 2066 757 114 786 277 996 1180 1508 2...
result:
ok
Test #115:
score: 5
Accepted
time: 4ms
memory: 4196kb
input:
1250 8 1000 580 788 926 830 833 861 67 795 768 582 227 113 421 701 823 566 188 868 745 494 910 981 644 76 572 751 409 665 210 771 875 742 131 442 387 298 3 151 455 145 550 78 74 694 250 672 85 118 857 807 977 695 431 855 944 533 523 881 432 789 742 787 649 615 159 29 942 894 619 538 114 42 834 480 6...
output:
788 67 830 580 926 861 833 795 768 823 582 701 421 227 566 113 981 188 76 745 644 868 494 910 409 572 875 210 742 751 665 771 145 298 151 442 3 131 387 455 78 250 85 550 74 118 672 694 977 533 431 807 857 944 855 695 432 649 789 523 615 742 881 787 538 29 894 42 942 619 114 159 210 834 355 558 614 4...
result:
ok
Test #116:
score: 5
Accepted
time: 2ms
memory: 4244kb
input:
1248 8 1248 161 598 1246 131 374 981 761 969 119 257 749 837 658 163 674 826 564 891 1166 207 863 733 802 929 233 964 311 507 202 314 77 400 376 1093 71 445 709 408 1247 388 1020 581 966 19 468 403 48 566 1201 785 822 946 479 132 730 703 349 861 731 188 37 1202 18 183 882 126 896 333 614 1226 648 52...
output:
374 1246 981 161 598 761 131 969 674 658 119 257 837 163 826 749 1166 802 207 564 863 733 891 929 507 202 311 233 77 964 400 314 408 445 71 376 1247 709 1093 388 966 468 403 1020 48 19 566 581 822 730 785 1201 946 132 479 703 183 731 1202 349 18 188 861 37 126 523 614 882 333 648 896 1226 363 956 11...
result:
ok
Subtask #8:
score: 0
Skipped
Dependency #2:
0%
Subtask #9:
score: 0
Skipped
Dependency #3:
0%
Subtask #10:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%