QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#449987 | #7760. 化学实验 | Made_in_Code | 65 | 556ms | 17920kb | C++14 | 3.8kb | 2024-06-21 21:50:14 | 2024-06-21 21:50:14 |
Judging History
answer
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#include <iostream>
using namespace std;
const int kMaxN = 5e5 + 1;
struct V {
int mn, c, t;
int f, s[2];
bool b;
} v[kMaxN];
int u, n, m;
void TagB(int x) {
v[x].b ^= 1, swap(v[x].s[0], v[x].s[1]);
}
void TagC(int x, int y) {
v[x].c += y, v[x].t += y;
}
void Pushdown(int x) {
if (v[x].b) {
TagB(v[x].s[0]), TagB(v[x].s[1]), v[x].b = 0;
}
if (v[x].t) {
TagC(v[x].s[0], v[x].t);
TagC(v[x].s[1], v[x].t);
v[x].t = 0;
}
}
void Pushup(int x) {
v[x].mn = x;
v[x].s[0] && (v[x].mn = min(v[x].mn, v[v[x].s[0]].mn));
v[x].s[1] && (v[x].mn = min(v[x].mn, v[v[x].s[1]].mn));
}
int Son(int x) {
return (v[v[x].f].s[0] == x) + (v[v[x].f].s[1] == x) * 2 - 1;
}
void RePush(int x) {
~Son(x) ? RePush(v[x].f) : void(), Pushdown(x);
}
void Rotate(int x, bool o) {
int y = v[x].s[!o], s = Son(x);
v[x].s[!o] = v[y].s[o], v[y].s[o] = x;
v[y].f = v[x].f, v[x].f = y;
v[v[x].s[!o]].f = x, ~s && (v[v[y].f].s[s] = y);
Pushup(x), Pushup(y);
}
void Splay(int x) {
RePush(x);
while (~Son(x)) {
int s = Son(x), t = Son(v[x].f);
if (~t) {
Rotate(s == t ? v[v[x].f].f : v[x].f, !s);
Rotate(v[x].f, !t);
} else {
Rotate(v[x].f, !s);
}
}
}
void Access(int x) {
for (int y = 0; x; y = x, x = v[x].f) {
Splay(x), v[x].s[1] = y, Pushup(x);
}
}
void MakeRoot(int x) {
Access(x), Splay(x), TagB(x);
}
int FindTop(int x) {
Splay(x);
for (; v[x].s[0];) {
x = v[x].s[0], Pushdown(x);
}
return Splay(x), x;
}
int FindRoot(int x) {
return Access(x), FindTop(x);
}
void Link(int x, int y) {
x > y ? swap(x, y) : void();
int z = FindRoot(y);
if (FindRoot(x) != z) {
MakeRoot(x), v[x].f = y, MakeRoot(z);
Access(y), Splay(y), TagC(y, v[x].c);
}
}
bool Exist(int x, int y) {
MakeRoot(x), Access(y), Splay(x);
return v[x].s[1] == y && !v[y].s[0];
}
void Cut(int x, int y) {
x > y ? swap(x, y) : void();
int z = FindRoot(y);
if (Exist(x, y)) {
v[x].s[1] = v[y].f = 0, Pushup(x), MakeRoot(z);
Access(y), Splay(y), TagC(y, -v[x].c);
} else {
MakeRoot(z);
}
}
int FindFa(int x) {
Splay(x);
for (x = v[x].s[0]; v[x].s[1]; x = v[x].s[1]) {
Pushdown(x);
}
return Splay(x), x;
}
int FindGap(int x, int y) {
Pushdown(x);
if (v[x].s[0] && v[v[x].s[0]].mn <= y) {
return FindGap(v[x].s[0], y);
} else if (x <= y) {
return x;
}
return FindGap(v[x].s[1], y);
}
void Merge(int x, int y) {
int topx, topy, _x, _y, f, mid;
Access(x), topx = FindTop(x);
if (topx == FindTop(y)) {
// cout << "Del " << x << ' ' << y << '\n';
return;
}
Access(y), topy = FindTop(y);
if (FindTop(x) == topy) {
// cout << "Del " << x << ' ' << y << '\n';
return;
}
_x = FindTop(x), Access(f = v[_x].f), _y = FindTop(y);
if (topx == topy) {
_x < _y ? swap(_x, _y), swap(x, y) : void();
Cut(_y, f), Access(x), Access(y);
}
for (; Splay(_x), v[_x].mn < _y;) {
_x = FindGap(_x, _y);
if (~Son(_x)) {
mid = FindFa(_x), Cut(mid, _x), Link(_y, mid);
Access(x), Access(y);
}
swap(_x, _y), swap(x, y);
}
Link(x, _y);
}
int Ask(int x, int y) {
x = FindGap(FindRoot(x), y);
return Access(x), v[x].c;
}
int main() {
cin.tie(0), cout.tie(0);
ios::sync_with_stdio(0);
for (int i = 0; i < kMaxN; i++) {
v[i].mn = i, v[i].c = 1;
}
cin >> u >> n >> m;
for (int i = 1, o, x, y, p = 0; i <= m; i++) {
cin >> o >> x >> y;
if (u) {
x = (x + p - 1) % n + 1, y = (y + p - 1) % n + 1;
}
if (o == 1) {
Merge(x, y);
} else {
cout << (p = Ask(x, y)) << '\n';
}
}
return 0;
}
详细
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 34ms
memory: 17372kb
input:
1 7500 7500 1 263 1446 1 6338 3037 1 5651 6129 1 572 3137 1 3159 5472 1 6038 4451 1 5988 5462 1 3873 1562 1 3516 5142 1 3375 2376 1 5832 1884 1 6243 3066 1 4001 6195 1 5301 6851 1 4382 2910 1 5299 562 1 452 335 1 3459 814 1 6681 6391 1 5816 4975 1 2244 1118 1 1410 1067 1 331 6324 1 6305 1294 1 4251 ...
output:
3984
result:
ok single line: '3984'
Test #2:
score: 0
Accepted
time: 7ms
memory: 17272kb
input:
1 750 7500 1 424 707 1 405 537 2 19 26 2 365 365 2 6 11 1 695 549 1 579 661 2 682 687 1 621 586 2 446 453 2 562 567 2 534 537 2 509 515 2 109 113 2 112 114 2 46 54 2 736 746 2 355 363 2 706 709 2 526 529 2 40 48 2 80 83 2 684 689 2 479 480 2 320 323 2 74 76 2 170 180 1 472 559 2 125 128 1 426 717 2 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 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 2 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 2 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 ...
result:
ok 6000 lines
Test #3:
score: 0
Accepted
time: 4ms
memory: 17268kb
input:
1 1500 7500 2 536 539 1 922 1378 2 1395 1395 1 1162 1128 2 199 204 2 127 128 2 902 911 2 282 288 2 13 22 2 1047 1047 2 710 714 1 829 1021 2 1070 1078 2 1122 1130 2 1290 1297 1 1236 1229 2 197 205 2 732 739 1 935 948 2 170 179 2 1282 1286 2 1266 1274 1 746 1113 2 725 727 2 1323 1330 2 1350 1359 2 629...
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 2 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 6000 lines
Test #4:
score: 0
Accepted
time: 11ms
memory: 17264kb
input:
1 1500 7500 1 790 812 2 829 835 1 1322 831 1 895 1180 1 779 1378 2 242 251 1 1143 939 1 927 972 1 1312 1441 1 1023 765 1 1412 1427 1 1393 912 2 437 445 1 1448 1110 2 427 431 1 1328 1161 2 305 311 2 1066 1073 1 871 941 1 988 1330 1 1459 986 2 676 678 1 1445 1464 2 1231 1239 2 1005 1011 2 961 961 1 11...
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 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 2 2 1 1 3 1 1 1 1 1 1 2 1 3 1 1 1 3 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 10 1 2 1 1 1 21 1 1 1 1 3 1 1 1 1 1 1 1 1 ...
result:
ok 2500 lines
Test #5:
score: 0
Accepted
time: 7ms
memory: 17396kb
input:
1 3750 7500 1 3456 2560 2 1560 1569 1 3011 3126 1 3395 2357 1 2834 2385 2 1253 1258 2 242 243 2 2176 2178 1 2227 3450 1 2525 3382 2 3685 3688 1 3507 3661 1 2895 2699 2 637 642 2 2520 2520 1 2944 2943 1 2380 2734 2 544 554 1 3174 2675 1 2331 2357 1 1890 2299 1 2155 1969 2 2577 2580 2 3074 3080 2 2449...
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 4 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 1 2 1 1 1 1 1 1 1 1 1 3 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 2 1 1 1 2 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 3 1 1 ...
result:
ok 3750 lines
Test #6:
score: 0
Accepted
time: 12ms
memory: 17276kb
input:
1 7500 7500 1 4050 6540 1 5175 6142 1 6682 4431 1 6802 3769 1 6389 5002 2 5913 5922 1 6490 6609 1 5063 4999 1 3949 4030 1 4118 6153 1 4605 7263 2 2450 2450 1 4787 5228 1 6228 6151 1 4722 6903 2 6782 6784 1 6845 3834 1 4833 4076 1 5820 5645 1 4075 4103 1 5086 4138 2 1693 1696 1 6439 4810 1 4163 6662 ...
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 2 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 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 2 1 1 1 1 1 2 ...
result:
ok 1500 lines
Test #7:
score: 0
Accepted
time: 14ms
memory: 17396kb
input:
1 3750 7500 1 2 1925 1 4 2765 1 3 1194 2 1188 1192 1 1411 2061 2 1222 1232 1 2 2166 1 1 3119 1 3750 3033 1 2 2993 2 1947 1951 2 2800 2805 1 1 1081 1 3 3711 2 2648 2657 1 3 1893 1 3750 737 2 54 59 2 1408 1416 1 1 3375 1 2 3104 2 3222 3222 1 2 3644 1 1806 3459 2 1399 1400 1 369 809 2 1283 1289 2 2779 ...
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 14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 17 1 1 1 1 1 1 1 1 1 1 1 1 26 1 1 1 1 1 1 1 1 1 1 1 1 2 1 23 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 3750 lines
Test #8:
score: 0
Accepted
time: 14ms
memory: 17328kb
input:
1 7500 7500 1 4 194 1 3 3902 1 1 4070 1 2495 7318 2 5678 5686 1 7500 4379 1 2 6088 2 4803 4805 1 568 3588 1 7500 4974 1 1 2127 1 1 1522 1 1 269 1 2 1257 1 7500 3931 1 2 1337 2 6585 6595 1 1 1037 1 1 1902 2 365 367 1 3 3807 1 2 1036 2 6708 6713 1 5488 7482 1 7500 3122 1 5024 402 1 2 4181 1 1 3568 1 7...
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 27 1 1 1 1 1 1 1 34 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 157 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 57 1 1 1 1 1 1 1 291 1 1 1 1 1 1 1 1 346 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3...
result:
ok 1500 lines
Test #9:
score: 0
Accepted
time: 5ms
memory: 17336kb
input:
1 7500 7500 2 6735 6777 1 4912 6633 1 6953 7309 1 7378 5256 1 7162 4840 1 5428 5489 1 4886 7443 1 7167 7462 1 5166 4305 2 3335 7450 1 4760 4595 1 6311 5792 1 4236 4046 2 3149 6858 1 5479 6938 2 908 6624 2 1572 6921 1 4351 5814 2 5235 7029 2 3787 6422 1 5676 5877 2 2204 7113 1 4848 5307 1 5498 5038 1...
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 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 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 2 1 1 1 1 1 1 1 2 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 2 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 2500 lines
Test #10:
score: 0
Accepted
time: 8ms
memory: 17356kb
input:
1 7500 7500 2 6350 6654 1 4293 4093 1 6105 3914 1 5864 6961 2 4515 6645 1 7274 6875 1 6125 4116 1 6411 7121 1 5223 4851 2 6534 7305 1 6931 7116 1 4162 5087 1 6164 6444 1 6261 6534 1 4974 6160 2 1182 6747 1 5753 4388 1 3768 4715 1 6952 6864 1 6415 4453 1 4793 5441 1 5121 5675 1 4555 4262 1 4637 7308 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 2 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 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 2 1 1 1 1 2 ...
result:
ok 1500 lines
Subtask #2:
score: 15
Accepted
Test #11:
score: 15
Accepted
time: 43ms
memory: 17364kb
input:
1 5000 100000 2 872 876 1 2895 4566 1 2676 1220 2 1852 1856 2 4153 4153 2 3675 3685 2 1489 1493 2 2782 2784 2 206 207 2 555 560 2 4149 4157 2 1875 1885 2 364 374 2 8 17 2 746 754 2 4785 4786 2 2394 2394 2 3386 3389 2 365 373 2 2290 2296 2 1419 1428 2 3651 3659 2 1922 1927 2 4877 4882 2 2597 2599 2 4...
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 95001 lines
Test #12:
score: 0
Accepted
time: 99ms
memory: 17408kb
input:
1 5000 100000 2 4315 4323 2 1391 1401 2 294 302 2 1704 1711 2 748 748 2 3430 3437 2 2045 2051 2 996 1005 2 902 904 2 4674 4676 2 296 298 2 951 961 2 451 460 1 4152 3232 2 311 312 2 2061 2071 2 1604 1608 2 2441 2450 2 1706 1716 2 4119 4122 2 3922 3925 2 4864 4870 2 2045 2048 2 4492 4493 2 1194 1194 2...
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 90000 lines
Test #13:
score: 0
Accepted
time: 141ms
memory: 17336kb
input:
1 5000 100000 1 3863 3903 1 3614 4823 1 3059 4959 1 4774 2867 2 308 315 2 4786 4795 1 3527 3266 2 3212 3216 1 4903 3744 2 4880 4886 1 3339 3841 1 3638 4103 2 2879 2882 1 4392 3446 1 2740 3593 1 2789 4670 1 4410 4102 2 3739 3746 2 3267 3273 2 366 369 1 4358 2943 1 4885 3247 2 3876 3885 2 1594 1600 2 ...
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 2 1 1 1 2 1 1 1 1 1 2 1 1 2 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 3 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 ...
result:
ok 50000 lines
Test #14:
score: 0
Accepted
time: 141ms
memory: 17320kb
input:
1 5000 100000 2 1345 1347 1 4935 4562 1 3712 4122 2 4084 4085 1 4688 4090 1 3636 4532 1 3700 3999 1 3823 2837 1 2600 2550 2 4697 4702 2 2552 2562 1 3066 4688 1 2916 3824 1 2969 3642 1 2668 4845 2 382 390 1 4553 4915 1 2771 2492 2 3215 3215 1 3293 4489 2 829 837 2 1474 1478 2 2382 2390 1 4835 2640 2 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 2 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 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 2 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 33333 lines
Test #15:
score: 0
Accepted
time: 143ms
memory: 17352kb
input:
1 5000 100000 1 3711 4544 1 4345 3233 1 3093 3703 1 2638 4716 1 3520 4256 1 4900 3769 1 3431 3355 1 3202 4977 1 4155 4656 1 4523 3916 1 4870 4714 1 3850 4187 1 4097 4756 1 3644 4764 1 4839 4587 1 2670 3002 1 4046 4044 1 4114 3845 1 4411 3712 1 4667 4086 1 2905 3088 1 4891 2638 1 3438 3272 1 4489 429...
output:
1 1 1 1 1 1 1 1 1 1 1 1 2 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 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 6 1 1 4 2 1 1 12 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 2 1 1 1 2 1 1 1 3 1 1 1 3 1 1 9 1 1 1 1 1 1 1 4 1 1 1 2 1 1 1 1 1 1 4 1 1 1 1 1 1...
result:
ok 10000 lines
Test #16:
score: 0
Accepted
time: 72ms
memory: 17272kb
input:
1 5000 100000 2 1695 1703 2 3589 3597 2 1845 1851 2 4713 4716 2 2060 2061 2 4546 4556 2 4069 4079 2 2691 2697 2 1196 1197 2 86 89 2 21 30 2 2514 2518 2 878 880 2 4334 4340 2 2147 2150 2 3370 3370 2 2399 2402 2 797 806 2 636 642 2 2710 2713 2 4789 4796 2 655 662 2 1637 1647 2 56 62 2 511 518 2 2353 2...
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 95000 lines
Test #17:
score: 0
Accepted
time: 98ms
memory: 17268kb
input:
1 5000 100000 2 1435 4052 2 3840 4283 2 4155 4973 2 4460 4659 2 1652 4351 2 2044 4753 1 3997 4580 2 1992 4952 2 3146 4097 2 4083 4501 2 952 4491 2 1092 4216 2 3349 4747 2 4581 4748 1 4202 4324 2 4977 4983 2 2656 4189 2 3402 4468 2 865 4740 2 1684 4111 2 2411 4818 1 3601 3207 2 3484 4585 2 4796 4868 ...
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 90000 lines
Test #18:
score: 0
Accepted
time: 135ms
memory: 17400kb
input:
1 5000 100000 2 2730 4008 1 4986 3666 2 1804 4165 1 2736 2518 1 4404 3171 2 4324 4774 2 1634 4665 2 138 4161 2 3357 4453 2 4481 4795 2 679 4425 2 1711 4587 1 4010 3433 2 3633 4302 2 4012 4393 2 1310 4444 2 1936 4163 1 4524 4229 2 2009 4368 1 2850 2672 1 3761 4106 2 3052 4980 1 4662 3294 1 4826 4466 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 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 2 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 2 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 50000 lines
Test #19:
score: 0
Accepted
time: 144ms
memory: 17352kb
input:
1 5000 100000 1 4787 4153 1 4149 3780 1 2526 3859 1 2890 3087 1 2871 3790 1 4080 3879 1 4536 4253 2 1664 4445 1 2830 4278 1 3007 3914 2 1692 4619 2 2184 4614 1 3588 3796 2 4390 4413 1 3731 3400 2 2442 4489 1 4111 3813 1 3738 2765 1 2952 2646 2 1029 4756 2 1260 4814 1 4686 4350 2 2581 4666 2 4147 473...
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 2 1 1 1 1 1 1 3 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 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 1 1 1 1 1 1 1 1 1 2 1 1 1 3 1 1 2 1 1 1 1 1 1 1 1 2 1 1 ...
result:
ok 33333 lines
Test #20:
score: 0
Accepted
time: 142ms
memory: 17356kb
input:
1 5000 100000 1 4135 4198 1 2706 4361 1 2822 4502 1 2923 4402 1 3651 3809 1 4552 4432 1 3370 2499 1 4247 3013 1 4524 3752 1 4046 4141 2 2177 4791 1 4841 4370 1 4659 3128 2 4742 4971 2 4115 4323 1 2691 3572 1 2776 3787 1 4210 4293 1 4639 4325 1 3019 3246 1 2813 3820 1 3737 3794 1 3013 4299 1 2942 288...
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 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 3 2 1 1 1 2 1 1 1 1 1 1 1 1 1 5 1 1 1 1 2 2 1 1 1 1 1 3 2 1 2 3 2 1 1 1 8 2 1 1 7 2 1 1 1 1 4 20 1 1 3 1 1 1 2 2 7 1 1 7 1 1 1 5 5 1 1 1 1 1 1 1 16 1 1 1 1 1 2 2 1 1 1 1 6 1 1 1 1 1 1 1 ...
result:
ok 10000 lines
Subtask #3:
score: 20
Accepted
Test #21:
score: 20
Accepted
time: 556ms
memory: 17872kb
input:
0 100000 100000 1 29135 32144 1 58340 30601 1 68869 18606 1 73019 84578 1 13050 79881 1 22773 20030 1 74542 28744 1 46491 64238 1 26985 17174 1 93308 48003 1 90547 4510 1 18373 35069 1 34019 14080 1 13461 19407 1 33811 60169 1 22131 76457 1 88085 38979 1 49749 20241 1 90505 42660 1 25889 75426 1 420...
output:
80930
result:
ok single line: '80930'
Test #22:
score: 0
Accepted
time: 115ms
memory: 17396kb
input:
0 10000 100000 1 6042 9322 1 5723 6899 2 2207 2214 2 7557 7567 2 7648 7658 2 3150 3156 2 7555 7560 2 9657 9661 2 5681 5686 2 5736 5744 1 9993 9001 2 6887 6893 2 5765 5765 2 7983 7987 2 2427 2433 2 8236 8245 1 5381 8258 2 7503 7513 2 236 244 2 816 816 2 5139 5147 1 9243 6698 2 8713 8718 2 4569 4571 2...
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 80000 lines
Test #23:
score: 0
Accepted
time: 82ms
memory: 17336kb
input:
0 20000 100000 2 19051 19059 2 11055 11065 2 1238 1244 2 13935 13939 2 5561 5569 2 12222 12232 1 19498 16106 2 15732 15739 2 13935 13944 2 357 359 2 4162 4166 2 13885 13894 2 175 185 1 17668 12969 2 2028 2036 1 19277 16172 2 13017 13018 1 11178 15138 2 1432 1439 1 10356 19031 2 13481 13488 1 19721 1...
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 80000 lines
Test #24:
score: 0
Accepted
time: 190ms
memory: 17392kb
input:
0 20000 100000 1 16630 15229 2 5468 5471 1 10875 19665 2 13264 13272 2 19524 19529 1 10585 14283 1 16911 18952 1 13938 19032 1 12349 17734 2 12134 12135 2 19637 19641 2 10440 10448 1 19266 15489 2 16764 16772 2 1038 1044 1 17444 16671 2 8206 8206 1 19664 14689 1 15060 11016 2 13510 13513 1 17044 156...
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 33333 lines
Test #25:
score: 0
Accepted
time: 125ms
memory: 17348kb
input:
0 50000 100000 2 49987 49987 1 43787 46393 1 37151 42291 1 31096 33599 2 1752 1755 2 4467 4477 2 21321 21326 2 34625 34633 1 40544 26327 2 31100 31103 1 31751 30971 2 22519 22522 2 42769 42770 1 40110 39451 1 48495 29422 1 35693 27838 1 42250 46507 2 21102 21109 1 41450 41990 2 27916 27920 2 41251 4...
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 50000 lines
Test #26:
score: 0
Accepted
time: 168ms
memory: 17324kb
input:
0 100000 100000 1 96907 76199 2 87440 87450 1 87657 58774 1 65732 61745 1 93781 75145 1 73765 50447 1 72180 77794 1 94918 79638 1 65681 86609 1 71503 52788 1 72114 68639 1 90261 61021 1 61887 52644 1 69857 94793 1 85125 55713 1 68748 61829 1 91118 98694 1 51565 68902 1 56201 71518 1 56652 72447 1 51...
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 10000 lines
Test #27:
score: 0
Accepted
time: 167ms
memory: 17280kb
input:
0 50000 100000 2 44733 44737 1 1 12831 2 17267 17276 1 9120 6077 2 23023 23026 2 6266 6269 1 4 14323 1 1 35986 1 3 602 2 24393 24397 1 2 1467 1 4 1322 2 39495 39498 1 4 42577 1 2 914 2 34112 34112 1 1 47749 1 2 31401 1 3 35303 1 3 15033 1 3 10892 2 13562 13563 2 21586 21592 2 48602 48611 2 29426 294...
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 50000 lines
Test #28:
score: 0
Accepted
time: 243ms
memory: 17328kb
input:
0 100000 100000 1 3 53441 1 3 83517 1 1 49395 1 2 53764 1 1 54305 1 4 70526 1 1 43861 1 4 41652 1 4 28430 1 2 35231 1 3 22871 1 3 83810 1 1 2017 1 17943 41941 1 4 81928 1 3 34752 1 3 92374 1 73103 63750 1 1 42561 1 3 6165 1 2373 45196 1 4 10206 1 59937 81463 1 3 68202 1 1 30942 1 1 84178 1 4 95641 1...
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 167 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 10000 lines
Test #29:
score: 0
Accepted
time: 94ms
memory: 17332kb
input:
0 100000 100000 1 52043 59717 1 52808 86974 2 54185 97792 2 43516 80690 2 29461 98053 1 92581 83816 2 69780 88954 1 70925 52631 2 25721 96440 2 63749 85215 2 44590 87986 1 81989 73590 1 71035 54298 1 79204 72678 1 62997 70643 1 57968 95209 2 13661 82587 2 88967 99297 1 87464 59759 1 59322 67510 1 57...
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 33333 lines
Test #30:
score: 0
Accepted
time: 163ms
memory: 17328kb
input:
0 100000 100000 1 56697 75261 2 1785 84690 1 74364 95041 1 72445 92573 1 85072 93572 1 66568 89422 1 89923 72016 1 84302 93568 1 68910 78225 1 72195 53561 1 55718 87993 1 56377 50717 1 82674 85604 1 56554 67457 1 70575 69354 1 88461 63312 1 96199 85948 1 50907 70476 2 74668 88401 2 20432 92996 1 595...
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 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 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 2 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 10000 lines
Subtask #4:
score: 20
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #31:
score: 20
Accepted
time: 552ms
memory: 17920kb
input:
1 100000 100000 1 62695 13629 1 90058 581 1 70830 43031 1 49376 22761 1 92629 75386 1 73875 32928 1 40826 56579 1 65817 30848 1 34239 42468 1 29059 27073 1 77785 29591 1 42961 51458 1 62424 33595 1 35525 48029 1 26155 55587 1 31547 70439 1 34186 31708 1 14951 65279 1 65576 42446 1 54670 91226 1 3152...
output:
54397
result:
ok single line: '54397'
Test #32:
score: 0
Accepted
time: 120ms
memory: 17340kb
input:
1 10000 100000 2 2914 2923 2 948 952 1 7682 9007 2 168 171 2 3280 3284 2 5164 5165 1 7128 5080 2 2643 2643 2 5297 5303 1 9145 9341 2 613 616 2 8807 8815 2 4912 4921 2 9875 9883 2 4405 4409 2 4080 4085 1 6359 7683 2 1871 1872 1 9485 5292 2 50 51 2 6526 6532 2 1990 1998 2 2490 2490 2 1768 1769 2 7132 ...
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 2 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 80000 lines
Test #33:
score: 0
Accepted
time: 83ms
memory: 17272kb
input:
1 20000 100000 2 14733 14742 2 16201 16202 2 14739 14744 2 10106 10106 2 15628 15629 1 12397 17004 1 16412 10459 2 15785 15785 2 8967 8976 2 13077 13081 2 9161 9169 2 2868 2877 2 11145 11149 2 1338 1346 2 11379 11387 2 15756 15761 2 2115 2120 2 17795 17804 2 16584 16594 2 2578 2581 2 18432 18442 2 9...
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 80000 lines
Test #34:
score: 0
Accepted
time: 191ms
memory: 17320kb
input:
1 20000 100000 1 14210 13274 1 11189 17394 1 15327 11614 1 12201 16472 1 18047 11884 1 11783 18538 1 15384 11558 2 1075 1078 1 17438 16844 1 10849 16073 1 15904 15954 2 3798 3799 2 15353 15355 2 13055 13062 2 3146 3146 1 16054 12642 1 18873 12944 2 8945 8948 1 17804 18993 1 12007 11959 1 17085 15093...
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 2 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 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 1 1 1 2 1 1 1 1 ...
result:
ok 33333 lines
Test #35:
score: 0
Accepted
time: 127ms
memory: 17348kb
input:
1 50000 100000 2 11244 11246 2 1873 1877 2 33085 33094 2 21817 21819 2 16544 16551 1 38729 41377 1 32673 39186 1 40773 41339 1 41919 31566 1 29471 46228 1 29965 37863 2 40006 40013 2 32142 32149 1 33561 25239 2 39364 39374 2 29653 29660 2 10222 10230 2 7211 7211 1 44830 39459 2 18914 18920 2 23246 2...
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 50000 lines
Test #36:
score: 0
Accepted
time: 165ms
memory: 17272kb
input:
1 100000 100000 1 92026 55404 1 56760 68832 1 95304 84647 1 79629 71797 2 16778 16778 1 88116 66083 1 79145 58795 1 88778 77612 1 83820 89763 2 95087 95094 1 74444 92248 1 85490 49995 1 83866 64729 1 83071 60733 2 80140 80142 1 82195 96779 1 66487 92945 2 9893 9901 1 96472 81185 1 59070 79368 1 5042...
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 2 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 10000 lines
Test #37:
score: 0
Accepted
time: 175ms
memory: 17252kb
input:
1 50000 100000 1 38141 38960 1 4 45688 2 48553 48553 1 2 7700 2 46399 46405 2 3076 3082 2 40357 40358 2 27721 27721 1 2 30495 2 13319 13320 1 2 4994 2 27812 27819 2 7709 7714 1 42456 45052 2 17821 17825 2 27651 27657 2 16018 16026 2 22967 22969 2 26212 26221 2 912 920 2 19921 19922 1 1 27332 2 10110...
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 50000 lines
Test #38:
score: 0
Accepted
time: 248ms
memory: 17352kb
input:
1 100000 100000 1 99031 19199 1 4 62682 2 69963 69964 1 51048 64416 1 2 6135 1 3 19117 1 100000 2118 1 100000 73918 1 3 76073 1 3 41811 1 25587 76692 1 28965 61302 1 9370 58779 1 1 29991 1 2 98251 1 2 55581 1 28448 21447 1 1 72132 1 1 84810 1 57102 801 1 1 51919 1 100000 20134 1 2 18476 1 99570 2932...
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 10000 lines
Test #39:
score: 0
Accepted
time: 98ms
memory: 17352kb
input:
1 100000 100000 1 91984 68575 2 17505 89465 2 65086 95644 2 2581 81615 1 85295 64375 1 76738 76499 1 81750 65774 1 57355 69428 2 74866 83570 1 64303 58207 2 73574 85468 1 75920 95423 1 68971 97855 1 59862 62985 1 71786 50681 1 98742 83342 1 77503 61789 1 99829 55701 2 98773 98857 2 69754 88366 1 547...
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 33333 lines
Test #40:
score: 0
Accepted
time: 167ms
memory: 17280kb
input:
1 100000 100000 1 95657 75613 1 66830 57722 1 70095 87913 2 7275 80806 1 89236 73535 2 8365 83612 2 72110 93597 1 79189 79480 1 84011 99218 1 62361 77868 1 54881 86613 1 76372 82181 1 59191 90090 1 65326 81561 1 91242 79273 2 47948 99968 2 23581 89352 1 78190 83913 1 68418 79769 1 52623 80734 2 6400...
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 2 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 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 10000 lines
Subtask #5:
score: 0
Time Limit Exceeded
Dependency #3:
100%
Accepted
Test #41:
score: 0
Time Limit Exceeded
input:
0 500000 500000 1 153366 461301 1 402458 312431 1 24864 471768 1 423645 58443 1 106601 157640 1 136693 44542 1 290752 134249 1 425937 374427 1 125165 179248 1 335514 162511 1 255068 233664 1 334095 126185 1 487317 435567 1 206065 479388 1 219464 260165 1 385308 421655 1 277456 390877 1 279526 464427...
output:
result:
Subtask #6:
score: 0
Skipped
Dependency #4:
100%
Accepted
Dependency #5:
0%