QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#646370#9465. 基础 01 练习题_l_l_45 2232ms363860kbC++144.3kb2024-10-16 22:31:302024-10-16 22:31:31

Judging History

你现在查看的是最新测评结果

  • [2024-10-16 22:31:31]
  • 评测
  • 测评结果:45
  • 用时:2232ms
  • 内存:363860kb
  • [2024-10-16 22:31:30]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
typedef unsigned long long ull;
vector<int> mod[MAXN]; vector<pair<int, int>> qvc[MAXN]; ull rd[2][MAXN], pw[MAXN]; mt19937 rnd(40094229); int n;
namespace sgt1 {
	const int N = MAXN * (19 * 4 + 4); int val[N], ls[N], rs[N], tot; ull hsh[N];
	void pushup(int rt, int l, int mid, int r) {val[rt] = val[ls[rt]] ^ val[rs[rt]]; hsh[rt] = hsh[ls[rt]] * pw[r - mid] + hsh[rs[rt]];}
	void build(int &rt, int l, int r) {
		rt = ++tot; if (l == r) return hsh[rt] = rd[val[rt] = 0][l], void(); int mid = (l + r) >> 1; build(ls[rt], l, mid); build(rs[rt], mid + 1, r); pushup(rt, l, mid, r);
	}
	void modify(int &rt, int rt2, int l, int r, int x) {
		rt = ++tot; ls[rt] = ls[rt2]; rs[rt] = rs[rt2]; if (l == r) return hsh[rt] = rd[val[rt] = !val[rt2]][l], void();
		int mid = (l + r) >> 1; x <= mid ? modify(ls[rt], ls[rt2], l, mid, x) : modify(rs[rt], rs[rt2], mid + 1, r, x); pushup(rt, l, mid, r);
	}
	int query(int rt, int rt2, int l, int r, int &s) {
		if (hsh[rt] == hsh[rt2]) return s ^= val[rt], r + 1; if (l == r) return s ^= val[rt], l; int mid = (l + r) >> 1, t; if ((t = query(ls[rt], ls[rt2], l, mid, s)) <= mid) return t; else return query(rs[rt], rs[rt2], mid + 1, r, s);
	}
}
struct node {int mx, mn;}; node operator + (const node &x, const node &y) {return {max(x.mx, y.mx), min(x.mn, y.mn)};}
int rk[MAXN];
namespace sgt2 {
	node val[MAXN << 2][2]; bool tag[MAXN << 2]; void addtag(int rt) {tag[rt] ^= 1; swap(val[rt][0], val[rt][1]);}
	void pushdown(int rt) {if (tag[rt]) addtag(rt << 1), addtag(rt << 1 | 1), tag[rt] = 0;}
	void pushup(int rt) {for (int _ = 0; _ < 2; _++) val[rt][_] = val[rt << 1][_] + val[rt << 1 | 1][_];}
	void build(int rt, int l, int r) {
		if (l == r) return val[rt][0] = {rk[l], rk[l]}, val[rt][1] = {-1, n + 1}, void(); int mid = (l + r) >> 1; build(rt << 1, l, mid); build(rt << 1 | 1, mid + 1, r); pushup(rt);
	}
	void modify(int rt, int l, int r, int x, int y) {
		if (x <= l && r <= y) return addtag(rt); pushdown(rt); int mid = (l + r) >> 1; if (x <= mid) modify(rt << 1, l, mid, x, y); if (y > mid) modify(rt << 1 | 1, mid + 1, r, x, y); pushup(rt);
	}
}
int rts[MAXN], ord[MAXN], fa[MAXN << 1], nxt[MAXN << 1], lat[MAXN << 1], siz1[MAXN << 1], siz2[MAXN << 1]; long long tot, in[MAXN << 1]; int cnt;
void erase(int x) {if (lat[x]) nxt[lat[x]] = nxt[x]; if (nxt[x]) lat[nxt[x]] = lat[x];}
void insert(int x, int y) {lat[y] = x; nxt[y] = nxt[x]; if (nxt[x]) lat[nxt[x]] = y; nxt[x] = y;}
int findfa(int a) {return fa[a] == a ? a : fa[a] = findfa(fa[a]);}
int merge(int u, int v) {if (siz1[u] + siz2[u] < siz1[v] + siz2[v]) swap(u, v); fa[v] = u; tot += siz1[u] * siz2[v] + siz2[u] * siz1[v]; cnt -= in[u] != 0; cnt -= in[v] != 0; in[u] += in[v] + siz1[u] * siz2[v] + siz2[u] * siz1[v]; siz1[u] += siz1[v]; siz2[u] += siz2[v]; cnt += in[u] != 0; erase(v); return u;}
int main() {
	int q, op; scanf("%d %d %d", &n, &q, &op);
	auto o = uniform_int_distribution<int>(1, 130); ull x = o(rnd);
	pw[0] = 1; for (int i = 1; i <= n; i++) rd[0][i] = x, rd[1][i] = x % 130 + 1, pw[i] = pw[i - 1] * 131;
	for (int i = 1; i <= q; i++) {
		int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d);
		mod[a].push_back(c);
		if (d < n) mod[a].push_back(d + 1);
		if (b < n) mod[b + 1].push_back(c);
		if (b < n && d < n) mod[b + 1].push_back(d + 1);
		qvc[c].push_back({a, b}); if (d < n) qvc[d + 1].push_back({a, b});
	}
	sgt1::build(rts[0], 1, n); for (int i = 1; i <= n; i++) {ord[i] = n - i + 1; rts[i] = rts[i - 1]; for (int x : mod[i]) sgt1::modify(rts[i], rts[i], 1, n, x);}
	sort(ord + 1, ord + 1 + n, [&](int x, int y) {int s = 0, t = sgt1::query(rts[x], rts[y], 1, n, s); return t == n + 1 ? 0 : s == 0;});
	for (int i = 1; i <= n; i++) rk[ord[i]] = i;
	sgt2::build(1, 1, n); for (int i = 1; i <= n << 1; i++) fa[i] = i, siz1[i] = i <= n, siz2[i] = i > n; for (int i = 1; i <= n; i++) nxt[i] = i == n ? 0 : i + 1, lat[i] = i - 1;
	for (int i = 1; i <= n; i++) {
		for (auto &x : qvc[i]) sgt2::modify(1, 1, n, x.first, x.second);
		int l = sgt2::val[1][1].mn, r = sgt2::val[1][0].mx; bool tag = r < l; l = findfa(l); r = findfa(r);
		if (tag && l != r) insert(r, i + n); else if (tag && l == r) insert(r, i + n), merge(l, i + n);
		else {while (l != r) l = merge(l, nxt[l]), r = findfa(r); insert(l, i + n); merge(l, i + n);}
		printf("%lld%c", 1ll * n * i - tot + cnt, " \n"[i == n]);
	}
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 39800kb

