QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#792743 | #30. Political Development | seungni | 39 | 113ms | 314240kb | C++17 | 1.3kb | 2024-11-29 13:39:14 | 2024-11-29 13:39:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
int N, K, ans;
vector<int> graph[50005];
bitset<50005> edge[50005];
void DFS(int root, int now, int state, int k) {
ans = max(ans, k);
if (now == graph[root].size()) return;
int nxt = graph[root][now];
DFS(root, now + 1, state, k);
int flag = 0;
for (int i = 0; i < now; i++) {
if (!(state & (1 << i))) continue;
int p = graph[root][i];
if (!edge[p][nxt]) {
flag = 1;
break;
}
}
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].push_back(a), edge[i][a] = 1;
}
}
for (int i = 0; i < N; i++) {
if (graph[i].size() <= 10) DFS(i, 0, 0, 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;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 4
Accepted
Test #1:
score: 4
Accepted
time: 1ms
memory: 6740kb
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: 4824kb
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: 37608kb
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: 0ms
memory: 37932kb
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: 0ms
memory: 37892kb
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: 4ms
memory: 36808kb
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: 0ms
memory: 37924kb
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: 1ms
memory: 6124kb
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: 4820kb
input:
1 1 0
output:
1
result:
ok single line: '1'
Test #10:
score: 4
Accepted
time: 1ms
memory: 6936kb
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: 0ms
memory: 37772kb
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: 0ms
memory: 37960kb
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: 5824kb
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: 0ms
memory: 35764kb
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: 1ms
memory: 4844kb
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: 37776kb
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: 4896kb
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: 0ms
memory: 36824kb
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: 1ms
memory: 6504kb
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: 0ms
memory: 37788kb
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: 0ms
memory: 37708kb
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: 0ms
memory: 8836kb
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: 4ms
memory: 35748kb
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: 0ms
memory: 8980kb
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: 0ms
memory: 35852kb
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: 4ms
memory: 37716kb
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: 8ms
memory: 37624kb
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: 0ms
memory: 37840kb
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: 0ms
memory: 34976kb
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: 0ms
memory: 37680kb
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: 0ms
memory: 37816kb
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: 4ms
memory: 37980kb
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: 0ms
memory: 37996kb
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: 0ms
memory: 36908kb
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: 21452kb
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: 0ms
memory: 21260kb
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: 21276kb
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: 0ms
memory: 13272kb
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: 3ms
memory: 15240kb
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: 0ms
memory: 36996kb
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: 13236kb
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: 0ms
memory: 35700kb
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: 0ms
memory: 37764kb
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: 1ms
memory: 4744kb
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: 1ms
memory: 4920kb
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: 1ms
memory: 6464kb
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: 4880kb
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: 4888kb
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: 6508kb
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: 6444kb
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: 6684kb
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: 1ms
memory: 6876kb
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: 6924kb
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: 83ms
memory: 314152kb
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: 1ms
memory: 4824kb
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: 64ms
memory: 314188kb
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: 5856kb
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: 113ms
memory: 314156kb
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: 83ms
memory: 314164kb
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: 80ms
memory: 314224kb
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: 94ms
memory: 314240kb
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: 0
Wrong Answer
Dependency #2:
100%
Accepted
Test #62:
score: 38
Accepted
time: 16ms
memory: 37108kb
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: 1ms
memory: 6336kb
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: 0
Wrong Answer
time: 0ms
memory: 37048kb
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:
3
result:
wrong answer 1st lines differ - expected: '4', found: '3'
Subtask #5:
score: 0
Wrong Answer
Dependency #2:
100%
Accepted
Test #105:
score: 23
Accepted
time: 0ms
memory: 5936kb
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: 0
Wrong Answer
time: 31ms
memory: 312628kb
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:
3
result:
wrong answer 1st lines differ - expected: '4', found: '3'