QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#700893 | #61. Cut Cut Cut! | TheZone | AC ✓ | 797ms | 80228kb | C++23 | 2.5kb | 2024-11-02 13:30:40 | 2024-11-02 13:30:50 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair <int, int> pii;
typedef vector <LL> vec;
const int N = 3e5 + 5;
const int MOD = 1065138983;
mt19937 rng(MOD - 1);
LL inv (LL x) {
LL ret = 1;
while (x > 1) {
ret *= MOD - MOD / x;
ret %= MOD;
x = MOD % x;
}
return ret;
}
int n, m, d;
struct basis {
vector <vec> a;
basis () {}
void add (vec v) {
for (int i = 0; i < d; i++) if (v[i]) {
LL w = inv(v[i]);
for (int k = 0; k < d; k++) (v[k] *= w) %= MOD;
if (!a[i].size()) {
a[i] = v;
break;
} else {
for (int k = 0; k < d; k++) {
(v[k] -= a[i][k]) %= MOD;
if (v[k] < 0) v[k] += MOD;
}
}
}
}
int rank() {
int cnt = 0;
for (auto v : a) if (v.size()) cnt++;
return cnt;
}
};
vector <int> E[N];
basis p[N];
void work() {
cin >> n >> m;
for (int i = 1; i <= m; i++) {
int u, v;
cin >> u >> v;
E[u].push_back(v);
}
d = (int) E[1].size();
for (int i = 2; i <= n; i++) p[i].a.resize(d);
int c = 0;
for (auto i : E[1]) {
vec tmp(d);
tmp[c++] = 1;
p[i].add (tmp);
}
for (int x = 2; x <= n; x++) {
for (auto to : E[x]) {
vec tmp(d);
for (auto &v : p[x].a) if (v.size()) {
int w = int(rng() % int(1e9)) + 123;
for (int i = 0; i < d; i++) {
(tmp[i] += w * v[i]) %= MOD;
}
}
p[to].add(tmp);
}
}
for (int i = 2; i <= n; i++) {
printf("%d%c", p[i].rank(), i == n ? '\n' : ' ');
}
}
int main() {
ios::sync_with_stdio(false); cin.tie(0);
int T = 1;
// cin >> T;
for (int ca = 1; ca <= T; ca ++) {
work();
}
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 11640kb
input:
3 3 1 2 1 3 2 3
output:
1 2
result:
ok 2 number(s): "1 2"
Test #2:
score: 0
Accepted
time: 3ms
memory: 11272kb
input:
8 8 1 2 1 3 1 5 2 4 2 5 3 6 4 5 7 8
output:
1 1 1 2 1 0 0
result:
ok 7 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 12304kb
input:
20 70 3 18 14 16 8 10 5 7 2 14 10 18 14 15 17 19 18 20 4 6 3 20 16 17 6 7 6 17 6 19 5 19 12 16 18 19 13 19 13 19 8 9 15 17 8 9 1 7 5 18 6 14 2 17 4 20 12 16 9 20 2 7 6 19 12 13 6 7 1 5 19 20 9 14 13 14 16 17 17 20 9 16 1 6 12 15 2 8 1 3 4 19 1 4 9 13 14 15 15 20 17 18 14 19 13 14 2 5 7 14 7 18 10 16...
output:
0 1 1 1 2 4 0 1 0 0 1 2 5 3 3 4 6 6 6
result:
ok 19 numbers
Test #4:
score: 0
Accepted
time: 3ms
memory: 11596kb
input:
100 1000 26 51 88 93 96 97 55 92 49 60 89 92 81 84 87 95 80 96 33 81 48 73 12 91 71 86 89 90 33 78 13 100 60 89 45 48 98 100 10 43 40 50 13 29 96 99 83 92 84 85 20 39 97 100 41 76 51 71 28 61 2 80 57 89 58 83 10 30 21 85 1 21 86 95 1 65 66 78 57 91 30 41 46 72 59 64 59 79 17 33 68 79 45 78 8 91 12 7...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 1 1 1 1 1 1 2 3 0 1 3 3 0 2 4 1 4 3 2 1 3 1 4 4 3 2 3 4 4 3 4 4 4 5 2 5 3 7 7 5 6 4 7 7 6 7 6 4 5 7 7 7 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
result:
ok 99 numbers
Test #5:
score: 0
Accepted
time: 45ms
memory: 13252kb
input:
2000 50000 74 1663 975 1279 632 1796 1137 1386 121 1557 627 678 482 1961 1554 1654 1 388 1940 1971 512 1665 675 1279 946 1834 1473 1645 732 1620 169 552 1996 1997 1549 1982 1678 1788 1282 1831 1084 1455 1166 1566 380 854 1087 1263 763 1569 234 864 1166 1475 47 1680 194 350 1939 1949 8 1028 357 1234 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 1999 numbers
Test #6:
score: 0
Accepted
time: 45ms
memory: 12072kb
input:
2000 50000 1078 1288 298 1803 1715 1954 547 1412 1060 1730 1077 1855 1685 1947 1416 1804 1469 1737 1637 1888 1048 1462 162 237 1655 1885 492 963 1 811 1598 1948 261 1353 441 1531 1829 1838 170 1189 1848 1996 705 1909 931 1724 493 574 1146 1412 1062 1730 102 206 49 615 1777 1931 106 1808 1545 1789 11...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 1999 numbers
Test #7:
score: 0
Accepted
time: 37ms
memory: 12684kb
input:
2000 50000 347 505 1265 1885 1170 1773 1126 1942 375 1060 1463 1622 1661 1972 321 1956 69 1968 518 1896 1348 1654 166 1060 1 907 1520 1733 3 1085 1886 1954 1532 1603 821 1248 654 1899 1477 1595 792 1504 410 496 1421 1955 77 1201 1410 1442 1974 1981 1081 1470 718 904 687 1275 1693 1977 2 526 398 585 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 1999 numbers
Test #8:
score: 0
Accepted
time: 125ms
memory: 16628kb
input:
2000 50000 1097 1906 350 533 1144 1809 49 1971 1498 1655 261 808 716 834 40 60 692 1664 292 602 1383 1728 1127 1395 1441 1602 761 1213 1671 1875 978 1683 505 646 798 1663 1359 1542 1960 1961 1258 1800 121 554 1 742 1403 1566 769 1397 475 1576 625 806 1468 1611 1943 1972 181 769 1816 1913 1 1846 290 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 1999 numbers
Test #9:
score: 0
Accepted
time: 109ms
memory: 16608kb
input:
2000 50000 1436 1821 1 477 1001 1047 20 1306 1907 1933 1 840 202 1708 608 870 39 440 630 1036 226 1745 1137 1516 1455 1878 1052 1570 1377 1440 170 469 1295 1759 950 1993 429 1457 1309 1523 42 1183 442 1017 796 1646 558 757 1590 1699 439 1108 1545 1731 1 1506 1841 1998 1933 1948 1145 1189 206 1349 18...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 ...
result:
ok 1999 numbers
Test #10:
score: 0
Accepted
time: 122ms
memory: 15324kb
input:
2000 50000 982 1542 1981 1992 59 249 717 720 745 790 123 1846 1874 1961 1715 1855 769 808 578 1072 1922 1923 1700 1703 1526 1859 796 814 1904 1997 1616 1860 486 519 361 383 673 688 655 1519 825 1058 544 950 1185 1654 340 1848 1467 1783 1385 1745 313 888 86 411 1103 1696 1292 1997 45 523 438 467 1795...
output:
0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 1999 numbers
Test #11:
score: 0
Accepted
time: 636ms
memory: 21052kb
input:
3000 200000 101 567 1 1265 1373 1916 2737 2814 2439 2443 409 1808 511 2197 245 616 2197 2259 1266 1764 1261 2882 1341 1938 1684 1962 276 1197 1942 2295 657 1710 2100 2781 753 2815 1814 2335 1462 2125 785 2612 2370 2907 1809 2853 1 469 2523 2779 1433 2259 1429 2480 1796 2221 2379 2605 1685 2444 106 2...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 ...
result:
ok 2999 numbers
Test #12:
score: 0
Accepted
time: 478ms
memory: 18600kb
input:
3000 200000 2458 2538 1024 1532 1603 2068 654 1645 2951 2965 2609 2754 906 1992 1252 1332 1132 1139 97 2591 956 1758 771 2097 943 1849 2802 2814 2016 2401 154 767 1896 2916 79 1621 1484 1523 2568 2678 113 1189 1854 1926 787 2523 151 1369 2376 2533 2741 2911 2797 2975 2408 2416 2932 2987 1158 2750 19...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 2999 numbers
Test #13:
score: 0
Accepted
time: 532ms
memory: 23700kb
input:
5000 200000 3093 4382 2320 4405 3622 4951 1653 4654 1815 3486 4470 4626 3784 4082 3537 4022 423 1775 2334 2565 1960 2331 4543 4749 3458 3818 586 2057 1141 2668 3039 3957 3250 4066 2234 3682 2568 4454 3771 4711 4843 4858 3462 4421 4625 4799 431 4641 1966 4228 3157 3581 4778 4872 2585 4865 98 705 91 1...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 4999 numbers
Test #14:
score: 0
Accepted
time: 458ms
memory: 23720kb
input:
6000 220000 5077 5182 5788 5902 5294 5909 240 5622 2987 3163 984 4309 308 4642 1712 5711 5292 5797 399 2009 2247 4111 4923 4951 3576 5922 626 4085 28 5234 5778 5867 1 3481 2329 4516 4729 4911 4310 5588 4831 5795 3512 5810 1439 3911 5780 5917 4552 4864 1275 1793 628 4166 2799 2944 5004 5874 2085 3411...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 ...
result:
ok 5999 numbers
Test #15:
score: 0
Accepted
time: 616ms
memory: 27148kb
input:
7000 240000 1878 4856 3900 6031 4654 5371 3000 3835 6152 6806 517 5170 1239 2327 4469 6903 4869 4978 3449 5267 1603 5487 5292 5463 3561 6259 6063 6924 1358 1870 3665 4762 2262 3073 413 528 4121 6260 603 2560 4754 5533 6948 6981 4938 6218 4071 5212 4374 6422 6008 6143 6770 6896 1009 3476 1 1825 4130 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 6999 numbers
Test #16:
score: 0
Accepted
time: 507ms
memory: 24292kb
input:
7000 240000 2787 6430 5555 6791 456 2207 3659 6746 5901 6186 324 6061 1 4298 5530 6683 4383 5096 5856 6910 5687 6228 5519 5830 784 4897 6779 6934 5770 6880 2525 3844 2808 6400 4572 5802 3675 4082 6705 6755 329 3362 1748 2549 2939 6164 1820 1904 3240 6925 3968 6666 6013 6047 3178 3987 2817 4894 6836 ...
output:
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 ...
result:
ok 6999 numbers
Test #17:
score: 0
Accepted
time: 643ms
memory: 28920kb
input:
8000 260000 4585 4726 73 7828 4258 4598 5761 7990 4135 4850 3090 3670 1 141 3038 7048 5323 7582 4033 4275 6012 6516 2484 5318 4967 7542 7169 7875 5189 7789 5471 6360 2174 3229 7132 7993 3040 4044 5062 7808 6426 7577 5398 5684 2051 3442 3461 7989 1452 4505 6146 7208 2024 6013 5112 5430 3598 4833 5528...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 7999 numbers
Test #18:
score: 0
Accepted
time: 563ms
memory: 26960kb
input:
8000 260000 20 3714 4797 7450 5884 6440 2658 4812 6065 6152 7176 7966 2544 3737 2863 7642 7630 7698 5088 5098 4996 7635 2175 5292 6216 7477 3195 4876 731 6928 4024 7922 7264 7399 4434 5065 4641 6559 1351 7984 2607 7608 5354 5854 3786 6413 5483 5840 5815 6055 2461 3987 3120 5133 6386 6989 1539 3670 2...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 7999 numbers
Test #19:
score: 0
Accepted
time: 674ms
memory: 33240kb
input:
10000 280000 5029 7602 486 2248 3476 9231 3892 8665 7761 8351 3633 9292 5619 9805 9960 9972 2575 6739 4192 6767 5430 6361 6103 9076 1 8367 6790 6821 1217 2828 1 1178 6680 7240 6000 6892 5772 7098 2277 5903 1 8199 7272 7407 6217 8150 4122 5382 4251 8623 6275 8044 9525 9760 9347 9846 6843 7182 676 476...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 9999 numbers
Test #20:
score: 0
Accepted
time: 610ms
memory: 31776kb
input:
10000 280000 9985 9995 3277 6136 4689 4824 1 7623 5182 9456 9200 9397 3192 5598 6882 9694 2583 4011 4315 8416 496 8261 1 6732 275 4271 1 3264 5056 7628 4269 6005 9835 9946 5394 5603 9034 9552 614 9202 5057 7548 2502 4679 4331 8785 5547 8772 2237 8619 1656 2403 8226 8894 9067 9556 7924 8312 7697 8765...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 9999 numbers
Test #21:
score: 0
Accepted
time: 527ms
memory: 43956kb
input:
20000 290000 5756 19671 12516 17368 3036 19455 2597 4683 1 11286 19303 19710 6914 13784 6868 16941 17539 19298 489 4002 3307 9087 1 13634 7429 13660 2467 10872 19209 19472 14454 19768 16031 18049 18394 18486 14624 19872 12433 13756 1 10250 7127 15110 5842 14290 228 7560 16237 16359 17290 19655 2617 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 19999 numbers
Test #22:
score: 0
Accepted
time: 423ms
memory: 38916kb
input:
20000 290000 17717 18429 11384 17105 8253 17312 14476 17232 3104 16723 1 17471 1 15680 11424 16447 18495 19757 14941 17826 5934 17715 17584 18388 1992 19837 10476 16852 9015 18590 11034 17370 3074 16068 14553 14921 19085 19536 17301 18388 15454 19315 16623 18882 3092 19446 18606 18771 17957 18916 12...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 19999 numbers
Test #23:
score: 0
Accepted
time: 461ms
memory: 41764kb
input:
20000 290000 2523 14339 3376 8945 11944 14850 5807 6304 18876 19880 13324 17889 11385 18240 12155 17327 4297 6739 1 11112 12232 17123 10270 10906 56 746 2368 16221 18409 19458 8105 18984 1 19143 14362 19708 15254 18278 10115 13322 9778 17433 7365 13386 11891 17091 9317 11465 10980 12783 5338 10047 1...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 19999 numbers
Test #24:
score: 0
Accepted
time: 269ms
memory: 50988kb
input:
40000 300000 38018 38420 1 26906 28237 32656 33656 36151 6302 7549 4553 18117 8769 17167 30994 33017 4192 9781 10264 37278 3621 18511 4390 20750 34941 37759 4190 11422 12989 14026 37892 38732 33600 33998 37687 39901 6686 22149 4910 5049 17301 36145 2746 37417 8972 10990 26320 29456 2440 26734 28517 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 39999 numbers
Test #25:
score: 0
Accepted
time: 319ms
memory: 52924kb
input:
40000 300000 25683 35564 9540 23839 28343 38114 16549 25388 1818 35022 37555 37923 27319 32907 29207 38073 17735 37580 29121 37466 27861 36898 37667 38372 39132 39719 3702 11232 3392 15719 2090 7003 35129 35648 807 4607 2316 3289 24024 39406 3924 39589 37443 38794 693 5730 568 28425 2782 16056 18104...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 39999 numbers
Test #26:
score: 0
Accepted
time: 295ms
memory: 50944kb
input:
40000 300000 14975 28142 10771 28179 572 6932 38566 38994 29717 35085 33670 34436 1362 12848 5865 6010 8169 10675 20036 34303 36245 36973 1 3072 16955 36750 3062 37272 7247 10035 18009 36909 31410 36896 38498 39805 9642 10678 13994 38587 2683 18734 19375 25952 15074 18224 1 36865 1 13026 25583 38127...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 39999 numbers
Test #27:
score: 0
Accepted
time: 93ms
memory: 68640kb
input:
100000 300000 35068 95490 12752 83275 52424 74169 34697 58595 83242 91208 97955 98676 6311 67431 76620 91964 43016 98716 18618 64598 12905 53557 28104 35523 35892 76239 47200 93011 76977 87926 92159 93081 34238 53076 31921 61272 15037 78948 91411 98613 21080 67391 63337 64981 10396 73414 1 68089 889...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99999 numbers
Test #28:
score: 0
Accepted
time: 95ms
memory: 67896kb
input:
100000 300000 4514 66188 38363 56106 24665 33073 13809 79824 20227 80901 1 91058 90870 92542 33759 94434 90825 97190 98865 99919 28554 66274 10360 99440 62463 74104 17665 70219 1299 53324 6236 49456 85596 91708 21162 27786 29515 50983 30132 46302 1 96225 1 59142 82106 98256 2626 96592 71020 96848 72...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99999 numbers
Test #29:
score: 0
Accepted
time: 95ms
memory: 68280kb
input:
100000 300000 21283 73827 29737 65454 3725 8166 39212 97835 23601 77185 1 81068 84243 98700 16513 69616 44868 79657 78926 94006 29542 74419 36025 68849 83398 87047 1 70562 19416 67312 76453 90501 51325 84199 31889 54437 50710 84311 50600 76044 32363 68134 93231 99315 91547 93963 75815 87211 15944 39...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99999 numbers
Test #30:
score: 0
Accepted
time: 95ms
memory: 67992kb
input:
100000 300000 36464 56222 18941 73366 89871 98225 39755 76527 17736 73175 31245 52989 42667 48453 1 50565 78258 97123 82372 87555 5002 39554 83408 84695 34957 63195 88772 99463 52189 69174 92642 95504 20943 56261 60323 64572 48283 59079 52042 80526 19600 27407 79847 87522 15050 70519 92629 95852 852...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99999 numbers
Test #31:
score: 0
Accepted
time: 88ms
memory: 67436kb
input:
100000 300000 37113 83472 68585 98186 5750 25196 5099 96629 78754 87868 56515 94496 10725 47865 25396 60685 44106 84700 1 45898 95505 97669 41680 98689 69078 76277 8476 37453 86593 98421 24205 83580 97982 99770 3138 44099 70584 91267 91169 96442 18969 39776 86550 90163 65448 81095 12901 40992 43952 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99999 numbers
Test #32:
score: 0
Accepted
time: 98ms
memory: 68588kb
input:
100000 300000 42903 58612 21021 32963 44296 54359 9753 64220 14820 25441 53682 74616 83871 84881 26471 42898 53239 79410 37390 87534 59413 73435 80098 87454 54029 84426 59847 73591 33878 78972 90535 91605 69566 76914 74907 78980 96958 98167 20136 78029 26822 52438 1 56381 8760 12981 33889 39548 2587...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99999 numbers
Test #33:
score: 0
Accepted
time: 106ms
memory: 68716kb
input:
100000 300000 16107 79047 11925 15880 21816 84262 2401 98405 76584 81779 53290 95092 84807 85416 48479 78970 16667 93050 16889 92015 82311 90977 46923 52997 60325 71917 75253 92299 82959 84083 72340 76624 93180 96956 24353 27241 71288 81834 83344 83409 44262 53724 95807 96352 99362 99491 44198 73741...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99999 numbers
Test #34:
score: 0
Accepted
time: 101ms
memory: 68768kb
input:
100000 300000 18939 45486 47775 91920 85399 99943 83538 88497 36255 37360 43183 59570 99025 99933 31189 98399 40714 91212 9118 54566 13355 82580 37872 59418 71009 90108 27656 60194 59747 87248 11649 74885 3477 63070 21019 61062 85472 86669 91273 92908 85635 99399 74022 84023 64117 98160 74592 94366 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99999 numbers
Test #35:
score: 0
Accepted
time: 88ms
memory: 67840kb
input:
100000 300000 89027 94079 26743 59989 20832 89888 45129 90013 26961 36311 40190 47437 61676 85330 1964 27729 64038 84465 18306 93538 15723 45223 6849 57044 1 85163 86361 95934 95587 97850 3011 50300 98186 98369 92434 98723 5170 67175 23721 99541 22696 57671 24062 73188 96702 97969 10794 89064 90876 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99999 numbers
Test #36:
score: 0
Accepted
time: 118ms
memory: 80228kb
input:
100000 149977 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 7 22 22 50001 18 23 23 50001 7 24 24 50001 10 25 25 50001 12 26 26 50001 12 27 27 50001 14 28 28 50001 6 29 29 50001 21 30 30 50001 16 31 31 50001 7 32 32 50001 18 33 33 50001 9 34 34 50001 12 3...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 99999 numbers
Test #37:
score: 0
Accepted
time: 797ms
memory: 16484kb
input:
1000 300000 911 940 265 793 582 974 1 650 644 691 933 962 35 457 370 705 789 994 59 998 278 498 1 474 213 672 152 670 766 990 510 889 695 1000 990 999 941 942 1 847 867 912 181 813 808 843 905 982 686 688 302 558 32 190 995 997 370 935 449 664 358 969 951 987 320 815 781 814 560 998 615 729 885 908 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 2 2 2 1 2 2 1 3 2 3 2 3 3 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 ...
result:
ok 999 numbers
Test #38:
score: 0
Accepted
time: 790ms
memory: 15860kb
input:
1000 300000 1 408 102 742 931 980 699 913 193 812 130 609 972 998 724 866 56 69 248 249 630 967 883 932 331 622 811 904 90 780 355 886 570 740 453 522 603 670 328 781 731 766 177 598 140 533 433 434 949 956 577 975 116 694 520 662 1 968 471 671 268 793 638 818 679 721 395 480 293 896 631 737 625 649...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 1 1 2 1 1 2 3 2 2 3 3 3 3 3 1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 ...
result:
ok 999 numbers
Extra Test:
score: 0
Extra Test Passed