input:

4 1000 0
2 3 1 2
1 3 1 3
1 2 1 2
1 2 3 4
1 4 2 4
1 3 1 2
1 4 1 2
1 3 1 4
3 3 2 3
1 2 2 4
4 4 1 3
3 3 3 4
3 4 3 4
2 3 1 1
1 2 2 4
1 4 3 4
3 4 1 2
1 2 2 3
3 4 3 3
1 2 4 4
4 4 2 4
1 4 1 1
1 1 1 3
2 3 2 3
1 1 2 4
2 3 2 4
3 3 1 4
3 3 3 3
1 3 3 3
2 3 2 4
3 3 2 2
1 3 2 4
1 3 1 2
3 4 1 2
2 3 1 3
1 1 1 2
1 2...

output:

4 3 1 1

result:

wrong answer 1st numbers differ - expected: '1', found: '4'

Subtask #2:

score: 0
Wrong Answer

Test #4:

score: 0
Wrong Answer
time: 108ms
memory: 146480kb

input:

50 200000 0
1 45 2 6
29 44 2 6
31 37 2 50
2 37 1 19
7 13 8 38
38 46 19 38
10 30 30 46
22 42 1 45
5 35 24 27
10 36 19 31
20 47 17 35
7 9 23 42
15 26 31 42
7 8 7 42
1 26 33 48
2 5 30 36
17 44 21 44
5 44 24 36
19 47 15 17
29 36 2 42
31 34 11 41
9 24 12 30
30 43 8 20
2 12 13 20
11 12 10 15
14 22 3 29
2 ...

output:

50 61 49 33 21 13 8 9 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

wrong answer 1st numbers differ - expected: '1', found: '50'

