QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#461957#2005. Dancing ElephantsGalex100 ✓5495ms40896kbC++142.2kb2024-07-03 11:04:292024-07-03 11:04:29

Judging History

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

  • [2024-07-03 11:04:29]
  • 评测
  • 测评结果:100
  • 用时:5495ms
  • 内存:40896kb
  • [2024-07-03 11:04:29]
  • 提交

answer

#include <bits/stdc++.h>
#define LL long long
#define ULL unsigned long long
using namespace std;

const int MAXN = 150005, B = 400, MAXB = 805;

int n, m, len;
int L[MAXB], R[MAXB], bl[MAXN], a[MAXN], b[MAXN];
int C, cnt[MAXB][MAXB], en[MAXB][MAXB], val[MAXB][MAXB], sz[MAXB];
map<int, int> mp;

int getbl(int x) {
	return lower_bound(R, R + C + 1, x) - R;
}

void rebuild(int x) {
	for (int i = sz[x]; i; i--) {
		int p = lower_bound(val[x] + 1, val[x] + sz[x] + 1, val[x][i] + len + 1) - val[x];
		if (p == sz[x] + 1)
			en[x][i] = val[x][i] + len, cnt[x][i] = 1;
		else
			en[x][i] = en[x][p], cnt[x][i] = 1 + cnt[x][p];
	}
}

void rebuild() {
	for (int i = 1; i <= n; i++)
		b[i] = a[i];
	sort(b + 1, b + n + 1);
	m = unique(b + 1, b + n + 1) - b - 1;
	b[m + 1] = 1e9 + 5, C = (m - 1) / B + 1;
	for (int i = 0; i <= C; i++)
		sz[i] = 0;
	for (int i = 1; i <= m; i++)
		bl[i] = (i - 1) / B + 1, R[bl[i]] = b[i + 1] - 1, val[bl[i]][++sz[bl[i]]] = b[i];
	for (int i = m; i; i--)
		L[bl[i]] = b[i];
	L[0] = 0, R[0] = b[1] - 1;
	for (int i = 0; i <= C; i++)
		rebuild(i);
}

void init(int N, int Len, int *x) {
	n = N, len = Len;
	for (int i = 1; i <= n; i++)
		a[i] = x[i - 1], mp[a[i]]++;
	rebuild();
}

int tmp[MAXB], c = 0, f = 0;

void del(int x, int v) {
	c = f = 0;
	for (int i = 1; i <= sz[x]; i++) {
		if (val[x][i] == v && !f)
			f = 1;
		else
			tmp[++c] = val[x][i];
	}
	sz[x] = c;
	for (int i = 1; i <= c; i++)
		val[x][i] = tmp[i];
	rebuild(x);
}

void insert(int x, int v) {
	c = f = 0;
	for (int i = 1; i <= sz[x]; i++) {
		if (val[x][i] > v && !f)
			f = 1, tmp[++c] = v;
		tmp[++c] = val[x][i];
	}
	if (!f)
		tmp[++c] = v;
	sz[x] = c;
	for (int i = 1; i <= c; i++)
		val[x][i] = tmp[i];
	rebuild(x);
	if (sz[x] > 2 * B)
		rebuild();
}

