QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#792771 | #30. Political Development | seungni | 100 ✓ | 241ms | 29764kb | C++17 | 1.8kb | 2024-11-29 14:00:32 | 2024-11-29 14:00:32 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
int N, K, ans;
set<int> graph[50005];
int ok[50005];
void DFS(int root, int now, int state, int k) {
ans = max(ans, k);
if (now == graph[root].size()) return;
int idx = 0, nxt = -1;
for (auto i: graph[root]) {
if (idx == now) {
nxt = i;
break;
}
idx++;
}
DFS(root, now + 1, state, k);
int flag = 0;
idx = 0;
for (auto i: graph[root]) {
if (state & (1 << idx)) {
if (!graph[nxt].count(i)) {
flag = 1;
break;
}
}
idx++;
}
if (!flag) DFS(root, now + 1, state | (1 << now), k + 1);
return;
}
void solve() {
cin >> N >> K;
for (int i = 0; i < N; i++) {
int k;
cin >> k;
for (int j = 0; j < k; j++) {
int a;
cin >> a;
graph[i].insert(a);
}
}
set<pii> s;
for (int i = 0; i < N; i++) {
s.insert({graph[i].size(), i});
}
while (s.size()) {
pii now = *s.begin();
if (ok[now.second]) s.erase(now);
else {
s.erase(now);
DFS(now.second, 0, 0, 1);
for (auto i: graph[now.second]) {
s.erase({graph[i].size(), i});
graph[i].erase(now.second);
}
for (auto i: graph[now.second]) s.insert({graph[i].size(), i});
ok[now.second] = 1;
}
}
cout << ans;
return;
}
int main(void) {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
#endif
ios::sync_with_stdio(false);
cin.tie(0);
int t = 1;
//cin >> t;
while (t--) solve();
return 0;
}
详细
Subtask #1:
score: 4
Accepted
Test #1:
score: 4
Accepted
time: 1ms
memory: 5872kb
input:
8 2 1 2 3 7 3 5 2 7 0 1 1 1 7 1 1 1 7 4 6 4 1 2
output:
2
result:
ok single line: '2'
Test #2:
score: 4
Accepted
time: 1ms
memory: 5908kb
input:
8 2 2 3 7 1 3 2 6 4 3 5 1 0 1 2 2 3 6 2 5 2 1 0
output:
2
result:
ok single line: '2'
Test #3:
score: 4
Accepted
time: 4ms
memory: 6624kb
input:
5000 2 1 1791 1 4343 2 2031 1630 1 286 2 4788 1978 3 847 2364 4193 2 88 1614 1 3321 1 1441 1 1098 1 1547 1 318 1 4939 1 697 3 1335 3973 2092 1 3700 1 3959 1 4582 2 2907 3324 1 364 1 4868 1 1406 4 1827 3291 2215 4513 2 1303 2448 3 3699 2272 775 4 3113 1333 2670 1991 2 2450 3615 4 3825 2008 1100 2938 ...
output:
2
result:
ok single line: '2'
Test #4:
score: 4
Accepted
time: 4ms
memory: 6904kb
input:
5000 2 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460 1 1460...
output:
2
result:
ok single line: '2'
Test #5:
score: 4
Accepted
time: 4ms
memory: 6856kb
input:
5000 2 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782 1 1782...
output:
2
result:
ok single line: '2'
Test #6:
score: 4
Accepted
time: 2ms
memory: 6680kb
input:
5000 2 1 1692 1 3670 1 3770 1 2722 1 2554 1 4972 1 3203 1 1406 1 62 1 2411 1 4472 1 3565 1 1465 1 4734 1 3229 1 707 1 4925 1 597 1 3764 1 1406 1 778 1 2086 1 1696 1 2956 1 707 1 1406 1 3604 1 597 1 1275 1 3203 1 707 1 4577 1 997 1 3604 1 1747 1 860 1 3565 1 3693 1 164 1 818 1 3693 1 4790 1 86 1 3969...
output:
2
result:
ok single line: '2'
Test #7:
score: 4
Accepted
time: 4ms
memory: 6552kb
input:
5000 2 1 1495 1 4736 1 2861 72 2890 4002 3751 2434 4908 3707 1698 4275 2507 2625 1942 1452 1309 2552 4 3667 4794 289 309 3334 2996 3208 1001 2408 707 3200 4272 3343 4465 4748 1352 48 2894 4367 3534 4594 4433 4265 3168 2324 2681 4909 1986 501 2958 784 4138 409 2837 4999 3840 3654 327 3620 4399 319 33...
output:
2
result:
ok single line: '2'
Test #8:
score: 4
Accepted
time: 0ms
memory: 6128kb
input:
5000 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
1
result:
ok single line: '1'
Test #9:
score: 4
Accepted
time: 0ms
memory: 5956kb
input:
1 1 0
output:
1
result:
ok single line: '1'
Test #10:
score: 4
Accepted
time: 2ms
memory: 6428kb
input:
5000 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
2
result:
ok single line: '2'
Subtask #2:
score: 12
Accepted
Dependency #1:
100%
Accepted
Test #11:
score: 12
Accepted
time: 4ms
memory: 6620kb
input:
5000 2 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154 1 1154...
output:
2
result:
ok single line: '2'
Test #12:
score: 12
Accepted
time: 4ms
memory: 6652kb
input:
5000 3 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423 1 1423...
output:
2
result:
ok single line: '2'
Test #13:
score: 12
Accepted
time: 1ms
memory: 5944kb
input:
5 3 2 3 1 2 0 4 2 4 3 2 0 2 2 1 2
output:
2
result:
ok single line: '2'
Test #14:
score: 12
Accepted
time: 3ms
memory: 6860kb
input:
5000 3 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937 1 2937...
output:
2
result:
ok single line: '2'
Test #15:
score: 12
Accepted
time: 0ms
memory: 5948kb
input:
5 3 0 2 2 3 2 3 1 2 2 1 0
output:
3
result:
ok single line: '3'
Test #16:
score: 12
Accepted
time: 0ms
memory: 6656kb
input:
5000 3 1 2124 1 3797 1 4553 1 4508 1 1597 1 1937 1 4085 1 72 1 1579 1 4933 1 4085 1 4553 1 1759 1 3797 1 1579 1 2531 1 4297 1 814 1 3729 1 4070 1 1606 1 1251 1 920 1 1365 1 3586 1 2124 1 827 1 4132 1 4645 1 3586 1 3945 1 72 1 4933 1 1759 1 1365 1 3729 1 1759 1 2531 1 2715 1 1817 1 494 1 1937 1 3489 ...
output:
2
result:
ok single line: '2'
Test #17:
score: 12
Accepted
time: 1ms
memory: 5872kb
input:
5 3 2 4 3 1 4 0 2 4 0 3 1 0 3
output:
3
result:
ok single line: '3'
Test #18:
score: 12
Accepted
time: 4ms
memory: 6616kb
input:
5000 3 1 1692 1 3670 1 3770 1 2722 1 2554 1 4972 1 3203 1 1406 1 62 1 2411 1 4472 1 3565 1 1465 1 4734 1 3229 1 707 1 4925 1 597 1 3764 1 1406 1 778 1 2086 1 1696 1 2956 1 707 1 1406 1 3604 1 597 1 1275 1 3203 1 707 1 4577 1 997 1 3604 1 1747 1 860 1 3565 1 3693 1 164 1 818 1 3693 1 4790 1 86 1 3969...
output:
2
result:
ok single line: '2'
Test #19:
score: 12
Accepted
time: 0ms
memory: 6088kb
input:
5000 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
1
result:
ok single line: '1'
Test #20:
score: 12
Accepted
time: 3ms
memory: 6440kb
input:
5000 3 1 4978 1 838 1 2090 1 2059 1 3473 1 3392 1 3776 1 4073 1 1498 1 1831 1 3645 1 323 1 3789 1 3555 1 2658 1 3953 1 167 1 1424 1 1944 1 1748 1 3592 1 1697 1 3034 1 4369 1 834 1 3873 1 3964 1 2160 1 4030 1 3652 1 1931 1 3657 1 1500 1 1193 1 3550 1 3287 1 1339 1 2943 1 4697 1 1390 1 4134 1 3322 1 4...
output:
3
result:
ok single line: '3'
Test #21:
score: 12
Accepted
time: 3ms
memory: 6592kb
input:
5000 3 1 4920 1 3824 1 1763 1 785 1 1613 1 2253 1 3343 1 34 1 905 1 2732 1 2112 1 1644 1 3772 1 4254 1 1143 1 2579 1 3267 1 3263 1 3699 1 2181 1 936 1 867 1 2614 1 865 1 2998 1 901 1 2044 1 2335 1 1665 1 2048 1 571 1 2400 1 1961 1 4537 1 7 1 4327 1 2380 1 1730 1 1232 1 4381 1 154 1 2571 1 807 1 3934...
output:
3
result:
ok single line: '3'
Test #22:
score: 12
Accepted
time: 2ms
memory: 6200kb
input:
5000 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 4142 0 ...
output:
2
result:
ok single line: '2'
Test #23:
score: 12
Accepted
time: 5ms
memory: 6944kb
input:
5000 3 2 11 4552 2 2485 1399 2 3747 2906 3 3702 2655 2871 1 3902 2 3893 4591 1 3574 1 123 2 3269 1354 1 1201 2 662 831 7 3302 2808 4537 0 3789 2902 2028 5 3598 2273 4345 4790 2111 2 2604 3829 2 3358 2711 5 2831 3507 2723 3472 929 3 4417 1555 4746 2 640 4809 2 1518 4570 1 4562 4 3081 1145 3030 4813 3...
output:
3
result:
ok single line: '3'
Test #24:
score: 12
Accepted
time: 2ms
memory: 6296kb
input:
5000 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
2
result:
ok single line: '2'
Test #25:
score: 12
Accepted
time: 5ms
memory: 6984kb
input:
5000 3 1 2358 4 3124 1577 4532 34 4 1520 3135 2550 834 1 4310 1 1608 3 1776 3497 4111 1 1663 3 4052 4660 2936 2 4763 1683 2 1517 3390 2 3754 2875 8 916 1110 3367 4812 249 955 3275 3221 4 2211 1121 2834 2598 2 4492 2100 5 4962 238 2864 2019 3400 2 84 327 4 4617 3874 450 2285 1 3115 2 3406 4305 2 843 ...
output:
3
result:
ok single line: '3'
Test #26:
score: 12
Accepted
time: 5ms
memory: 6652kb
input:
5000 3 2 2861 4217 3 4808 3899 27 3 3586 3740 4883 1 1744 2 4563 2822 2 1890 2075 0 2 3889 1490 3 1820 3858 3879 1 3255 1 3718 7 399 4255 258 1374 2121 2455 1706 2 2584 4882 1 1780 3 4531 3796 1657 1 772 3 410 4026 1371 2 4339 4381 1 3080 1 1751 3 3381 3040 4741 8 2031 1620 2804 3126 4553 2583 2013 ...
output:
2
result:
ok single line: '2'
Test #27:
score: 12
Accepted
time: 0ms
memory: 6824kb
input:
5000 3 2 3886 4976 2 3410 4204 2 3696 1856 2 4926 1743 2 1749 138 2 836 730 2 710 1407 2 3679 2777 2 4941 4813 2 1312 1246 2 2047 1575 2 2139 2514 2 1689 3228 2 985 4894 2 980 3231 2 4331 3377 2 747 321 2 1144 2248 2 2206 154 2 685 4436 2 1662 4256 2 4972 4453 2 1962 2239 2 2400 2443 2 2984 2149 2 1...
output:
2
result:
ok single line: '2'
Test #28:
score: 12
Accepted
time: 4ms
memory: 6656kb
input:
5000 3 1 3604 3 889 3044 3781 1 4328 3 1488 168 4629 1 21 1 89 2 1693 1670 4 2047 1219 3456 4971 2 30 3021 3 4898 4739 964 3 856 1092 2052 4 280 1259 123 908 4 78 2806 4916 4273 1 1107 3 4331 3110 283 2 1192 1909 2 588 3144 1 1046 2 943 945 3 2406 4507 2333 1 1445 3 3254 4 3462 1 1564 3 4527 4284 36...
output:
2
result:
ok single line: '2'
Test #29:
score: 12
Accepted
time: 4ms
memory: 6688kb
input:
5000 3 2 2737 1216 2 858 2485 2 2350 937 2 839 1170 2 3867 4444 2 892 3248 2 3162 712 2 4810 3067 2 2171 3160 2 3986 2610 2 665 604 2 2257 3122 2 516 3537 2 1190 4572 2 3766 4244 2 2037 377 2 3845 1591 2 3360 4427 2 4010 3519 2 1606 385 2 2584 191 2 4455 4176 2 499 4676 2 2624 1931 2 3467 3909 2 351...
output:
2
result:
ok single line: '2'
Test #30:
score: 12
Accepted
time: 2ms
memory: 6780kb
input:
5000 3 2 3352 2300 2 259 1492 2 3352 860 2 2079 225 2 1765 1736 1 696 2 696 3466 1 696 2 1491 2988 2 1726 1673 2 3099 741 2 3352 957 2 3425 3734 3 696 3281 74 3 696 2240 2284 1 696 2 123 4829 3 3352 4485 1472 1 3352 2 1057 2676 2 3352 117 3 3352 2110 757 2 3352 1738 4 696 2063 486 4992 5 696 663 219...
output:
2
result:
ok single line: '2'
Test #31:
score: 12
Accepted
time: 5ms
memory: 6708kb
input:
5000 3 2 2852 966 2 3013 741 3 4673 2841 54 2 2788 2793 4 3972 4985 3064 61 2 881 1398 4 3397 3024 3008 2939 2 1202 1987 2 682 3681 2 3621 285 2 1033 3504 2 566 4830 3 3769 3691 954 2 1798 2753 3 1768 3734 555 2 2275 2000 2 4819 1562 2 2256 4448 3 3027 2312 2836 2 3655 4374 2 680 4117 3 3184 1547 16...
output:
2
result:
ok single line: '2'
Test #32:
score: 12
Accepted
time: 2ms
memory: 6756kb
input:
5000 3 2 1705 3546 2 2717 1269 2 1705 2926 1 1705 2 2963 2209 3 1705 2409 1298 2 1705 4644 2 1705 4535 2 39 523 3 655 4219 2994 2 655 4036 2 655 3686 2 655 2965 1 1705 2 1705 4572 3 655 2773 4703 2 655 4276 2 3025 4751 2 1705 1018 2 1705 354 2 655 3348 1 1705 3 1705 741 1652 2 1459 2221 2 3588 350 1...
output:
2
result:
ok single line: '2'
Test #33:
score: 12
Accepted
time: 2ms
memory: 6776kb
input:
5000 3 3 1362 1082 786 2 3599 4179 4 1266 2190 547 4739 2 2747 4567 2 3262 528 2 1833 1694 2 4550 1974 2 1523 4834 2 2329 2542 2 4707 642 3 2834 1858 3947 3 1473 3974 67 5 1036 3652 1233 1318 3514 3 3718 4608 2899 2 2506 3582 2 1722 531 2 2153 1350 4 3209 4531 374 4570 3 1220 4261 1782 3 4385 2990 2...
output:
2
result:
ok single line: '2'
Test #34:
score: 12
Accepted
time: 5ms
memory: 7032kb
input:
5000 3 2 1319 3894 3 2262 4948 1431 2 1865 4172 2 4394 780 2 565 4009 2 3826 3351 3 281 3645 925 2 3798 213 3 467 3992 3265 2 1868 3411 6 4227 4492 2030 3812 1028 2819 3 3710 1929 4412 2 1444 2960 2 4117 520 3 2098 2505 1558 4 3706 4568 4164 1259 5 1947 3367 4745 2918 1521 3 393 3930 3724 2 2028 318...
output:
2
result:
ok single line: '2'
Test #35:
score: 12
Accepted
time: 0ms
memory: 6320kb
input:
2501 3 2 449 2291 3 1742 559 1667 4 722 2416 43 948 2 1563 1996 2 1090 787 3 1872 2072 2283 2 1933 795 3 1268 130 670 2 1149 271 3 2433 1074 2035 4 1478 1909 204 131 3 1122 1232 1792 3 1661 780 1914 4 2273 761 1270 846 2 1501 426 3 849 1978 2259 4 1624 2279 2480 578 2 2319 1332 3 1687 2285 427 3 877...
output:
2
result:
ok single line: '2'
Test #36:
score: 12
Accepted
time: 3ms
memory: 6312kb
input:
2501 3 3 986 404 817 2 2392 2019 2 2184 1619 2 949 849 3 920 2337 1912 2 2096 1699 2 543 1536 3 900 2313 403 2 508 1498 2 1735 125 2 2092 880 3 2071 746 763 2 2436 556 2 164 2040 3 1862 742 1308 2 216 2003 2 1759 1214 4 252 1783 426 1855 2 1054 2187 4 246 159 736 484 2 192 1963 3 2209 549 395 2 657 ...
output:
2
result:
ok single line: '2'
Test #37:
score: 12
Accepted
time: 0ms
memory: 6324kb
input:
2501 3 2 126 490 2 1082 552 3 2485 1848 2408 3 2025 1784 1532 3 2169 1898 198 3 2152 1211 744 2 1390 984 2 867 2277 2 2108 352 3 919 295 2384 2 2118 2405 3 1391 583 2393 3 1989 157 245 2 2180 304 2 382 505 3 323 2291 1931 2 2222 1320 2 304 319 3 1255 1115 2403 2 2280 597 2 1448 1943 2 563 2475 2 677...
output:
2
result:
ok single line: '2'
Test #38:
score: 12
Accepted
time: 2ms
memory: 6160kb
input:
1242 3 2 578 953 2 820 614 2 342 1060 2 864 748 2 1183 614 2 820 678 2 231 993 2 203 1060 2 319 1074 2 303 700 2 883 171 2 759 310 38 613 72 681 330 792 278 1078 1003 958 916 13 1026 823 654 803 531 31 102 137 860 510 57 794 812 410 524 79 478 112 357 362 757 177 1175 918 1236 745 286 2 876 12 2 384...
output:
2
result:
ok single line: '2'
Test #39:
score: 12
Accepted
time: 2ms
memory: 6172kb
input:
1242 3 2 814 398 2 184 395 2 170 8 2 8 730 2 531 931 2 282 285 2 520 657 2 1081 97 38 88 988 354 1155 871 422 889 977 119 31 850 1193 38 2 1107 594 146 84 1211 603 941 363 279 3 1170 458 420 140 1208 510 1097 608 1037 791 806 1168 366 455 2 1081 207 2 184 1035 2 559 1019 2 1003 713 2 130 828 2 71 17...
output:
2
result:
ok single line: '2'
Test #40:
score: 12
Accepted
time: 7ms
memory: 7372kb
input:
5000 3 2 217 3463 2 747 1856 8 847 4271 1187 535 2127 4717 3615 464 3 1114 4060 1101 3 1116 2824 1078 6 1048 356 1726 229 3626 1940 3 2619 2565 2608 2 2340 4117 6 3029 1632 1828 544 4274 4908 2 4357 1204 3 515 1293 2181 5 4924 970 2298 4064 3147 4 2790 2865 1988 4803 6 4521 3330 3865 2555 4790 1926 ...
output:
3
result:
ok single line: '3'
Test #41:
score: 12
Accepted
time: 0ms
memory: 6176kb
input:
1242 3 2 183 734 2 551 1161 2 786 604 2 497 1161 2 295 1161 2 611 466 2 428 841 34 15 638 854 200 195 151 875 143 167 994 689 903 645 830 911 802 1102 832 1131 793 664 343 693 981 684 947 627 241 1163 452 250 436 65 482 2 1078 842 2 1147 1123 2 493 414 2 485 466 2 724 66 2 1076 993 2 1078 22 2 929 7...
output:
2
result:
ok single line: '2'
Test #42:
score: 12
Accepted
time: 7ms
memory: 7196kb
input:
5000 3 2 1017 4611 11 4760 765 318 1358 14 1969 2817 4900 3664 4468 4220 3 3042 4875 2507 5 1885 4147 3148 1740 3004 4 1396 2690 3745 1514 18 3711 3237 4293 3042 374 530 3810 671 718 356 1339 1953 44 711 3852 969 3696 4750 4 3587 1372 4259 3013 10 2600 704 3373 4034 1497 1369 2613 936 171 517 2 2562...
output:
3
result:
ok single line: '3'
Test #43:
score: 12
Accepted
time: 7ms
memory: 7156kb
input:
5000 3 6 4818 2279 1752 1283 3238 3198 4 1922 2799 2717 678 3 2436 1165 3061 3 2534 2180 3831 5 907 298 1784 1989 891 2 4028 3660 4 2762 85 1219 658 2 2214 3968 3 1151 123 4602 2 2230 3887 3 2068 3133 58 3 4103 4095 238 4 1446 2010 1411 3662 4 3463 1852 1921 3873 5 1606 60 794 1588 3633 2 196 1234 2...
output:
3
result:
ok single line: '3'
Subtask #3:
score: 23
Accepted
Test #44:
score: 23
Accepted
time: 2ms
memory: 6132kb
input:
5000 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
1
result:
ok single line: '1'
Test #45:
score: 23
Accepted
time: 0ms
memory: 5908kb
input:
20 6 5 16 14 9 18 1 4 15 19 0 7 5 15 8 17 5 12 5 15 16 12 6 13 5 12 18 10 5 9 5 16 4 6 2 8 5 3 16 5 18 8 5 13 17 19 11 1 5 6 2 5 18 10 5 15 4 0 12 11 5 4 14 8 13 17 4 15 9 13 7 5 3 4 14 2 9 5 3 10 19 7 11 5 12 10 17 19 0 5 3 9 1 2 11 5 3 6 0 19 5 5 14 2 18 10 7 5 4 6 8 17 0 5 16 14 13 1 7
output:
3
result:
ok single line: '3'
Test #46:
score: 23
Accepted
time: 0ms
memory: 5908kb
input:
20 6 5 1 8 16 14 9 5 0 12 13 3 7 5 15 18 16 10 17 5 1 10 18 8 12 5 15 6 19 17 11 5 11 7 14 19 17 5 10 12 17 4 18 5 1 11 12 14 5 5 3 0 17 14 13 3 18 0 19 5 15 3 6 16 2 5 4 13 5 7 12 5 1 3 6 11 7 5 15 1 11 8 16 5 8 7 5 16 0 5 18 13 10 4 2 5 13 2 10 14 0 5 6 4 8 5 2 5 15 3 6 9 2 3 4 5 9
output:
3
result:
ok single line: '3'
Test #47:
score: 23
Accepted
time: 1ms
memory: 5864kb
input:
13 5 2 11 12 2 11 2 3 7 6 1 2 11 6 2 11 7 2 11 10 3 2 7 3 3 2 6 4 3 10 12 9 2 11 8 3 8 12 5 6 5 9 0 1 4 3 3 10 8 0
output:
3
result:
ok single line: '3'
Test #48:
score: 23
Accepted
time: 1ms
memory: 5952kb
input:
20 6 5 2 17 13 6 14 5 8 7 5 16 3 5 4 19 14 0 18 4 1 12 11 14 5 10 9 11 14 2 5 8 7 1 16 17 4 10 19 0 13 5 8 5 1 16 9 5 7 5 1 16 12 5 7 15 4 10 19 5 4 13 9 6 18 5 15 4 13 3 19 5 8 15 17 18 3 5 15 10 11 0 6 5 4 2 0 3 18 5 13 9 12 18 11 5 8 7 5 1 17 5 5 16 12 0 19 5 15 12 10 2 14 5 9 2 11 17 6
output:
5
result:
ok single line: '5'
Test #49:
score: 23
Accepted
time: 1ms
memory: 5880kb
input:
20 6 5 7 18 5 3 11 5 7 14 19 16 9 5 13 8 12 4 10 5 7 18 5 0 6 5 13 17 2 6 10 5 7 18 3 0 17 4 3 11 4 10 5 18 5 3 0 1 5 15 14 9 12 2 5 8 19 15 11 1 5 13 12 2 4 6 5 0 14 9 6 15 5 18 8 16 10 2 5 14 17 4 2 10 5 13 8 1 11 19 4 8 16 9 11 5 12 19 15 1 17 5 5 13 19 16 4 5 7 5 3 0 12 5 14 17 9 16 1
output:
5
result:
ok single line: '5'
Test #50:
score: 23
Accepted
time: 1ms
memory: 6104kb
input:
20 6 5 1 3 11 8 19 5 0 3 11 8 18 5 3 14 9 6 17 5 0 1 11 8 2 4 9 16 12 17 5 14 6 10 7 19 5 15 10 5 7 2 5 14 6 13 5 12 5 0 1 3 11 18 5 14 10 4 19 2 5 9 6 5 15 16 5 0 1 3 8 19 5 13 7 16 17 4 5 19 7 18 12 15 5 7 5 2 18 9 5 6 13 16 10 17 5 12 15 18 4 10 4 2 12 15 4 5 1 8 14 13 16 5 0 11 9 13 5
output:
5
result:
ok single line: '5'
Test #51:
score: 23
Accepted
time: 1ms
memory: 5884kb
input:
20 6 5 1 3 11 19 18 5 0 3 11 2 8 5 1 8 14 6 7 5 0 1 11 19 18 4 14 16 12 17 5 11 9 15 10 7 5 10 2 17 13 19 5 11 9 2 13 5 5 1 2 18 9 10 5 8 14 10 5 7 5 8 9 6 5 15 5 0 1 3 7 5 4 13 16 17 4 5 6 18 12 19 7 5 4 9 19 2 15 5 14 5 16 10 17 5 12 15 18 4 17 5 6 15 16 12 4 5 0 3 8 13 16 5 0 3 14 6 13
output:
4
result:
ok single line: '4'
Test #52:
score: 23
Accepted
time: 0ms
memory: 6140kb
input:
20 6 5 15 16 7 13 2 5 15 9 6 11 7 4 19 0 10 5 5 19 8 17 18 10 5 6 19 17 14 18 5 18 13 16 12 2 5 15 9 11 1 4 5 1 8 14 0 16 5 19 3 7 17 10 5 15 6 11 1 10 5 9 8 12 2 3 5 15 9 6 1 13 4 14 10 16 5 5 11 14 0 5 16 5 4 7 18 13 12 5 9 6 11 1 0 5 0 13 5 7 12 5 19 8 4 18 3 5 17 14 5 4 3 5 2 8 3 17 4
output:
5
result:
ok single line: '5'
Test #53:
score: 23
Accepted
time: 1ms
memory: 5840kb
input:
20 6 5 6 15 9 5 10 5 16 10 15 2 4 5 13 1 11 8 15 5 17 9 19 18 5 5 6 1 11 8 15 4 12 9 0 3 5 16 13 12 0 4 4 17 19 14 18 5 12 10 2 4 9 5 11 8 3 0 5 5 1 8 17 0 14 5 15 4 14 2 9 5 16 13 6 5 8 5 16 6 12 14 2 5 13 11 18 10 7 5 1 11 2 4 0 5 13 6 12 19 1 5 7 18 10 19 3 5 17 19 14 3 7 5 16 17 18 3 7
output:
4
result:
ok single line: '4'
Test #54:
score: 23
Accepted
time: 234ms
memory: 29508kb
input:
50000 10 9 32960 26666 36698 27825 19469 40251 7694 43050 49699 9 28680 11214 13759 31209 6922 20079 42730 11997 443 9 4366 42847 15773 31538 6839 18130 22993 45787 37886 9 29348 35251 38031 35020 29149 1972 33352 38984 8565 9 115 2566 8766 22339 44559 33816 38982 39958 14757 9 25095 44878 9405 3414...
output:
3
result:
ok single line: '3'
Test #55:
score: 23
Accepted
time: 0ms
memory: 5836kb
input:
20 6 5 15 4 19 16 11 5 6 2 16 11 4 5 5 1 16 4 11 5 13 15 19 17 11 5 12 5 0 1 2 5 6 12 13 4 2 5 14 8 12 5 1 5 15 17 9 19 10 5 6 14 12 10 18 5 14 18 7 10 13 5 8 18 7 9 15 5 0 3 1 2 19 5 6 14 8 5 4 5 5 15 9 16 3 5 6 8 12 9 18 5 7 10 13 0 3 4 13 0 1 2 4 18 7 3 19 5 14 8 10 9 17 5 7 0 3 11 17
output:
4
result:
ok single line: '4'
Test #56:
score: 23
Accepted
time: 229ms
memory: 29460kb
input:
50000 10 9 18221 24348 28479 32271 21508 5821 37624 9018 33124 9 48435 19120 33947 16663 10731 19082 3065 40727 44231 9 8392 15905 25517 41543 39444 36504 566 37551 40373 9 20939 21154 38126 10687 26894 2326 12921 20390 2714 9 14948 6508 31983 31691 34972 40530 12060 47377 2856 9 23609 46381 2820 10...
output:
9
result:
ok single line: '9'
Test #57:
score: 23
Accepted
time: 1ms
memory: 5940kb
input:
20 6 5 16 5 12 1 10 5 18 16 0 12 5 5 17 8 19 15 12 5 16 11 15 4 14 5 17 9 18 3 13 5 18 0 12 11 1 4 9 10 15 14 4 19 16 15 14 5 17 2 19 9 18 5 8 4 13 10 6 5 19 9 0 11 6 5 16 5 13 3 10 5 2 0 5 1 14 5 17 9 18 11 4 5 12 15 6 3 7 5 2 7 3 14 6 5 0 7 3 1 11 5 2 8 19 4 13 5 8 13 1 4 5 5 17 2 8 10 7
output:
4
result:
ok single line: '4'
Test #58:
score: 23
Accepted
time: 241ms
memory: 29512kb
input:
50000 10 9 30916 34063 27476 12900 46395 22896 47608 43081 36522 9 16351 22058 41003 24951 7867 48553 13812 49227 33653 9 36974 23275 29390 3513 7459 24365 39720 13308 13381 9 23313 2154 1965 47951 3036 3520 39921 2505 45510 9 26552 21810 45179 45599 42706 8524 40981 10314 41981 9 28751 42098 9588 3...
output:
3
result:
ok single line: '3'
Test #59:
score: 23
Accepted
time: 240ms
memory: 29528kb
input:
50000 10 9 36291 13684 8347 34254 12584 37577 428 26971 9897 9 40409 37917 32242 100 45061 18975 24937 35545 24459 9 13393 18678 47226 14718 46930 29116 8563 37330 25359 9 40338 36151 31599 38218 1112 13318 37682 22003 47175 9 48311 27488 6179 7201 6029 46048 36501 39894 10935 9 11562 47084 35646 42...
output:
8
result:
ok single line: '8'
Test #60:
score: 23
Accepted
time: 238ms
memory: 29532kb
input:
50000 10 9 22942 19769 29417 38608 40165 46830 44014 13319 37296 9 3043 34405 43649 24780 34419 42631 151 10305 38128 9 47024 16918 48040 35472 18738 33438 45666 41028 9331 9 9377 31552 35570 28 35640 41742 33336 39699 32963 9 1900 27606 40345 8319 7839 39689 17311 23129 27713 9 20767 12281 36915 48...
output:
9
result:
ok single line: '9'
Test #61:
score: 23
Accepted
time: 238ms
memory: 29764kb
input:
50000 10 9 33482 45772 34312 33638 12738 33479 8340 36848 22625 9 21110 17374 20244 27086 24069 6775 17172 41563 6524 9 12635 39283 48676 30823 19997 34534 2173 9767 11985 9 2858 29801 12693 1285 26074 28461 23409 11329 41503 9 3677 38114 49641 48097 5284 7283 42343 49703 30073 9 41159 35068 37355 2...
output:
8
result:
ok single line: '8'
Subtask #4:
score: 38
Accepted
Dependency #2:
100%
Accepted
Test #62:
score: 38
Accepted
time: 25ms
memory: 8012kb
input:
5000 10 8 415 4313 1205 4758 1297 1429 3619 3886 8 1128 895 3410 4204 347 4819 3970 2565 8 97 1225 4312 3744 3696 1856 2358 2201 8 4926 1743 3446 3234 954 3143 3434 1072 8 3850 428 1718 1749 138 547 3166 2383 8 3752 3364 836 730 3155 2342 617 216 8 2765 4320 2337 2650 4267 710 1407 4857 8 534 1837 4...
output:
10
result:
ok single line: '10'
Test #63:
score: 38
Accepted
time: 0ms
memory: 5944kb
input:
13 5 3 12 11 3 2 8 7 2 8 4 2 8 0 3 7 10 2 2 8 12 2 8 11 3 10 4 1 6 5 3 6 1 9 2 2 8 10 3 7 4 9 3 12 0 6 3 0 11 5
output:
3
result:
ok single line: '3'
Test #64:
score: 38
Accepted
time: 8ms
memory: 7028kb
input:
5000 4 1 954 1 1969 3 1365 3710 2653 3 182 4106 1375 3 1364 4333 1180 3 1077 3539 653 3 4740 1810 59 1 2396 9 3388 939 1702 4781 2000 722 4220 1757 1789 3 1089 2158 4680 4 1340 2014 3941 3463 2 266 1848 2 4196 150 3 4692 318 2777 3 1875 2537 1061 4 3685 3828 3137 54 7 4821 2029 4574 4418 2522 174 83...
output:
4
result:
ok single line: '4'
Test #65:
score: 38
Accepted
time: 12ms
memory: 8000kb
input:
5000 6 15 428 1653 2671 571 28 1061 3651 4585 688 796 3838 953 2157 2156 987 10 934 4116 2697 3485 4368 3329 2121 3641 1077 2690 5 4275 2968 968 3377 3484 7 1001 4263 469 3138 4110 2401 3257 4 4243 3935 3592 3061 11 4983 1304 1961 2740 625 4106 2295 2819 3445 431 2977 3 3052 3269 4707 7 2531 3671 36...
output:
5
result:
ok single line: '5'
Test #66:
score: 38
Accepted
time: 3ms
memory: 7060kb
input:
5000 4 3 2901 2096 564 9 3501 1651 2286 4973 215 2381 2568 2740 2146 3 511 4136 2521 6 2137 1327 956 2393 1403 364 3 1979 3798 4240 3 2800 612 1231 3 2410 4793 2258 7 1322 4694 4224 199 1824 356 247 3 3708 4092 2141 1 4213 6 3597 2071 2213 925 3402 1740 2 2153 2348 2 1734 144 6 1434 3070 1627 3584 4...
output:
3
result:
ok single line: '3'
Test #67:
score: 38
Accepted
time: 8ms
memory: 8008kb
input:
5000 6 8 4423 3283 796 3749 4689 3150 3994 1911 5 4532 1308 4505 3144 1961 19 4564 2980 2166 952 1859 4448 3663 2924 528 4838 4852 2845 2769 3416 1638 4569 3593 3627 3527 10 2155 4921 1838 2380 1349 3283 4920 327 4246 4144 7 2928 1880 3503 4738 1790 3514 284 10 3677 778 3116 2636 4774 2061 2089 196 ...
output:
5
result:
ok single line: '5'
Test #68:
score: 38
Accepted
time: 15ms
memory: 8240kb
input:
5000 8 10 4540 2016 2926 1793 2861 2152 1164 4210 4852 3179 3 142 3697 1966 1 400 4 2541 156 4454 4780 8 1129 736 985 3428 4198 4511 3422 2866 3 4294 547 4126 9 590 4602 1492 314 1386 1212 1384 4302 957 12 662 1244 3026 4858 1265 2997 929 4355 482 1647 3405 3065 9 4168 3246 446 1470 1555 2407 1121 3...
output:
5
result:
ok single line: '5'
Test #69:
score: 38
Accepted
time: 37ms
memory: 9852kb
input:
5000 9 22 4420 4251 2829 4897 322 925 456 4418 2793 1065 3380 4769 4045 1500 1305 610 2440 726 1208 185 4883 1001 13 1733 1772 2975 1721 1098 3368 2202 3784 2365 4880 4396 1592 2694 14 4227 4370 4860 3774 2110 979 1467 880 1749 3984 906 3090 462 3037 9 4568 1106 697 2276 1747 2199 651 2464 1483 20 3...
output:
9
result:
ok single line: '9'
Test #70:
score: 38
Accepted
time: 4ms
memory: 6560kb
input:
5000 2 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360 1 360...
output:
2
result:
ok single line: '2'
Test #71:
score: 38
Accepted
time: 28ms
memory: 10348kb
input:
5000 10 9 4774 2995 771 4389 593 395 3234 1235 2652 9 4774 2995 771 4389 593 395 3234 1235 2652 9 4774 2995 771 4389 593 395 3234 1235 2652 9 4774 2995 771 4389 593 395 3234 1235 2652 9 4774 2995 771 4389 593 395 3234 1235 2652 9 4774 2995 771 4389 593 395 3234 1235 2652 9 4774 2995 771 4389 593 395...
output:
2
result:
ok single line: '2'
Test #72:
score: 38
Accepted
time: 45ms
memory: 10520kb
input:
5000 10 21 4719 4614 32 1090 3296 2163 627 679 16 1596 973 2269 1185 308 1553 1631 577 2974 947 3194 2667 30 358 4065 3898 4980 4125 4326 4819 1243 2161 4999 3654 3711 3188 2369 3830 94 2735 4885 4793 3402 3070 3412 4938 4286 4377 2194 637 36 3069 716 26 297 4200 3048 1886 3227 4843 4266 848 3036 28...
output:
10
result:
ok single line: '10'
Test #73:
score: 38
Accepted
time: 4ms
memory: 6668kb
input:
5000 10 1 1732 1 2626 1 1401 1 1065 1 4994 1 4761 1 3718 1 4536 1 4761 1 1508 1 539 1 3809 1 606 1 3281 1 4536 1 4194 1 1209 1 3718 1 2235 1 137 1 513 1 3096 1 3096 1 3847 1 1401 1 2468 1 1719 1 3281 1 3096 1 3191 1 1223 1 1732 1 3281 1 2468 1 4921 1 2588 1 2150 1 4917 1 4475 1 4917 1 2150 1 1078 1 ...
output:
2
result:
ok single line: '2'
Test #74:
score: 38
Accepted
time: 0ms
memory: 6684kb
input:
5000 2 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142 1 142...
output:
2
result:
ok single line: '2'
Test #75:
score: 38
Accepted
time: 2ms
memory: 6204kb
input:
5000 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
1
result:
ok single line: '1'
Test #76:
score: 38
Accepted
time: 25ms
memory: 10412kb
input:
5000 10 9 3798 4118 2771 52 1524 1134 2188 3058 3792 9 3798 4118 2771 52 1524 1134 2188 3058 3792 9 3798 4118 2771 52 1524 1134 2188 3058 3792 9 3798 4118 2771 52 1524 1134 2188 3058 3792 9 3798 4118 2771 52 1524 1134 2188 3058 3792 9 3798 4118 2771 52 1524 1134 2188 3058 3792 9 3798 4118 2771 52 15...
output:
2
result:
ok single line: '2'
Test #77:
score: 38
Accepted
time: 3ms
memory: 7296kb
input:
5000 6 4 1221 3585 4994 2405 4 3930 1963 4440 4723 4 2219 2278 4797 1589 4 4169 2960 4777 165 4 3262 4750 1244 2620 4 3359 3166 3297 867 4 1617 4806 170 1647 4 2628 4244 3276 3529 4 4664 2146 1234 3722 4 3994 2311 4021 3918 4 4390 1462 3507 194 4 4484 2155 1071 1410 4 3348 4420 2290 1238 4 1969 4382...
output:
6
result:
ok single line: '6'
Test #78:
score: 38
Accepted
time: 4ms
memory: 6604kb
input:
5000 10 1 4209 1 1309 1 1891 1 3791 1 3583 1 3583 1 511 1 3959 1 782 1 3791 1 2756 1 4805 1 1579 1 3926 1 1150 1 3701 1 1149 1 2893 1 3709 1 3342 1 3791 1 2974 1 109 1 4209 1 1081 1 1150 1 4363 1 2893 1 904 1 4459 1 318 1 482 1 1081 1 557 1 1219 1 1081 71 252 4757 4357 2472 1672 1621 412 3325 3748 2...
output:
2
result:
ok single line: '2'
Test #79:
score: 38
Accepted
time: 5ms
memory: 7088kb
input:
5000 6 4 1426 2737 1216 4770 4 4638 4649 4080 858 4 3235 3528 52 2350 4 1170 1356 3306 3872 4 4444 2711 1194 3114 4 582 1027 85 892 4 3097 4205 3162 712 4 1134 4810 3067 101 4 946 1661 925 2171 4 2470 194 3986 2610 4 4289 665 604 756 4 2257 3122 4967 2058 4 516 3537 629 3223 4 1329 3011 3604 1190 4 ...
output:
6
result:
ok single line: '6'
Test #80:
score: 38
Accepted
time: 3ms
memory: 7088kb
input:
5000 7 4 1426 2737 1216 4770 4 4638 4649 4080 858 4 3235 3528 52 2350 4 1170 1356 3306 3872 4 4444 2711 1194 3114 4 582 1027 85 892 4 3097 4205 3162 712 4 1134 4810 3067 101 4 946 1661 925 2171 4 2470 194 3986 2610 4 4289 665 604 756 4 2257 3122 4967 2058 4 516 3537 629 3223 4 1329 3011 3604 1190 4 ...
output:
6
result:
ok single line: '6'
Test #81:
score: 38
Accepted
time: 28ms
memory: 7964kb
input:
5000 10 8 2665 4683 3769 4208 2989 2050 1574 1054 8 1200 1502 2745 2097 625 3130 1520 968 8 2077 4826 1563 4904 2405 1418 1532 41 8 4472 1693 4754 3589 1443 2672 3819 4893 8 3611 4477 2704 3461 1046 2257 1782 3801 8 3829 3981 1441 4980 2988 4743 619 578 8 1834 570 2563 431 1010 57 685 3153 8 1094 34...
output:
10
result:
ok single line: '10'
Test #82:
score: 38
Accepted
time: 20ms
memory: 7992kb
input:
5000 10 7 4683 3769 4208 2989 2050 1574 1054 7 4389 4058 2658 1200 1502 2745 2097 7 2077 4826 1563 4904 2405 1418 1532 7 3819 4893 1860 3833 3612 134 891 7 1046 2257 1782 3801 166 4782 1518 7 4644 3822 3829 3981 1441 4980 2988 7 4466 562 1261 4813 1834 570 2563 7 1258 3029 411 3457 1094 3466 3520 7 ...
output:
9
result:
ok single line: '9'
Test #83:
score: 38
Accepted
time: 6ms
memory: 7036kb
input:
5000 4 5 2901 4565 4670 1865 2976 4 4704 4546 3078 3306 5 101 3723 3328 4640 4562 2 2738 438 5 2084 1397 3468 1414 4201 2 239 761 3 1149 2590 4799 4 1150 703 4632 4968 2 3118 3482 2 4861 4239 5 644 4500 3009 2798 1757 2 1122 1479 4 4520 164 100 1903 4 2297 1881 3919 4156 2 4487 2645 4 1216 2519 1042...
output:
4
result:
ok single line: '4'
Test #84:
score: 38
Accepted
time: 3ms
memory: 7144kb
input:
5000 7 4 3105 1107 367 2500 4 4724 2815 4821 2324 4 206 2559 1576 284 4 4983 3286 1025 4475 4 4492 4856 2309 2033 4 2454 2226 3862 3677 4 2962 112 967 1369 4 51 3946 1289 1943 4 4378 2576 727 4582 4 726 748 4081 3496 4 841 497 2079 4932 4 4925 1942 3303 3135 4 2366 3227 1245 2886 4 905 3052 4557 663...
output:
6
result:
ok single line: '6'
Test #85:
score: 38
Accepted
time: 20ms
memory: 8644kb
input:
5000 10 11 4083 4738 759 3977 2187 3409 2695 3298 2087 2414 304 7 1597 664 3232 3968 3927 1282 3947 15 4030 3605 773 1687 837 398 1011 4737 3446 3405 2235 311 2928 2713 180 11 1619 1190 586 3331 3162 4561 719 3918 3340 2662 2343 17 1313 1484 3697 4186 1257 686 3461 945 97 887 2199 3261 3689 2530 321...
output:
10
result:
ok single line: '10'
Test #86:
score: 38
Accepted
time: 16ms
memory: 7772kb
input:
5000 10 7 2275 4863 861 774 735 2630 2470 7 949 3746 1972 1327 973 4509 2918 7 2071 3397 2685 845 3518 16 184 7 3370 2329 3484 1498 4907 1391 537 7 1822 1758 1561 1352 2669 178 838 7 1354 4714 2821 4939 1777 4922 1604 7 1555 895 4500 4943 3592 3377 1646 7 1976 2573 3024 1583 4131 2192 4929 7 84 3864...
output:
9
result:
ok single line: '9'
Test #87:
score: 38
Accepted
time: 3ms
memory: 7200kb
input:
5000 4 5 2028 4773 1717 1276 3638 5 4654 1426 3496 4083 1870 6 1650 2382 1754 274 527 4924 3 2197 533 657 5 3961 4453 1182 2490 1794 1 360 3 1369 1020 214 1 2494 1 4037 6 2771 4141 4474 2985 363 4304 5 3946 4146 3381 3410 4792 2 324 1421 2 4015 673 4 3666 3094 3727 765 6 173 942 607 1117 634 3103 3 ...
output:
4
result:
ok single line: '4'
Test #88:
score: 38
Accepted
time: 13ms
memory: 7984kb
input:
5000 8 5 955 2769 1242 2210 2092 15 1570 2246 1606 4050 1246 1351 2342 2070 3274 235 3992 3142 86 3746 1485 10 3882 1004 4076 9 1561 2054 1627 3064 469 1805 12 3928 3412 375 4780 1114 3843 284 1515 835 1058 1612 3038 5 4217 1425 4522 1686 4125 6 3419 2239 562 677 1891 239 6 441 2480 524 238 1777 339...
output:
7
result:
ok single line: '7'
Test #89:
score: 38
Accepted
time: 23ms
memory: 8576kb
input:
5000 10 9 2076 4042 2887 3864 4448 599 4100 2629 4811 9 1409 3096 554 4844 917 665 1670 1301 4281 13 3976 2751 2411 1606 4629 3968 4891 3912 936 4887 1746 1404 2817 9 1656 3009 4487 4982 537 1447 3637 1771 2405 5 4596 2642 3590 3612 4582 4 4821 1833 511 3341 11 3305 4596 2977 4240 3252 2673 2199 185...
output:
10
result:
ok single line: '10'
Test #90:
score: 38
Accepted
time: 17ms
memory: 8244kb
input:
5000 10 9 4371 1161 80 65 1960 1011 814 3113 4001 6 2088 1271 4556 4551 1610 909 13 2782 3604 1148 1963 2935 630 2348 3405 4479 3571 4784 3876 2394 14 2005 659 1987 2984 853 1911 1519 2737 3053 2850 4367 213 4386 341 10 3716 4853 372 1264 115 1135 1867 4465 4926 2707 9 3063 3652 4714 1843 1043 2993 ...
output:
9
result:
ok single line: '9'
Test #91:
score: 38
Accepted
time: 3ms
memory: 6680kb
input:
5000 8 2 1271 2047 2 1491 4274 2 3114 9 2 2778 1855 2 1571 4005 2 3681 250 2 3300 3813 2 1931 4585 2 522 3002 2 2 3288 2 1619 3299 2 1514 3690 2 2614 2213 2 4879 95 2 305 4006 2 2301 986 2 4575 3406 2 4373 1830 2 350 3366 2 3652 2578 2 4818 570 2 3452 4435 2 2543 4832 2 3474 4491 2 2098 995 2 2388 4...
output:
2
result:
ok single line: '2'
Test #92:
score: 38
Accepted
time: 14ms
memory: 7928kb
input:
5000 8 6 1273 2927 4073 1085 269 3135 9 4335 651 1461 835 447 402 4754 4279 3698 6 1722 513 2564 431 244 2453 8 1497 3522 1187 4309 1389 4781 1350 1395 9 1445 2339 1310 1580 3551 3468 2833 744 1217 15 2913 4872 1598 1708 2452 2225 783 1401 705 4845 4757 3819 3583 3226 604 10 3918 4273 475 2445 77 57...
output:
7
result:
ok single line: '7'
Test #93:
score: 38
Accepted
time: 20ms
memory: 8384kb
input:
5000 10 14 2121 1842 387 792 472 27 3022 4691 2560 2531 1279 4583 2165 3341 9 3310 57 2076 287 2856 1153 4553 2786 136 11 4775 3081 4782 3570 515 3854 408 1376 170 3747 829 10 3645 1954 2778 2370 2651 2261 1294 3154 101 425 8 473 117 212 3796 4133 3352 3816 2351 2 4987 3774 11 3597 4042 1179 185 53 ...
output:
9
result:
ok single line: '9'
Test #94:
score: 38
Accepted
time: 10ms
memory: 7604kb
input:
5000 7 6 4667 4252 3725 4591 3289 2122 4 4357 3815 3374 510 6 2528 2405 3442 2369 2195 1989 6 99 4129 2528 3511 104 2219 3 4667 3785 1396 3 4667 4166 1782 1 4667 4 4667 4607 3037 3557 4 4357 1470 4249 3886 4 4357 3642 3086 316 10 4357 1255 2266 700 1354 3199 896 3153 531 1544 4 4357 4616 4958 4497 4...
output:
3
result:
ok single line: '3'
Test #95:
score: 38
Accepted
time: 25ms
memory: 9100kb
input:
5000 10 15 4486 3509 2397 4627 1054 2864 4196 13 1401 1259 2947 2677 646 4905 1383 14 4970 3575 679 703 3554 3791 4440 4937 1343 2708 3671 2209 1590 506 9 3164 3789 1128 2334 2243 2987 3420 1967 826 14 1307 4193 1026 1779 234 2505 1199 1922 5 2423 4683 17 1177 69 13 4407 3144 4643 1844 3593 1951 213...
output:
2
result:
ok single line: '2'
Test #96:
score: 38
Accepted
time: 0ms
memory: 6668kb
input:
5000 8 2 4942 4811 2 4007 4808 2 2857 1086 2 1016 2398 2 4626 134 2 2831 1623 2 2976 3972 2 1784 348 2 4692 4467 2 2034 4361 2 2789 1155 2 2643 4336 2 2610 3651 2 2450 4035 2 2986 2972 2 2927 3396 2 2583 2404 2 487 4904 2 2868 4772 2 337 818 2 422 2939 2 3913 3020 2 3914 4063 2 4073 534 2 2514 3682 ...
output:
2
result:
ok single line: '2'
Test #97:
score: 38
Accepted
time: 12ms
memory: 7632kb
input:
2506 10 10 646 2438 1217 1426 1327 220 2258 1707 1958 730 10 196 1817 189 2268 1475 295 153 1526 670 592 10 1192 2262 2300 11 39 1672 753 316 455 2366 12 1988 1453 1787 597 1451 2143 816 1748 1779 822 103 1274 9 102 750 2269 1830 1572 1816 1278 1395 1029 12 2044 1149 925 2055 678 662 1924 60 170 111...
output:
2
result:
ok single line: '2'
Test #98:
score: 38
Accepted
time: 9ms
memory: 7396kb
input:
5000 7 6 3914 1617 1232 4755 1485 1696 6 109 823 1975 2573 2058 4402 5 70 3259 4541 2288 2910 3 1851 1419 1663 5 70 2140 1918 1639 3760 8 1851 770 4102 2694 2158 1798 430 1370 5 1851 3884 4141 3902 224 6 1805 3633 1367 4595 3828 1681 6 3859 2564 2113 1905 1109 3511 3 1851 113 4659 6 151 2784 3761 28...
output:
3
result:
ok single line: '3'
Test #99:
score: 38
Accepted
time: 24ms
memory: 8892kb
input:
5000 10 12 2945 101 3225 950 2664 1811 1077 4995 4971 1174 1069 3355 9 845 3803 3653 3826 171 608 932 3542 1962 10 4933 2236 3334 615 2745 2235 1928 969 1250 1831 13 3685 4850 732 1198 2561 689 49 3584 4789 2194 2933 2494 1449 12 4840 1069 4415 3205 586 4351 3764 3998 4039 2000 2797 99 9 4623 3901 1...
output:
2
result:
ok single line: '2'
Test #100:
score: 38
Accepted
time: 3ms
memory: 6248kb
input:
1242 6 2 1070 549 2 474 280 2 1179 524 2 1070 1031 2 572 192 2 1183 581 2 162 803 2 776 631 2 247 568 2 1031 828 2 97 244 2 631 784 2 549 524 2 221 443 2 631 785 2 1194 474 2 140 1031 2 911 399 2 721 1018 2 376 776 2 433 1179 2 192 785 2 140 162 2 480 847 2 140 849 2 549 756 2 135 474 2 1018 549 2 7...
output:
2
result:
ok single line: '2'
Test #101:
score: 38
Accepted
time: 6ms
memory: 7380kb
input:
2506 10 10 1413 1949 1743 541 1254 534 2082 2359 2365 1708 11 1451 875 2264 1427 36 2336 1998 595 1172 1006 826 12 1428 690 410 381 2128 1748 936 773 188 2410 1054 1000 16 1095 2062 124 1778 2411 1310 251 803 1595 955 2106 2273 270 1768 449 1479 9 419 1415 1345 711 1127 691 144 1315 1998 9 191 1532 ...
output:
2
result:
ok single line: '2'
Test #102:
score: 38
Accepted
time: 10ms
memory: 8224kb
input:
5000 10 9 652 366 219 2759 985 1497 2869 2321 436 9 1412 2808 2113 4176 4681 2165 1829 4340 2125 9 3475 4293 4844 2113 2467 4365 2522 2648 4029 9 3838 384 4093 2668 1865 76 1196 2337 4385 9 4624 4350 744 926 1058 2124 1729 1798 2598 9 2215 4567 4122 4990 1255 810 3941 4695 3772 9 1552 3774 4081 3874...
output:
8
result:
ok single line: '8'
Test #103:
score: 38
Accepted
time: 2ms
memory: 6264kb
input:
1242 6 2 1080 748 2 761 687 2 494 189 2 37 454 2 785 828 2 663 437 2 663 1015 2 494 447 2 1077 1015 2 998 748 2 1218 785 2 37 144 2 446 146 2 434 454 2 421 748 2 645 148 2 1011 920 2 545 344 2 477 687 2 665 920 2 220 920 2 761 437 2 475 1218 2 90 148 2 1201 477 2 593 477 2 761 297 2 421 37 2 201 187...
output:
2
result:
ok single line: '2'
Test #104:
score: 38
Accepted
time: 19ms
memory: 8200kb
input:
5000 10 9 1899 2179 734 4958 4332 664 3771 3092 648 9 499 3571 436 734 2184 3827 4101 1535 2681 9 676 1092 4517 4433 1352 2256 2324 307 2782 9 2709 2602 650 1291 468 1982 580 3967 2225 9 4048 2103 4128 2186 2473 4771 1635 3357 258 9 3991 2395 662 4640 4715 3058 1668 4465 1315 9 2540 1616 3140 4851 2...
output:
8
result:
ok single line: '8'
Subtask #5:
score: 23
Accepted
Dependency #2:
100%
Accepted
Test #105:
score: 23
Accepted
time: 0ms
memory: 5908kb
input:
13 5 3 12 11 3 2 8 7 2 8 4 2 8 0 3 7 10 2 2 8 12 2 8 11 3 10 4 1 6 5 3 6 1 9 2 2 8 10 3 7 4 9 3 12 0 6 3 0 11 5
output:
3
result:
ok single line: '3'
Test #106:
score: 23
Accepted
time: 136ms
memory: 22468kb
input:
50000 4 6 28644 7241 44842 35716 36549 26219 6 8122 47674 49850 18114 450 45346 3 40902 21733 36694 3 23761 6475 10970 5 23477 22294 5080 41980 20267 3 36647 26694 39277 3 43235 10361 41195 5 36713 18331 17695 35331 17731 7 39060 21880 26763 21335 35150 23221 43082 4 8617 43822 7539 40857 8 8697 179...
output:
4
result:
ok single line: '4'
Test #107:
score: 23
Accepted
time: 56ms
memory: 15468kb
input:
49999 5 2 3329 37935 2 3329 6434 3 18453 26774 20506 2 3329 39322 2 3329 45694 3 24606 18513 7496 3 31837 20978 7482 2 3329 22018 3 21924 22656 46652 3 43444 4185 15950 3 40562 4349 13842 3 4789 11904 5726 2 3329 24091 3 3226 8237 33063 3 16544 40501 29519 3 2282 44483 24831 2 3329 40469 2 3329 2161...
output:
3
result:
ok single line: '3'
Test #108:
score: 23
Accepted
time: 137ms
memory: 22716kb
input:
50000 5 4 18326 49198 21407 30175 4 41876 26872 4872 7364 3 24272 9125 24372 5 4418 11469 10203 29160 26666 9 32013 23205 26923 23728 47444 29067 25425 3412 41839 2 30585 33431 7 46374 10022 28589 26021 45076 27212 45791 8 46167 41985 16304 28400 32508 7868 27181 21674 3 40053 20756 18519 3 36256 53...
output:
5
result:
ok single line: '5'
Test #109:
score: 23
Accepted
time: 126ms
memory: 22776kb
input:
50000 4 3 27690 45935 7244 4 24045 37440 11741 39738 4 6355 10971 1736 37663 3 27242 12258 12361 3 45569 12076 30848 4 11154 15463 28341 23449 3 6960 35347 23511 8 24949 24627 22244 17949 35873 28075 21197 37824 6 492 21983 41235 38348 31240 18322 16 13072 31942 30276 46896 49723 31852 28854 19152 2...
output:
4
result:
ok single line: '4'
Test #110:
score: 23
Accepted
time: 34ms
memory: 13164kb
input:
50000 2 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31401 1 31...
output:
2
result:
ok single line: '2'
Test #111:
score: 23
Accepted
time: 122ms
memory: 27380kb
input:
50000 5 4 47265 6761 19876 15469 4 47265 6761 19876 15469 4 47265 6761 19876 15469 4 47265 6761 19876 15469 4 47265 6761 19876 15469 4 47265 6761 19876 15469 4 47265 6761 19876 15469 4 47265 6761 19876 15469 4 47265 6761 19876 15469 4 47265 6761 19876 15469 4 47265 6761 19876 15469 4 47265 6761 1987...
output:
2
result:
ok single line: '2'
Test #112:
score: 23
Accepted
time: 138ms
memory: 22468kb
input:
50000 5 5 37630 5898 47632 2581 10233 8 36675 33357 35788 30053 30373 17381 22420 16792 5 22998 46387 49495 17511 38841 8 26759 49432 20445 16907 2692 1106 38310 14328 7 39260 33669 7342 12983 49571 16239 37900 6 33656 25001 4414 27358 48411 19124 8 37360 7818 37102 9223 24067 23414 15423 7664 3 257...
output:
4
result:
ok single line: '4'
Test #113:
score: 23
Accepted
time: 29ms
memory: 13168kb
input:
50000 5 1 49842 1 38059 1 11719 1 20260 1 43825 1 39042 1 32706 1 21188 1 14353 1 33004 1 7064 1 38059 1 37477 1 23717 1 4934 1 29189 1 22409 1 9883 1 39042 1 7562 1 17352 1 30436 1 33738 1 47336 1 22409 1 11944 1 18754 1 25253 1 48601 1 42063 1 9117 1 27049 1 27737 1 36725 1 17352 1 31225 1 17861 1...
output:
2
result:
ok single line: '2'
Test #114:
score: 23
Accepted
time: 33ms
memory: 13164kb
input:
50000 2 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34172 1 34...
output:
2
result:
ok single line: '2'
Test #115:
score: 23
Accepted
time: 7ms
memory: 8672kb
input:
50000 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
1
result:
ok single line: '1'
Test #116:
score: 23
Accepted
time: 121ms
memory: 27216kb
input:
50000 5 4 49952 31787 5280 37605 4 49952 31787 5280 37605 4 49952 31787 5280 37605 4 49952 31787 5280 37605 4 49952 31787 5280 37605 4 49952 31787 5280 37605 4 49952 31787 5280 37605 4 49952 31787 5280 37605 4 49952 31787 5280 37605 4 49952 31787 5280 37605 4 49952 31787 5280 37605 4 49952 31787 528...
output:
2
result:
ok single line: '2'
Test #117:
score: 23
Accepted
time: 19ms
memory: 10716kb
input:
50000 3 1 38725 1 41206 1 37487 1 17405 1 21652 1 21315 1 49262 1 3695 1 12297 1 27974 1 15625 1 4793 1 17268 1 2507 1 10701 1 6709 1 7152 1 3849 1 25674 1 48265 1 30875 1 41828 1 23284 1 593 1 3964 1 26267 1 2883 1 48289 1 21064 1 36527 1 19860 1 18198 1 40318 1 42121 1 10601 1 40635 1 16972 1 4260...
output:
3
result:
ok single line: '3'
Test #118:
score: 23
Accepted
time: 38ms
memory: 13164kb
input:
50000 5 1 23834 1 47886 1 30640 1 43417 1 15672 1 37456 1 13846 1 32206 1 14393 1 6170 1 11290 1 27528 1 45378 1 9154 1 6931 1 2332 1 45336 1 33682 1 24274 1 26365 1 46359 1 12437 1 10555 1 2333 1 43030 1 49258 1 21076 1 32206 1 14143 1 8322 1 46359 1 34414 1 26365 1 43199 1 2246 1 3087 1 43199 1 40...
output:
2
result:
ok single line: '2'
Test #119:
score: 23
Accepted
time: 39ms
memory: 15468kb
input:
50000 5 3 15589 29636 44644 3 42705 25241 12125 3 48276 47139 27663 3 3652 2498 15950 3 45194 1591 8562 3 34402 17417 18469 3 10945 22449 13294 3 24272 47490 25770 3 38806 41444 46150 3 35089 38027 27140 3 8441 45357 930 3 16519 9135 42933 3 21589 2390 34605 3 12168 42548 46855 3 1109 16380 49267 3 ...
output:
5
result:
ok single line: '5'
Test #120:
score: 23
Accepted
time: 22ms
memory: 11008kb
input:
50000 3 1 24981 1 45292 1 39593 1 2183 1 3024 1 34770 1 24078 1 19340 1 45986 1 11853 1 7086 1 35502 1 14427 1 27053 1 26191 1 23306 1 29016 1 45400 1 27009 1 34028 1 1460 1 7031 1 22452 1 38730 1 14072 1 22294 1 38514 1 45818 1 24207 1 40195 1 47166 1 30537 1 11263 1 48799 1 30365 1 48518 1 23802 1...
output:
3
result:
ok single line: '3'
Test #121:
score: 23
Accepted
time: 21ms
memory: 10828kb
input:
50000 4 1 24981 1 45292 1 39593 1 2183 1 3024 1 34770 1 24078 1 19340 1 45986 1 11853 1 7086 1 35502 1 14427 1 27053 1 26191 1 23306 1 29016 1 45400 1 27009 1 34028 1 1460 1 7031 1 22452 1 38730 1 14072 1 22294 1 38514 1 45818 1 24207 1 40195 1 47166 1 30537 1 11263 1 48799 1 30365 1 48518 1 23802 1...
output:
3
result:
ok single line: '3'
Test #122:
score: 23
Accepted
time: 36ms
memory: 15664kb
input:
50000 5 3 14348 36608 38193 3 23351 27756 27171 3 27032 26844 24620 3 19613 3633 5749 3 12518 25896 18022 3 14540 13903 25752 3 15936 25725 49802 3 22591 25760 812 3 11431 34242 30821 3 26395 17664 17669 3 5254 7962 31350 3 49216 27080 13727 3 8600 11870 41231 3 18342 13883 11420 3 49618 25089 30732...
output:
5
result:
ok single line: '5'
Test #123:
score: 23
Accepted
time: 24ms
memory: 13120kb
input:
50000 5 2 36608 38193 2 23351 27756 2 30398 27032 2 19613 3633 2 12518 25896 2 25752 6525 2 15936 25725 2 22591 25760 2 30821 27942 2 17664 17669 2 7962 31350 2 27080 13727 2 41231 37897 2 18342 13883 2 42407 49618 2 10887 4658 2 10399 20058 2 49036 33600 2 11261 23186 2 42860 30775 2 6620 11680 2 1...
output:
4
result:
ok single line: '4'
Test #124:
score: 23
Accepted
time: 67ms
memory: 16648kb
input:
50000 4 4 34268 14175 49134 10600 1 5278 3 23945 38250 47976 4 39244 7714 9298 42562 2 21574 1521 7 19609 6044 31824 42601 13223 41484 46720 4 10162 14846 34834 9156 1 10224 12 32255 8729 48577 13021 17101 37098 39637 32457 42026 6748 18894 42220 3 10791 37443 3508 6 42163 25741 4349 4715 8437 29107...
output:
4
result:
ok single line: '4'
Test #125:
score: 23
Accepted
time: 22ms
memory: 10784kb
input:
50000 4 1 9779 1 37114 1 3184 1 6049 1 9985 1 19489 1 509 1 5414 1 10827 1 7926 1 40457 1 47910 1 34548 1 15197 1 26960 1 28586 1 29943 1 21209 1 40069 1 40734 1 48456 1 15903 1 31545 1 19483 1 7100 1 34891 1 38051 1 38281 1 45109 1 9389 1 13950 1 47927 1 9869 1 524 1 28792 1 13992 1 8987 1 19405 1 ...
output:
3
result:
ok single line: '3'
Test #126:
score: 23
Accepted
time: 91ms
memory: 19260kb
input:
50000 5 3 1332 32113 12594 1 5550 4 23638 8241 37885 33082 6 45091 24750 28746 49656 49116 22014 7 45947 46124 13588 30098 3728 46782 44741 6 23050 39362 1901 42617 8420 24342 4 27908 42076 34196 25463 3 33315 12138 41071 10 47034 27455 22675 48237 16873 36180 42419 37408 7307 29819 4 29862 20021 14...
output:
5
result:
ok single line: '5'
Test #127:
score: 23
Accepted
time: 28ms
memory: 13360kb
input:
50000 5 2 38788 5872 2 23724 36406 2 28613 39474 2 41021 23351 2 5039 6581 2 48919 31869 2 41647 9497 2 22662 4937 2 31769 17955 2 9839 19524 2 25225 6315 2 12393 45586 2 11759 8181 2 20581 15030 2 36569 5612 2 19535 38857 2 18874 33492 2 34959 31805 2 47567 5305 2 25458 6774 2 13672 27233 2 15682 3...
output:
4
result:
ok single line: '4'
Test #128:
score: 23
Accepted
time: 76ms
memory: 16904kb
input:
50000 4 3 9829 3912 2754 5 31738 39652 8098 17590 25256 3 38913 31308 7750 3 27934 27171 34371 4 27752 28862 3403 14200 5 35614 49317 11853 26596 21470 6 34115 22217 6612 35591 18121 20924 8 48200 5297 158 33938 24967 43880 39007 11888 6 2084 26093 24545 31691 40642 17844 3 24447 21482 8113 4 5455 1...
output:
4
result:
ok single line: '4'
Test #129:
score: 23
Accepted
time: 90ms
memory: 18428kb
input:
50000 5 3 19020 5818 33775 4 19981 32692 21277 6476 6 400 49278 48212 45275 49615 29447 9 5742 23904 17271 21356 34219 17381 44520 45343 10199 2 34039 40643 3 21115 32087 2505 3 20126 2578 39792 7 41827 35994 40988 16921 39770 40328 20946 2 16715 1113 4 41664 37626 2853 39281 1 14056 4 21286 26152 4...
output:
4
result:
ok single line: '4'
Test #130:
score: 23
Accepted
time: 102ms
memory: 18960kb
input:
50000 5 5 10216 47645 6809 34101 7504 5 29190 31032 914 8751 44543 5 18070 48570 47690 17275 25989 3 25040 43694 3033 2 2136 23473 5 2663 47842 15504 27546 8500 4 29094 45366 20405 8426 3 5690 12895 4264 8 24461 37252 24587 14671 38566 42093 40085 29831 4 12198 48137 13373 42598 3 29292 9905 14020 6...
output:
5
result:
ok single line: '5'
Test #131:
score: 23
Accepted
time: 32ms
memory: 13124kb
input:
50000 4 2 35695 45996 2 44351 4464 2 31970 42692 2 19792 48029 2 6990 7209 2 40370 20005 2 10520 2794 2 28780 30151 2 32002 2639 2 13305 19382 2 39600 562 2 37863 13626 2 21532 32886 2 15807 44586 2 3291 22527 2 49552 43243 2 9640 45661 2 34396 43990 2 607 40359 2 42972 41423 2 19699 8825 2 30618 35...
output:
2
result:
ok single line: '2'
Test #132:
score: 23
Accepted
time: 95ms
memory: 18408kb
input:
50000 5 4 19944 13383 35465 35968 6 18679 12105 23054 28898 26630 38641 4 42745 48089 35762 44487 5 37476 18646 17110 32311 6268 5 41996 9368 38378 42855 29559 8 19252 28906 40069 20592 40258 49087 33590 12597 3 13436 8370 12879 2 16185 4479 3 6506 41556 22431 4 32635 30615 37707 29305 3 3222 46867 ...
output:
4
result:
ok single line: '4'
Test #133:
score: 23
Accepted
time: 58ms
memory: 16224kb
input:
50000 4 3 20866 46885 3237 5 19968 40948 3051 13025 18598 2 11943 10274 1 11943 3 3544 20903 43185 1 11943 1 11943 1 19968 1 11943 3 43720 35804 3999 2 19968 24618 1 19968 5 19968 33120 42383 42795 23505 2 19968 17349 4 19968 48413 32107 47343 3 11943 42028 46274 2 19968 46106 4 19968 5673 10262 169...
output:
3
result:
ok single line: '3'
Test #134:
score: 23
Accepted
time: 103ms
memory: 20700kb
input:
50000 5 4 18366 371 7939 38924 5 4512 49579 4702 41440 43523 4 2946 39222 18251 7327 4 9390 23864 7766 38989 5 42957 44219 6896 27101 13266 5 7167 44248 8162 43592 29231 4 31426 32663 17783 28579 4 11793 45297 27933 2807 4 10080 10925 41194 48527 4 38251 24594 48074 35797 6 30509 16748 3576 35330 30...
output:
2
result:
ok single line: '2'
Test #135:
score: 23
Accepted
time: 34ms
memory: 13108kb
input:
50000 4 2 45611 40598 2 10987 9376 2 22657 26679 2 29019 4551 2 19880 10474 2 38695 10265 2 4105 12354 2 30282 39207 2 39940 10801 2 23650 45680 2 6107 16329 2 43566 42667 2 22755 39662 2 14525 41356 2 17673 22407 2 33838 48330 2 35064 43199 2 49815 7256 2 32205 34121 2 10589 10491 2 15612 42851 2 5...
output:
2
result:
ok single line: '2'
Test #136:
score: 23
Accepted
time: 29ms
memory: 12008kb
input:
25002 4 5 17678 19759 10407 20308 3905 4 11561 11456 11498 18760 3 14822 9628 14084 3 18125 17317 3985 4 6603 18939 8494 7756 3 17762 17543 13747 4 4500 22316 888 2854 3 12883 11745 10278 5 3354 2025 6015 15562 21292 5 15101 185 17311 22086 11123 5 24819 23753 247 24586 24042 6 3160 22932 20056 2229...
output:
2
result:
ok single line: '2'
Test #137:
score: 23
Accepted
time: 64ms
memory: 16236kb
input:
50000 4 1 49213 3 25458 898 1569 1 49213 3 6065 36110 34188 2 49213 9061 1 20287 3 6828 42987 103 2 49213 20975 2 20287 33265 2 20287 12847 1 49213 3 26351 49969 24108 4 20287 21357 26610 28803 3 20287 7433 46130 3 20287 15616 43123 3 20287 42794 23820 3 34038 21188 4552 3 13442 41152 18693 3 20287 ...
output:
3
result:
ok single line: '3'
Test #138:
score: 23
Accepted
time: 97ms
memory: 20744kb
input:
50000 5 7 21219 23942 43602 22983 40077 10572 40628 6 39570 6377 33668 47723 32413 19169 5 7469 6799 40483 24339 34821 4 29555 47037 37104 11879 7 18151 26254 6318 12522 16051 34129 27909 4 21748 8102 14536 6979 6 38471 28695 737 1147 27627 42061 4 10040 31979 15036 30426 6 20912 30474 14605 2650 26...
output:
2
result:
ok single line: '2'
Test #139:
score: 23
Accepted
time: 46ms
memory: 13136kb
input:
25003 5 5 16727 24920 15077 2199 696 6 6509 22012 22755 2176 8126 13550 5 19230 17391 15281 24617 14056 4 23713 19544 12555 5661 7 8042 3877 18940 23361 130 14807 24066 5 10709 7667 4551 17948 16558 4 24819 24581 9187 20511 8 7030 1748 3179 15861 1802 11804 3617 20183 4 19040 14247 15802 9884 5 1819...
output:
2
result:
ok single line: '2'
Test #140:
score: 23
Accepted
time: 36ms
memory: 11632kb
input:
25002 4 4 6507 11106 24597 21620 3 14901 5202 4367 5 16200 5670 22825 18430 2592 5 15361 23108 4022 13984 24069 3 7594 6276 20071 7 2938 16288 7744 13417 13214 15666 20113 8 22900 24598 11621 23202 11227 9350 24902 12438 3 20414 21806 4657 3 4469 11780 5446 3 22569 18095 14252 5 9330 23241 874 399 1...
output:
2
result:
ok single line: '2'
Test #141:
score: 23
Accepted
time: 10ms
memory: 8840kb
input:
12488 5 2 6968 5275 2 3899 2343 2 7896 4302 2 3464 6905 2 2209 2831 2 9528 3934 2 6905 11903 2 10280 8609 2 10607 672 2 10665 6304 2 4026 772 2 538 7107 2 11911 5220 2 10493 4668 2 875 8659 2 7896 10829 2 7908 3665 2 4857 6237 2 822 733 2 1459 8739 2 6342 10958 2 5659 772 2 7896 8143 2 1763 9045 2 3...
output:
2
result:
ok single line: '2'
Test #142:
score: 23
Accepted
time: 39ms
memory: 13172kb
input:
25003 5 7 13680 8348 9434 4212 6576 19821 12606 5 15938 18238 18676 16288 16702 5 6749 9886 12904 2273 10660 6 4756 5981 24358 11825 22535 23918 5 8855 11792 20858 16258 21622 4 14926 2546 17388 6798 4 976 8067 18523 22537 6 19488 17494 18997 6142 6195 4754 7 1416 2747 3894 11211 12985 6577 21588 5 ...
output:
2
result:
ok single line: '2'
Test #143:
score: 23
Accepted
time: 84ms
memory: 18084kb
input:
50000 5 4 14900 3374 49725 7869 4 19634 28699 46758 6375 4 20367 40436 25412 7883 4 11230 36419 20293 47183 4 32678 9698 33916 37742 4 436 771 39845 18476 4 18132 13988 16918 26941 4 46528 45727 23610 4814 4 27355 1873 32053 27645 4 27436 13347 3204 6645 4 2797 45095 843 1641 4 44349 13351 39180 151...
output:
3
result:
ok single line: '3'
Test #144:
score: 23
Accepted
time: 17ms
memory: 8836kb
input:
12488 5 2 9727 419 2 2319 8537 2 363 4463 2 2012 7615 2 8227 5747 2 2044 3443 2 2251 2834 2 6983 6906 2 10677 11229 2 10381 11886 2 6345 6179 2 4357 10016 2 5155 8897 2 7718 10191 2 2505 3908 2 11900 3304 2 8792 9042 2 10210 3373 2 11663 7751 2 208 10479 2 65 725 2 10533 10819 2 370 9045 2 12031 634...
output:
2
result:
ok single line: '2'
Test #145:
score: 23
Accepted
time: 79ms
memory: 17788kb
input:
50000 5 4 7781 43441 25799 37991 4 6786 4166 18087 7778 4 17317 17253 5582 39559 4 49729 33943 10424 46329 4 45741 4114 43611 47601 4 39523 32982 37538 23877 4 6531 36466 24583 5761 4 40750 24974 7830 40815 4 39992 48720 41283 15984 4 23837 17764 35139 8334 4 32343 9401 6595 42646 4 37497 49915 3973...
output:
3
result:
ok single line: '3'