Subtask #3:

score: 0
Wrong Answer

Test #8:

score: 0
Wrong Answer
time: 302ms
memory: 259528kb

input:

5000 200000 0
1438 2561 3478 4930
1740 4634 87 3003
590 3275 1376 1681
2035 2793 2004 4945
567 3159 550 4470
61 3039 3431 3519
2654 3834 3460 4960
591 3560 409 443
345 2599 746 2891
1288 4570 1577 4402
249 377 1951 4534
2411 2455 294 1192
1679 3153 1645 4259
1735 1856 601 668
477 4881 411 2094
424 1...

output:

5000 5851 4543 3369 1996 1285 1023 561 397 341 287 289 287 309 301 321 341 361 115 121 127 89 93 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

wrong answer 1st numbers differ - expected: '1', found: '5000'

Subtask #4:

score: 10
Accepted

Test #14:

score: 10
Accepted
time: 302ms
memory: 257452kb

input:

5000 200000 1
565 4401 1659 1826
429 1640 2999 3495
572 3994 9 3863
3844 4284 2307 3144
1054 1943 358 2592
727 4248 29 1171
1685 2392 4559 4929
1149 2787 1204 1947
2349 2619 405 998
1910 2786 25 1275
912 3475 4384 4387
3822 4895 1849 4548
3082 4749 3457 4220
3174 4885 117 1085
2517 3919 4325 4869
17...

output:

5000 5653 3715 1781 1031 823 540 185 190 71 56 61 66 71 76 81 86 91 96 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 5000 numbers

Test #15:

score: 10
Accepted
time: 109ms
memory: 124236kb

input:

5000 200000 1
1 1 4840 5000
2 2 1690 5000
3 3 908 5000
4 4 1212 5000
5 5 2712 5000
6 6 3950 5000
7 7 4724 5000
8 8 3706 5000
9 9 1888 5000
10 10 4056 5000
11 11 1074 5000
12 12 3806 5000
13 13 3756 5000
14 14 2822 5000
15 15 1264 5000
16 16 4088 5000
17 17 796 5000
18 18 4888 5000
19 19 4610 5000
20...

output:

5000 9997 14997 19997 24997 29994 34974 39958 44944 49928 54902 59872 64858 69833 74833 79777 84760 89728 94710 99675 104675 109599 114578 119536 124492 129423 134374 139298 144270 149188 154130 159041 163948 168851 173814 178678 183638 188563 193522 198522 203288 208204 213158 218030 222898 227719 ...

result:

ok 5000 numbers

Test #16:

score: 10
Accepted
time: 98ms
memory: 120812kb

input:

5000 200000 1
4090 5000 1 1
3772 5000 2 2
3880 5000 3 3
1888 5000 4 4
2602 5000 5 5
4934 5000 6 6
4224 5000 7 7
226 5000 8 8
176 5000 9 9
2862 5000 10 10
224 5000 11 11
1204 5000 12 12
3202 5000 13 13
2726 5000 14 14
3468 5000 15 15
2134 5000 16 16
4392 5000 17 17
4814 5000 18 18
3748 5000 19 19
390...

output:

5000 10000 15000 20000 25000 30000 35000 40000 45000 50000 55000 60000 65000 70000 75000 80000 85000 90000 95000 100000 105000 110000 115000 120000 125000 130000 135000 140000 145000 150000 155000 160000 165000 170000 175000 180000 185000 190000 195000 200000 205000 210000 215000 220000 225000 23000...

result:

ok 5000 numbers

Test #17:

score: 10
Accepted
time: 156ms
memory: 150320kb

input:

5000 200000 1
1443 3558 1 1
2025 2976 2 2
837 4164 3 3
2197 2804 4 4
1545 3456 5 5
2471 2530 6 6
764 4237 7 7
2462 2539 8 8
44 4957 9 9
2283 2718 10 10
742 4259 11 11
959 4042 12 12
1558 3443 13 13
1111 3890 14 14
2090 2911 15 15
687 4314 16 16
509 4492 17 17
1461 3540 18 18
2060 2941 19 19
2218 278...

output:

5000 10000 15000 20000 25000 30000 35000 40000 45000 50000 55000 60000 65000 70000 75000 80000 85000 90000 95000 100000 105000 110000 115000 120000 125000 130000 135000 140000 145000 150000 155000 160000 165000 170000 175000 180000 185000 190000 195000 200000 205000 210000 215000 220000 225000 23000...

result:

ok 5000 numbers

Test #18:

score: 10
Accepted
time: 134ms
memory: 152740kb

input:

5000 200000 1
1 1 1194 3807
2 2 721 4280
3 3 471 4530
4 4 142 4859
5 5 1727 3274
6 6 1549 3452
7 7 551 4450
8 8 981 4020
9 9 1649 3352
10 10 2233 2768
11 11 980 4021
12 12 1498 3503
13 13 196 4805
14 14 381 4620
15 15 2085 2916
16 16 1559 3442
17 17 890 4111
18 18 1853 3148
19 19 527 4474
20 20 881 ...

output:

5000 10000 14973 19950 24950 29950 34950 39833 44833 49758 54691 59605 64557 69557 74557 79557 84557 89151 94065 98975 103975 108975 113975 118975 123975 128251 133251 138030 143030 147768 152768 157768 162768 167163 172009 177009 181653 186486 191486 196140 200961 205778 210591 215591 220205 225205...

result:

ok 5000 numbers

Test #19:

score: 10
Accepted
time: 248ms
memory: 260432kb

input:

5000 200000 1
1 2402 1 2
1 85 3 4
1 610 5 6
1 531 7 8
1 1258 9 10
1 2389 11 12
1 885 13 14
1 1658 15 16
1 2210 17 18
1 643 19 20
1 1079 21 22
1 499 23 24
1 1768 25 26
1 224 27 28
1 237 29 30
1 124 31 32
1 359 33 34
1 248 35 36
1 1896 37 38
1 1867 39 40
1 625 41 42
1 2407 43 44
1 2370 45 46
1 2177 47...

output:

5000 7635 2635 2261 1936 1645 1611 1705 1873 2021 2223 2401 2601 2801 3001 3201 3401 3601 3801 4001 4201 4401 4601 4801 5001 5201 5401 5601 5801 6001 6201 6401 6601 6801 7001 7201 7401 7601 7801 8001 8201 8401 8386 8581 8776 8971 9166 9361 9556 9751 9946 10141 10336 10531 10726 10921 11116 11311 115...

result:

ok 5000 numbers

Test #20:

score: 10
Accepted
time: 279ms
memory: 260272kb

input:

5000 200000 1
1 2 1 1040
3 4 1 742
5 6 1 187
7 8 1 378
9 10 1 595
11 12 1 1296
13 14 1 1104
15 16 1 2266
17 18 1 1137
19 20 1 1383
21 22 1 2167
23 24 1 1540
25 26 1 118
27 28 1 1783
29 30 1 2023
31 32 1 2185
33 34 1 1951
35 36 1 2292
37 38 1 2268
39 40 1 458
41 42 1 88
43 44 1 120
45 46 1 1782
47 48...

output:

5000 10000 15000 20000 25000 30000 35000 40000 45000 50000 55000 60000 65000 70000 75000 80000 85000 90000 95000 100000 105000 110000 115000 120000 125000 130000 135000 140000 145000 150000 155000 160000 165000 170000 175000 180000 185000 190000 195000 200000 205000 210000 215000 220000 225000 23000...

result:

ok 5000 numbers

Subtask #5:

score: 0
Wrong Answer

Test #21:

score: 15
Accepted
time: 1133ms
memory: 360808kb

input:

200000 200000 1
1 2 1 6
3 4 1 1
5 6 1 5
7 8 1 3
9 10 1 3
11 12 1 6
13 14 1 5
15 16 1 6
17 18 1 6
19 20 1 1
21 22 1 4
23 24 1 5
25 26 1 2
27 28 1 4
29 30 1 3
31 32 1 2
33 34 1 6
35 36 1 3
37 38 1 2
39 40 1 2
41 42 1 3
43 44 1 1
45 46 1 2
47 48 1 3
49 50 1 4
51 52 1 5
53 54 1 1
55 56 1 5
57 58 1 5
59 ...

output:

200000 400000 532619 597930 598645 533081 733081 933081 631687 831687 1031687 1064777 1264777 1464777 1664777 1864777 1897874 2097874 2297874 2330961 2530961 2730961 2764057 2964057 3164057 3364057 3564057 3764057 3964057 3997153 4197153 4397153 4597153 4797153 4997153 5197153 5230249 5430249 563024...