int update(int x, int y) {
	x++, mp[a[x]]--;
	if (!mp[a[x]])
		del(getbl(a[x]), a[x]);
	a[x] = y;
	if (!mp[y])
		insert(getbl(y), y);
	mp[y]++;
	int lst = -1, ans = 0;
	for (int i = 0; i <= C; i++) {
		int p = lower_bound(val[i] + 1, val[i] + sz[i] + 1, lst + 1) - val[i];
		if (p == sz[i] + 1)
			continue;
		ans += cnt[i][p], lst = en[i][p];
	}
	return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 3ms
memory: 18152kb

input:

2 25 100
36
64
0 66 1
0 79 1
1 83 1
0 82 1
0 87 1
0 85 1
0 14 2
1 21 1
0 43 1
0 42 1
1 26 1
1 95 2
0 12 2
0 8 2
1 1 1
0 33 2
1 2 2
1 63 2
1 39 1
0 77 2
0 34 1
0 31 1
1 81 2
0 27 2
1 0 2
1 23 1
0 32 1
0 35 1
0 51 2
1 21 2
0 52 2
0 61 2
1 60 1
1 14 2
1 16 2
0 63 2
1 48 1
1 15 2
0 62 2
1 20 2
0 24 1
0 ...

output:

Correct.

Test #2:

score: 0
Accepted
time: 2ms
memory: 18136kb

input:

2 47 45
61
105
0 57 2
1 101 1
1 36 1
0 91 2
1 108 1
0 88 1
1 17 2
1 90 1
0 94 1
0 39 2
0 87 1
1 72 1
1 82 1
0 21 2
1 83 2
1 22 1
1 107 2
0 64 1
1 65 1
0 69 1
1 64 1
0 70 1
1 72 1
0 68 1
0 70 1
1 56 1
1 77 1
0 58 1
1 53 1
0 102 2
0 2 2
0 51 1
0 47 1
0 20 1
0 80 1
1 75 1
1 26 2
1 28 2
1 65 1
0 77 1
0 ...

output:

Correct.

Test #3:

score: 0
Accepted
time: 0ms
memory: 18140kb

input:

2 49 70
63
117
1 24 1
1 67 1
1 66 1
1 67 1
1 61 1
1 18 1
1 23 1
1 21 1
1 26 1
0 29 1
0 22 1
1 87 2
1 88 2
0 23 2
0 90 1
0 11 2
0 47 1
1 86 1
1 95 1
0 100 1
0 91 1
0 81 1
0 53 1
1 112 2
0 54 2
1 51 1
1 49 1
0 53 1
0 58 1
0 47 1
0 26 1
1 48 1
0 23 1
0 17 1
0 52 1
0 27 1
1 25 1
0 26 1
1 21 1
0 23 1
1 5...

output:

Correct.

Subtask #2:

score: 16
Accepted

Dependency #1:

100%
Accepted

Test #4:

score: 16
Accepted
time: 3ms
memory: 18148kb

input:

100 500 100
514
1019
1517
2022
2523
3023
3522
4026
4529
5031
5533
6038
6540
7045
7545
8041
8539
9041
9536
10040
10537
11032
11534
12037
12538
13033
13529
14028
14524
15027
15526
16026
16527
17028
17528
18028
18523
19027
19525
20028
20533
21031
21528
22023
22525
23023
23521
24017
24518
25018
25522
26...

output:

Correct.

Test #5:

score: 0
Accepted
time: 2ms
memory: 18148kb

input:

100 50 100
61
115
161
206
259
312
362
416
468
514
565
619
668
713
759
812
857
911
966
1021
1066
1120
1171
1224
1270
1320
1372
1423
1474
1520
1566
1616
1666
1719
1773
1827
1878
1933
1986
2034
2088
2134
2188
2243
2288
2340
2388
2439
2493
2546
2592
2645
2698
2746
2794
2847
2899
2953
3002
3051
3104
3157...

output:

Correct.

Test #6:

score: 0
Accepted
time: 0ms
memory: 18212kb

input:

20 30 80
36
64
99
125
150
183
211
239
265
291
319
346
373
407
432
463
488
523
551
583
19 683 11
18 651 12
17 623 11
16 588 12
15 563 11
14 532 12
13 507 11
12 473 12
11 446 11
10 419 12
9 391 11
8 365 12
7 339 11
6 311 12
5 283 11
4 250 11
3 225 11
2 199 11
1 164 12
0 136 11
19 783 11
18 751 12
17 7...

output:

Correct.

Subtask #3:

score: 24
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #7:

score: 24
Accepted
time: 474ms
memory: 23336kb

input:

12500 30 50000
44
78
111
144
171
205
240
265
291
320
349
375
408
439
467
493
525
558
584
613
647
673
700
729
761
793
825
860
887
915
945
970
996
1028
1060
1094
1123
1149
1176
1208
1234
1261
1294
1327
1362
1390
1418
1451
1486
1514
1539
1571
1597
1632
1663
1692
1719
1746
1772
1802
1829
1854
1880
1913
...

output:

Correct.

Test #8:

score: 0
Accepted
time: 478ms
memory: 21608kb

input:

17500 30 50000
44
78
110
136
164
195
224
255
285
314
348
377
407
442
469
499
526
552
582
607
636
663
698
727
758
785
818
853
879
905
934
963
992
1027
1059
1091
1120
1152
1180
1210
1238
1263
1298
1325
1356
1383
1411
1443
1469
1498
1533
1566
1599
1632
1661
1691
1723
1754
1782
1810
1839
1873
1900
1928
...

output:

Correct.

Test #9:

score: 0
Accepted
time: 481ms
memory: 22132kb

input:

50000 1000 50000
100000000
100001000
100002000
100003000
100004000
100005000
100006000
100007000
100008000
100009000
100010000
100011000
100012000
100013000
100014000
100015000
100016000
100017000
100018000
100019000
100020000
100021000
100022000
100023000
100024000
100025000
100026000
100027000
100...

output:

Correct.

Test #10:

score: 0
Accepted
time: 1208ms
memory: 23436kb

input:

50000 100 50000
0
101
202
303
404
505
606
707
808
909
1010
1111
1212
1313
1414
1515
1616
1717
1818
1919
2020
2121
2222
2323
2424
2525
2626
2727
2828
2929
3030
3131
3232
3333
3434
3535
3636
3737
3838
3939
4040
4141
4242
4343
4444
4545
4646
4747
4848
4949
5050
5151
5252
5353
5454
5555
5656
5757
5858
5...

output:

Correct.

Test #11:

score: 0
Accepted
time: 1057ms
memory: 25348kb

input:

50000 1000 50000
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97...

output:

Correct.

Test #12:

score: 0
Accepted
time: 1612ms
memory: 25088kb

input:

50000 600 50000
168
253
345
627
837
1022
1168
1292
1466
1533
1720
1845
2083
2276
2421
2494
2684
2791
2792
3066
3262
3530
3636
3746
3831
3898
3949
3982
4033
4155
4223
4415
4606
4762
4793
4822
4845
4992
5134
5373
5630
5857
5895
6053
6242
6503
6597
6750
7016
7100
7347
7578
7600
7822
7970
8120
8319
8525...

output:

Correct.

Test #13:

score: 0
Accepted
time: 1094ms
memory: 25480kb

input:

50000 302 50000
3
6
9
12
15
18
21
24
27
30
33
36
39
42
45
48
51
54
57
60
63
66
69
72
75
78
81
84
87
90
93
96
99
102
105
108
111
114
117
120
123
126
129
132
135
138
141
144
147
150
153
156
159
162
165
168
171
174
177
180
183
186
189
192
195
198
201
204
207
210
213
216
219
222
225
228
231
234
237
240
...

output:

Correct.

Subtask #4:

score: 47
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #14:

score: 47
Accepted
time: 532ms
memory: 25048kb

input:

17500 150 69998
158
308
460
610
758
911
1058
1212
1359
1504
1659
1813
1960
2115
2261
2413
2561
2708
2859
3011
3161
3313
3459
3608
3762
3911
4065
4220
4366
4516
4665
4814
4960
5106
5253
5403
5549
5701
5850
6000
6148
6295
6441
6586
6736
6882
7031
7182
7328
7478
7633
7779
7929
8075
8221
8372
8526
8671
...

output:

Correct.

Test #15:

score: 0
Accepted
time: 807ms
memory: 20868kb

input:

23333 30 69999
43
68
99
128
153
187
221
252
287
319
351
385
417
446
477
505
536
570
596
622
651
685
718
750
779
806
834
867
892
927
958
992
1022
1057
1082
1117
1142
1177
1211
1239
1273
1298
1333
1366
1398
1429
1464
1489
1522
1557
1585
1619
1648
1673
1702
1733
1759
1791
1819
1846
1876
1902
1929
1963
...

output:

Correct.

Test #16:

score: 0
Accepted
time: 1644ms
memory: 23956kb

input:

50000 500 70000
509
1005
1501
1998
2494
2996
3501
4005
4502
5002
5499
6003
6502
7003
7504
8006
8501
9001
9496
9999
10502
11001
11498
11995
12497
12995
13495
13990
14494
14999
15498
16001
16498
16999
17504
18001
18504
19004
19509
20014
20513
21009
21508
22013
22516
23019
23516
24015
24515
25012
25511...

output:

Correct.

Test #17:

score: 0
Accepted
time: 2024ms
memory: 25276kb

input:

70000 500 70000
510
1015
1510
2013
2517
3019
3523
4019
4518
5017
5512
6012
6514
7015
7511
8011
8507
9006
9510
10007
10502
11006
11503
12007
12512
13016
13515
14016
14511
15007
15507
16003
16500
17003
17501
18004
18508
19012
19517
20013
20511
21008
21507
22012
22509
23011
23515
24016
24513
25017
2551...

output:

Correct.

Test #18:

score: 0
Accepted
time: 2170ms
memory: 28768kb

input:

70000 500 70000
212
461
595
751
821
879
917
966
1135
1372
1401
1447
1627
1805
1855
1913
1918
1928
1983
2178
2287
2404
2445
2473
2522
2596
2801
2984
3069
3302
3448
3468
3552
3724
3777
3964
4089
4221
4237
4412
4622
4852
4969
5013
5248
5393
5474
5646
5808
5854
6007
6036
6283
6355
6528
6541
6690
6696
67...

output:

Correct.

Test #19:

score: 0
Accepted
time: 1171ms
memory: 27084kb

input:

70000 49993 70000
500060000
500067142
500074284
500081426
500088568
500095710
500102852
500109994
500117136
500124278
500131420
500138562
500145704
500152846
500159988
500167130
500174272
500181414
500188556
500195698
500202840
500209982
500217124
500224266
500231408
500238550
500245692
500252834
50...

output:

Correct.

Test #20:

score: 0
Accepted
time: 2227ms
memory: 27064kb

input:

70000 500 70000
514
1014
1514
2009
2508
3011
3509
4008
4511
5007
5502
6006
6511
7010
7509
8011
8506
9002
9502
10007
10510
11005
11506
12004
12500
12995
13500
14005
14507
15003
15500
16002
16502
16999
17503
18001
18497
19000
19498
19996
20500
21002
21505
22010
22508
23004
23505
24001
24500
24995
2550...

output:

Correct.

Test #21:

score: 0
Accepted
time: 2422ms
memory: 29400kb

input:

70000 400 70000
153
320
379
496
607
711
854
973
999
1165
1197
1238
1250
1263
1420
1424
1556
1698
1717
1848
2025
2106
2133
2276
2281
2313
2509
2546
2586
2746
2823
2897
2912
3020
3030
3174
3250
3424
3489
3620
3794
3990
4061
4101
4295
4314
4439
4553
4707
4828
4840
5035
5078
5268
5378
5442
5564
5636
571...

output:

Correct.

Test #22:

score: 0
Accepted
time: 1660ms
memory: 28972kb

input:

70000 302 70000
3
6
9
12
15
18
21
24
27
30
33
36
39
42
45
48
51
54
57
60
63
66
69
72
75
78
81
84
87
90
93
96
99
102
105
108
111
114
117
120
123
126
129
132
135
138
141
144
147
150
153
156
159
162
165
168
171
174
177
180
183
186
189
192
195
198
201
204
207
210
213
216
219
222
225
228
231
234
237
240
...

output:

Correct.

Subtask #5:

score: 3
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #23:

score: 3
Accepted
time: 4122ms
memory: 38816kb

input:

150000 1000 150000
100000000
100001000
100002000
100003000
100004000
100005000
100006000
100007000
100008000
100009000
100010000
100011000
100012000
100013000
100014000
100015000
100016000
100017000
100018000
100019000
100020000
100021000
100022000
100023000
100024000
100025000
100026000
100027000
1...

output:

Correct.

Test #24:

score: 0
Accepted
time: 3372ms
memory: 37548kb

input:

150000 1000 150000
100000000
100001000
100002000
100003000
100004000
100005000
100006000
100007000
100008000
100009000
100010000
100011000
100012000
100013000
100014000
100015000
100016000
100017000
100018000
100019000
100020000
100021000
100022000
100023000
100024000
100025000
100026000
100027000
1...

output:

Correct.

Test #25:

score: 0
Accepted
time: 1777ms
memory: 30008kb

input:

150000 1000 150000
100000000
100001000
100002000
100003000
100004000
100005000
100006000
100007000
100008000
100009000
100010000
100011000
100012000
100013000
100014000
100015000
100016000
100017000
100018000
100019000
100020000
100021000
100022000
100023000
100024000
100025000
100026000
100027000
1...

output:

Correct.

Test #26:

score: 0
Accepted
time: 5495ms
memory: 38736kb

input:

150000 387 150000
100000000
100000129
100000258
100000387
100000516
100000645
100000774
100000903
100001032
100001161
100001290
100001419
100001548
100001677
100001806
100001935
100002064
100002193
100002322
100002451
100002580
100002709
100002838
100002967
100003096
100003225
100003354
100003483
10...

output:

Correct.

Test #27:

score: 0
Accepted
time: 4364ms
memory: 40896kb

input:

150000 387 150000
100000000
100000129
100000258
100000387
100000516
100000645
100000774
100000903
100001032
100001161
100001290
100001419
100001548
100001677
100001806
100001935
100002064
100002193
100002322
100002451
100002580
100002709
100002838
100002967
100003096
100003225
100003354
100003483
10...

output:

Correct.

Test #28:

score: 0
Accepted
time: 3826ms
memory: 23548kb

input:

4200 1000 150000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500...

output:

Correct.

Test #29:

score: 0
Accepted
time: 3579ms
memory: 21008kb

input:

4200 1000 150000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500...

output:

Correct.

Test #30:

score: 0
Accepted
time: 3839ms
memory: 25612kb

input:

4200 1000 150000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500...

output:

Correct.

Test #31:

score: 0
Accepted
time: 3567ms
memory: 23072kb

input:

4200 1000 150000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500000000
500...

output:

Correct.

Test #32:

score: 0
Accepted
time: 5146ms
memory: 37804kb

input:

150000 1000 150000
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
...

output:

Correct.

Test #33:

score: 0
Accepted
time: 2328ms
memory: 34436kb

input:

150000 1000 150000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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:

Correct.

Test #34:

score: 0
Accepted
time: 5319ms
memory: 36512kb

input:

150000 100 150000
0
101
202
303
404
505
606
707
808
909
1010
1111
1212
1313
1414
1515
1616
1717
1818
1919
2020
2121
2222
2323
2424
2525
2626
2727
2828
2929
3030
3131
3232
3333
3434
3535
3636
3737
3838
3939
4040
4141
4242
4343
4444
4545
4646
4747
4848
4949
5050
5151
5252
5353
5454
5555
5656
5757
5858...

output:

Correct.

Test #35:

score: 0
Accepted
time: 707ms
memory: 27112kb

input:

150000 100 150000
0
101
202
303
404
505
606
707
808
909
1010
1111
1212
1313
1414
1515
1616
1717
1818
1919
2020
2121
2222
2323
2424
2525
2626
2727
2828
2929
3030
3131
3232
3333
3434
3535
3636
3737
3838
3939
4040
4141
4242
4343
4444
4545
4646
4747
4848
4949
5050
5151
5252
5353
5454
5555
5656
5757
5858...

output:

Correct.

Test #36:

score: 0
Accepted
time: 29ms
memory: 19216kb

input:

150000 1000 150000
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
483595128
4...

output:

Correct.

Test #37:

score: 0
Accepted
time: 820ms
memory: 27044kb

input:

150000 1000 150000
0
1001
2002
3003
4004
5005
6006
7007
8008
9009
10010
11011
12012
13013
14014
15015
16016
17017
18018
19019
20020
21021
22022
23023
24024
25025
26026
27027
28028
29029
30030
31031
32032
33033
34034
35035
36036
37037
38038
39039
40040
41041
42042
43043
44044
45045
46046
47047
48048
...

output:

Correct.

Test #38:

score: 0
Accepted
time: 4889ms
memory: 34620kb

input:

150000 308 150000
3
6
9
12
15
18
21
24
27
30
33
36
39
42
45
48
51
54
57
60
63
66
69
72
75
78
81
84
87
90
93
96
99
102
105
108
111
114
117
120
123
126
129
132
135
138
141
144
147
150
153
156
159
162
165
168
171
174
177
180
183
186
189
192
195
198
201
204
207
210
213
216
219
222
225
228
231
234
237
24...

output:

Correct.

Test #39:

score: 0
Accepted
time: 3277ms
memory: 34624kb

input:

150000 23330 150000
500050000
500053333
500056666
500059999
500063332
500066665
500069998
500073331
500076664
500079997
500083330
500086663
500089996
500093329
500096662
500099995
500103328
500106661
500109994
500113327
500116660
500119993
500123326
500126659
500129992
500133325
500136658
500139991
...

output:

Correct.

Test #40:

score: 0
Accepted
time: 4534ms
memory: 36740kb

input:

150000 1448 150000
7
14
21
28
35
42
49
56
63
70
77
84
91
98
105
112
119
126
133
140
147
154
161
168
175
182
189
196
203
210
217
224
231
238
245
252
259
266
273
280
287
294
301
308
315
322
329
336
343
350
357
364
371
378
385
392
399
406
413
420
427
434
441
448
455
462
469
476
483
490
497
504
511
518
...

output:

Correct.

Test #41:

score: 0
Accepted
time: 4805ms
memory: 33424kb

input:

150000 600 150000
607
1211
1807
2412
3008
3613
4208
4803
5405
6004
6600
7196
7801
8405
9000
9601
10196
10796
11394
11992
12596
13191
13790
14389
14988
15591
16191
16787
17385
17983
18580
19175
19772
20372
20970
21572
22167
22766
23369
23971
24569
25168
25768
26366
26968
27563
28159
28760
29364
29963...

output:

Correct.

Test #42:

score: 0
Accepted
time: 4753ms
memory: 40780kb

input:

150000 4000 150000
4005
8006
12011
16014
20019
24019
28020
32020
36023
40028
44032
48029
52030
56032
60036
64037
68033
72037
76041
80038
84040
88044
92044
96041
100040
104039
108038
112041
116036
120033
124036
128034
132031
136032
140033
144036
148040
152044
156040
160042
164045
168047
172052
176054...

output:

Correct.