result:

ok 200000 numbers

Test #22:

score: 15
Accepted
time: 945ms
memory: 357164kb

input:

200000 200000 1
1 4 1 2
1 3 3 4
1 6 5 6
1 2 7 8
1 2 9 10
1 6 11 12
1 2 13 14
1 3 15 16
1 3 17 18
1 6 19 20
1 1 21 22
1 5 23 24
1 1 25 26
1 6 27 28
1 1 29 30
1 1 31 32
1 1 33 34
1 5 35 36
1 3 37 38
1 1 39 40
1 2 41 42
1 6 43 44
1 3 45 46
1 4 47 48
1 3 49 50
1 4 51 52
1 4 53 54
1 1 55 56
1 4 57 58
1 3...

output:

200000 400000 599992 799992 999981 1199971 1399971 1599938 1799938 1999921 2199911 2399901 2599901 2799901 2999891 3199869 3399858 3599847 3799806 3999793 4199686 4399686 4599671 4799656 4999593 5199551 5399533 5599515 5799469 5999421 6199421 6399371 6599371 6799319 6999137 7199044 7399015 7598986 7...

result:

ok 200000 numbers

Test #23:

score: 15
Accepted
time: 945ms
memory: 361204kb

input:

200000 200000 1
1 2 1 2
1 6 3 4
1 1 5 6
1 2 7 8
1 5 9 10
1 2 11 12
1 6 13 14
1 1 15 16
1 3 17 18
1 5 19 20
1 3 21 22
1 6 23 24
1 5 25 26
1 2 27 28
1 1 29 30
1 3 31 32
1 2 33 34
1 2 35 36
1 3 37 38
1 5 39 40
1 6 41 42
1 2 43 44
1 5 45 46
1 5 47 48
1 3 49 50
1 5 51 52
1 2 53 54
1 5 55 56
1 6 57 58
1 1...

output:

200000 400000 600000 800000 1000000 1199971 1399965 1599952 1799945 1999929 2199901 2399869 2599833 2799819 2999819 3199819 3399777 3599746 3799729 3999712 4199695 4399659 4599641 4799602 4999539 5199518 5399497 5599476 5799476 5999476 6199429 6399353 6599301 6799276 6999221 7199195 7399137 7599110 ...

result:

ok 200000 numbers

Test #24:

score: 0
Wrong Answer
time: 1333ms
memory: 360660kb

input:

200000 200000 1
1 2 3 6
3 4 3 6
5 6 3 5
7 8 3 6
9 10 3 4
11 12 2 5
13 14 2 5
15 16 2 2
17 18 1 1
19 20 2 3
21 22 3 5
23 24 2 5
25 26 1 5
27 28 2 5
29 30 1 4
31 32 1 1
33 34 1 6
35 36 3 7
37 38 3 7
39 40 1 6
41 42 2 5
43 44 3 7
45 46 1 5
47 48 2 3
49 50 2 7
51 52 1 2
53 54 3 8
55 56 3 5
57 58 3 5
59 ...

output:

200000 244003 133246 133117 111726 66913 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

wrong answer 9th numbers differ - expected: '200001', found: '1'

Subtask #6:

score: 0
Wrong Answer

Test #28:

score: 0
Wrong Answer
time: 1721ms
memory: 360772kb

input:

200000 200000 0
91264 123676 6826 154505
121351 188051 108158 131448
65413 163961 26771 116304
93852 110556 34929 187363
31794 142162 33578 38712
26574 67763 178013 197235
46436 146042 95 122860
11683 50463 60177 195245
60862 194711 37817 97212
144366 176271 113551 171098
120095 170517 73555 167299
...

output:

200000 400000 600000 579979 623729 501865 527331 511481 530061 530529 546845 508961 519857 530753 541649 552545 563441 574337 585233 596129 607025 617921 628817 639713 650609 618977 628101 637225 646349 655473 664597 673721 682845 691969 701093 710217 719341 728465 629697 635905 642113 648321 654529...

result:

wrong answer 1st numbers differ - expected: '400001', found: '200000'

Subtask #7:

score: 35
Accepted

Test #37:

score: 35
Accepted
time: 821ms
memory: 335940kb

input:

100000 200000 1
1 22878 1 2
1 7957 3 4
1 21779 5 6
1 34321 7 8
1 41692 9 10
1 49473 11 12
1 10254 13 14
1 43995 15 16
1 46975 17 18
1 668 19 20
1 25996 21 22
1 24975 23 24
1 43259 25 26
1 4174 27 28
1 39330 29 30
1 35462 31 32
1 27523 33 34
1 5574 35 36
1 47955 37 38
1 47013 39 40
1 3846 41 42
1 276...

output:

100000 200000 195499 260665 271141 281125 247871 244233 167815 186461 119505 130369 136332 146819 139966 149297 158628 167959 38799 40841 42883 44925 46967 49009 51051 53093 55135 57177 59219 61261 63303 65345 67387 69429 71471 73513 75555 77597 79639 81681 83723 85765 87807 89849 82711 75257 69937 ...

result:

ok 100000 numbers

Test #38:

score: 35
Accepted
time: 855ms
memory: 339288kb

input:

100000 200000 1
1 2 1 49478
3 4 1 14485
5 6 1 31201
7 8 1 26895
9 10 1 40944
11 12 1 35847
13 14 1 19021
15 16 1 43774
17 18 1 20305
19 20 1 39980
21 22 1 13770
23 24 1 16404
25 26 1 45734
27 28 1 48842
29 30 1 16814
31 32 1 1987
33 34 1 29392
35 36 1 12267
37 38 1 17547
39 40 1 28676
41 42 1 9513
4...

output:

100000 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000 1600000 1700000 1800000 1900000 2000000 2100000 2200000 2300000 2400000 2500000 2600000 2700000 2800000 2900000 3000000 3100000 3200000 3300000 3400000 3500000 3600000 3700000 3800000 39000...

result:

ok 100000 numbers

Test #39:

score: 35
Accepted
time: 959ms
memory: 336412kb

input:

100000 200000 1
1 2 1 35162
3 4 1 31702
5 6 1 1660
7 8 1 10240
9 10 1 8763
11 12 1 31436
13 14 1 18048
15 16 1 33735
17 18 1 36181
19 20 1 282
21 22 1 9633
23 24 1 5237
25 26 1 9143
27 28 1 42670
29 30 1 46242
31 32 1 2303
33 34 1 2467
35 36 1 38417
37 38 1 3307
39 40 1 19414
41 42 1 33762
43 44 1 3...

output:

100000 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000 1600000 1700000 1800000 1900000 2000000 2100000 2200000 2300000 2400000 2500000 2600000 2700000 2800000 2900000 3000000 3100000 3200000 3300000 3400000 3500000 3600000 3700000 3800000 39000...

result:

ok 100000 numbers

Test #40:

score: 35
Accepted
time: 1080ms
memory: 260380kb

input:

100000 200000 1
43178 56823 1 1
675 99326 2 2
15099 84902 3 3
4203 95798 4 4
23354 76647 5 5
41222 58779 6 6
15927 84074 7 7
39572 60429 8 8
40253 59748 9 9
32007 67994 10 10
15324 84677 11 11
29454 70547 12 12
31223 68778 13 13
7737 92264 14 14
33351 66650 15 15
45210 54791 16 16
28837 71164 17 17
...

output:

100000 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000 1600000 1700000 1800000 1900000 2000000 2100000 2200000 2300000 2400000 2500000 2600000 2700000 2800000 2900000 3000000 3100000 3200000 3300000 3400000 3500000 3600000 3700000 3800000 39000...

result:

ok 100000 numbers

Test #41:

score: 35
Accepted
time: 1043ms
memory: 336760kb

input:

100000 200000 1
24 82240 56597 91255
26810 82165 18477 22393
9362 24598 53820 92593
68653 83682 16581 31580
17086 81545 70066 71299
26891 53343 4122 35933
27137 61932 16905 52055
9728 69119 26769 80202
7404 34071 3636 52818
59726 95606 6460 97518
7723 22242 61797 94241
25097 71751 56647 65839
45036 ...

output:

100000 130029 41890 25005 21841 23671 27616 31561 35506 30751 33826 35041 37961 40881 19756 21073 22390 23707 25024 26341 27658 20087 21000 21913 22826 23739 24652 25565 26478 27391 28304 29217 16006 16491 16976 17461 17946 18431 18916 19401 19886 20371 20856 21341 21826 22311 22796 23281 23766 2425...

result:

ok 100000 numbers

Test #42:

score: 35
Accepted
time: 1128ms
memory: 336756kb

input:

100000 200000 1
10442 70043 2175 22031
4751 86216 49718 75813
11230 75716 34714 50209
16942 65616 33095 95840
33191 72240 14261 31402
9935 34540 12217 30676
58193 92643 17134 90866
23201 90801 51849 97032
21201 27012 54197 54348
82079 92697 60976 72155
53763 74827 13276 64080
55841 57573 19848 58819...

output:

100000 200000 151606 78017 75741 85945 44430 32873 36982 41091 45200 13405 10544 11355 12166 12977 13788 14473 15277 16081 16885 17689 15618 16297 16976 17655 18334 19013 19692 20371 21050 21729 22408 23087 23766 24445 25124 25803 26482 27161 27840 28519 29198 29877 30556 31235 31914 32593 33272 339...

result:

ok 100000 numbers

Test #43:

score: 35
Accepted
time: 770ms
memory: 250448kb

input:

200000 200000 1
191770 200000 1 1
49834 200000 2 2
137006 200000 3 3
16604 200000 4 4
174746 200000 5 5
164448 200000 6 6
60062 200000 7 7
186290 200000 8 8
96212 200000 9 9
14358 200000 10 10
37358 200000 11 11
75496 200000 12 12
97964 200000 13 13
110230 200000 14 14
9604 200000 15 15
188424 20000...

output:

200000 400000 600000 800000 1000000 1200000 1400000 1600000 1800000 2000000 2200000 2400000 2600000 2800000 3000000 3200000 3400000 3600000 3800000 4000000 4200000 4400000 4600000 4800000 5000000 5200000 5400000 5600000 5800000 6000000 6200000 6400000 6600000 6800000 7000000 7200000 7400000 7600000 ...

result:

ok 200000 numbers

Test #44:

score: 35
Accepted
time: 1100ms
memory: 247972kb

input:

200000 200000 1
1 1 47436 200000
2 2 145508 200000
3 3 86384 200000
4 4 89596 200000
5 5 54700 200000
6 6 109498 200000
7 7 93690 200000
8 8 112142 200000
9 9 128928 200000
10 10 186574 200000
11 11 120000 200000
12 12 113798 200000
13 13 141426 200000
14 14 128510 200000
15 15 21714 200000
16 16 75...

output:

200000 400000 600000 800000 1000000 1200000 1399993 1599986 1799973 1999961 2199953 2399938 2599938 2799938 2999938 3199933 3399927 3599919 3799914 3999903 4199903 4399903 4599903 4799892 4999883 5199872 5399864 5599850 5799834 5999808 6199796 6399796 6599796 6799796 6999796 7199796 7399796 7599796 ...

result:

ok 200000 numbers

Test #45:

score: 35
Accepted
time: 1055ms
memory: 249900kb

input:

200000 200000 1
1 1 123918 200000
2 2 77032 200000
3 3 136820 200000
4 4 162384 200000
5 5 4904 200000
6 6 22228 200000
7 7 142570 200000
8 8 115024 200000
9 9 192398 200000
10 10 122324 200000
11 11 178300 200000
12 12 196486 200000
13 13 39810 200000
14 14 134430 200000
15 15 184864 200000
16 16 7...

output:

200000 400000 600000 800000 1000000 1199997 1399992 1599985 1799981 1999971 2199966 2399966 2599966 2799963 2999961 3199955 3399952 3599937 3799932 3999903 4199895 4399877 4599877 4799877 4999877 5199872 5399869 5599869 5799869 5999864 6199858 6399846 6599840 6799828 6999814 7199790 7399780 7599760 ...

result:

ok 200000 numbers

Test #46:

score: 35
Accepted
time: 1664ms
memory: 363860kb

input:

200000 200000 1
1 1 82579 117422
2 2 63022 136979
3 3 8144 191857
4 4 64744 135257
5 5 1783 198218
6 6 41837 158164
7 7 71106 128895
8 8 31078 168923
9 9 3943 196058
10 10 56362 143639
11 11 67719 132282
12 12 8975 191026
13 13 31283 168718
14 14 19388 180613
15 15 76274 123727
16 16 61568 138433
17...

output:

200000 400000 600000 800000 1000000 1200000 1400000 1600000 1800000 2000000 2200000 2400000 2600000 2800000 3000000 3200000 3400000 3600000 3800000 4000000 4200000 4400000 4600000 4800000 5000000 5200000 5400000 5600000 5800000 6000000 6200000 6400000 6600000 6800000 7000000 7200000 7400000 7600000 ...

result:

ok 200000 numbers

Test #47:

score: 35
Accepted
time: 1692ms
memory: 363860kb

input:

200000 200000 1
1 1 53027 146974
2 2 47299 152702
3 3 94867 105134
4 4 64012 135989
5 5 55552 144449
6 6 35166 164835
7 7 36618 163383
8 8 22902 177099
9 9 6101 193900
10 10 74168 125833
11 11 86934 113067
12 12 90059 109942
13 13 55109 144892
14 14 67424 132577
15 15 79712 120289
16 16 75707 124294...

output:

200000 400000 600000 800000 1000000 1200000 1400000 1600000 1800000 2000000 2200000 2400000 2600000 2800000 3000000 3200000 3400000 3600000 3800000 4000000 4200000 4400000 4600000 4800000 5000000 5200000 5400000 5600000 5800000 6000000 6200000 6400000 6600000 6800000 7000000 7200000 7400000 7600000 ...

result:

ok 200000 numbers

Test #48:

score: 35
Accepted
time: 2150ms
memory: 361424kb

input:

200000 200000 1
67288 132713 1 1
49773 150228 2 2
41713 158288 3 3
83513 116488 4 4
98696 101305 5 5
18310 181691 6 6
68386 131615 7 7
71251 128750 8 8
39058 160943 9 9
84043 115958 10 10
61872 138129 11 11
95740 104261 12 12
15793 184208 13 13
53398 146603 14 14
75066 124935 15 15
13068 186933 16 1...

output:

200000 400000 600000 800000 1000000 1200000 1400000 1600000 1800000 2000000 2200000 2400000 2600000 2800000 3000000 3200000 3400000 3600000 3800000 4000000 4200000 4400000 4600000 4800000 5000000 5200000 5400000 5600000 5800000 6000000 6200000 6400000 6600000 6800000 7000000 7200000 7400000 7600000 ...

result:

ok 200000 numbers

Test #49:

score: 35
Accepted
time: 2232ms
memory: 359700kb

input:

200000 200000 1
62126 137875 1 1
76402 123599 2 2
70364 129637 3 3
28999 171002 4 4
6601 193400 5 5
46650 153351 6 6
22854 177147 7 7
21102 178899 8 8
60671 139330 9 9
12158 187843 10 10
69159 130842 11 11
79623 120378 12 12
85415 114586 13 13
14428 185573 14 14
36043 163958 15 15
67689 132312 16 16...

output:

200000 400000 600000 800000 1000000 1200000 1400000 1600000 1800000 2000000 2200000 2400000 2600000 2800000 3000000 3200000 3400000 3600000 3800000 4000000 4200000 4400000 4600000 4800000 5000000 5200000 5400000 5600000 5800000 6000000 6200000 6400000 6600000 6800000 7000000 7200000 7400000 7600000 ...

result:

ok 200000 numbers

Test #50:

score: 35
Accepted
time: 1616ms
memory: 359604kb

input:

200000 200000 1
1 1 80000 120001
2 2 39479 160522
3 3 88314 111687
4 4 4715 195286
5 5 47511 152490
6 6 87159 112842
7 7 48784 151217
8 8 67603 132398
9 9 59415 140586
10 10 9894 190107
11 11 35357 164644
12 12 26658 173343
13 13 4891 195110
14 14 45616 154385
15 15 80953 119048
16 16 88368 111633
1...

output:

200000 400000 600000 800000 1000000 1200000 1400000 1600000 1800000 2000000 2200000 2400000 2600000 2800000 3000000 3200000 3400000 3600000 3800000 4000000 4200000 4400000 4600000 4800000 5000000 5200000 5400000 5600000 5800000 6000000 6200000 6400000 6600000 6800000 7000000 7200000 7400000 7600000 ...

result:

ok 200000 numbers