QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#178005#5378. 匹配问题zhoukangyang#55 15ms9780kbC++111.3kb2023-09-13 17:11:432024-07-04 01:56:21

Judging History

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

  • [2024-07-04 01:56:21]
  • 评测
  • 测评结果:55
  • 用时:15ms
  • 内存:9780kb
  • [2023-09-13 17:11:43]
  • 提交

answer

#include<bits/stdc++.h>
#define L(i, j, k) for(int i = (j); i <= (k); i++)
#define R(i, j, k) for(int i = (j); i >= (k); i--)
#define ll long long
#define ull unsigned long long 
#define sz(a) ((int) a.size())
#define vi vector<int>
#define me(a, x) memset(a, x, sizeof(a))
using namespace std;
const int N = 1 << 20, L = 5e5, mod = 998244353;

int n, la, lb;
int cnta[N], cntb[N];
int a[N], b[N];

multiset < int > st;
int main () { 
	ios :: sync_with_stdio(false);
	cin.tie (0); cout.tie (0);
	cin >> n >> la >> lb;
	L(i, 1, n) {
		cin >> a[i];
	}
	L(i, 1, n) {
		cin >> b[i];
	}
	sort(a + 1, a + n + 1);
	sort(b + 1, b + n + 1);
	int pos = 1;
	vi st;
	
	int ans = 0;
	L(i, 1, n) {
		while(pos <= n && a[pos] <= b[i]) {
			st.emplace_back(a[pos]);
			++pos;
		}
		auto lw = lower_bound(st.begin(), st.end(), b[i] - lb);
		int win = 0;
		if(lw != st.end()) {
			int val = *lw;
			st.erase(lw);
			
			win = 1;
			if(la < L) {
				L(j, 0, sz(st) - 1) {
					if(st[j] + la < b[i + j + 1]) {
						win = 0;
						break;
					}
				}
			}
			if(!win) {
				st.insert(lower_bound(st.begin(), st.end(), val), val);
			} else {
				++ans;
			}
		}
		
		if(!win) {
			st.erase(st.begin());
		}
	}
	cout << ans << '\n';
	return 0;
}

详细

Subtask #1:

score: 4
Accepted

Test #1:

score: 4
Accepted
time: 1ms
memory: 5648kb

input:

2 2 1
1 1
1 1

output:

2

result:

ok single line: '2'

Test #2:

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

input:

10 200000 100000
34181 300096 24293 22680 402306 193269 438170 254676 188147 73971
216849 477743 461911 135785 467234 278230 287107 223666 124173 135091

output:

7

result:

ok single line: '7'

Test #3:

score: 0
Accepted
time: 1ms
memory: 5808kb

input:

10 200000 50000
298370 136488 436143 52173 206095 140981 321188 407844 342157 193338
138374 383207 156748 442404 386749 492604 354156 229996 447123 418264

output:

5

result:

ok single line: '5'

Test #4:

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

input:

10 50000 30000
306273 53088 405351 218373 335275 277816 451436 105244 418031 83336
489843 323727 219514 102964 141689 337190 131790 312365 431836 413688

output:

5

result:

ok single line: '5'

Test #5:

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

input:

10 80000 60000
224299 63826 419731 459681 408367 139676 239118 115180 368327 179613
289195 106688 418781 143169 441337 255686 228353 373168 489321 173199

output:

10

result:

ok single line: '10'

Test #6:

score: 0
Accepted
time: 1ms
memory: 5648kb

input:

10 150000 80000
218617 21495 443909 77126 349241 169574 387539 106419 251533 138042
427196 237082 192262 56014 357102 109789 495939 197573 273744 498979

output:

7

result:

ok single line: '7'

Test #7:

score: 0
Accepted
time: 1ms
memory: 5840kb

input:

10 5 1
1 28 22 4 16 13 7 10 19 25
6 9 27 12 30 24 18 15 3 21

output:

0

result:

ok single line: '0'

Test #8:

score: 0
Accepted
time: 1ms
memory: 5536kb

input:

10 2 1
19 13 16 22 28 25 7 1 4 10
6 21 30 9 15 12 27 18 3 24

output:

0

result:

ok single line: '0'

Test #9:

score: 0
Accepted
time: 1ms
memory: 5804kb

input:

9 5 1
9 1 12 2 16 5 8 15 19
18 20 4 7 14 6 21 13 11

output:

3

result:

ok single line: '3'

Test #10:

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

input:

10 500000 1
13 1 16 4 22 7 10 28 25 19
9 3 30 18 24 15 6 20 27 12

output:

1

result:

ok single line: '1'

Test #11:

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

input:

3 2 1
1 2 3
3 4 5

output:

0

result:

ok single line: '0'

Test #12:

score: 0
Accepted
time: 1ms
memory: 5812kb

input:

10 500000 499999
375282 375282 375282 375282 375282 375282 375282 375282 375282 375282
375282 375282 375282 375282 375282 375282 375282 375282 375282 375282

output:

10

result:

ok single line: '10'

Subtask #2:

score: 14
Accepted

Dependency #1:

100%
Accepted

Test #13:

score: 14
Accepted
time: 1ms
memory: 5672kb

input:

100 200000 50000
216198 375994 364079 318600 289827 26059 302540 179976 362307 239456 310052 149745 283732 189278 465297 19986 492322 62889 399607 354136 103590 327594 335929 428453 474630 362205 113883 219196 488463 150086 144585 8342 98764 454065 282581 397786 274728 271563 326538 246226 384730 25...

output:

63

result:

ok single line: '63'

Test #14:

score: 0
Accepted
time: 1ms
memory: 5672kb

input:

100 200000 10000
480821 383273 197373 419379 37439 203333 299170 472531 243830 178320 365484 188981 414062 72193 411592 424204 340704 77915 241035 418858 18916 22153 349730 52029 216408 254012 239845 340707 326325 217780 49620 457023 424881 447611 180529 299451 97390 388124 62096 217848 229883 36748...

output:

50

result:

ok single line: '50'

Test #15:

score: 0
Accepted
time: 1ms
memory: 5648kb

input:

100 200000 5000
248114 369741 180383 287869 440522 23446 77242 341565 270689 231933 318395 106083 425489 353655 339921 86901 464488 473163 90027 262555 343418 64735 38062 128873 201978 157259 398800 244502 277724 193275 415958 252223 338307 425455 385803 408262 493113 470196 456942 87927 48611 13535...

output:

48

result:

ok single line: '48'

Test #16:

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

input:

100 100000 50000
486345 297886 26025 474314 100979 481518 11500 283550 332460 445057 17533 144840 221191 392737 115392 302986 454624 423360 16963 446798 30332 270733 1813 396977 352733 134622 233480 413553 229390 162339 373438 159455 456285 111216 188711 265590 452306 73 124816 278925 143310 283361 ...

output:

82

result:

ok single line: '82'

Test #17:

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

input:

100 100000 5000
439157 15849 342210 416475 203400 331705 267562 496741 5582 1527 80269 362890 93819 325171 471805 492364 426232 179298 212402 373335 320351 280366 363315 268413 180120 228943 308449 335872 155669 7017 449849 234951 12715 258464 24847 476960 498347 331138 484617 468028 15269 307198 34...

output:

43

result:

ok single line: '43'

Test #18:

score: 0
Accepted
time: 1ms
memory: 5592kb

input:

100 50000 5000
356138 75991 429667 167698 190384 320685 49056 231155 493359 58606 294380 305694 417163 211543 183439 211048 241022 110826 325734 464543 194473 243735 16536 155717 338096 404192 189355 169201 133506 495056 164315 116861 112397 262901 303833 236119 52989 331273 270007 359116 2070 25260...

output:

41

result:

ok single line: '41'

Test #19:

score: 0
Accepted
time: 1ms
memory: 5652kb

input:

100 50000 7000
278750 385984 434621 58472 322689 269436 245170 17244 456888 11920 210805 31811 289511 463364 155357 467516 459079 191267 396040 454082 460194 103191 92335 494144 114187 326720 309988 123829 214131 141758 455879 416627 2031 134103 431343 325594 81548 358209 273302 421176 259867 446631...

output:

46

result:

ok single line: '46'

Test #20:

score: 0
Accepted
time: 1ms
memory: 5668kb

input:

100 50000 10000
44671 199153 486351 64506 331287 386915 95122 54209 376550 139713 371612 188414 388792 75322 179157 370318 183962 317192 183394 351017 304929 390544 253896 334074 275884 159986 348155 8929 192946 258068 419481 63725 327275 244648 58851 289296 385871 201431 40630 255845 261638 230397 ...

output:

40

result:

ok single line: '40'

Test #21:

score: 0
Accepted
time: 1ms
memory: 5604kb

input:

100 30000 5000
370274 110702 441251 272581 129801 352167 122734 60816 261473 2126 292718 151986 8139 321067 83913 278084 103390 203161 32695 280737 164143 431372 197003 71699 61831 174258 38384 56872 419945 197154 204290 148171 337649 346984 294808 178731 381524 299625 285955 237110 425019 130281 24...

output:

36

result:

ok single line: '36'

Test #22:

score: 0
Accepted
time: 1ms
memory: 5652kb

input:

100 30000 8000
251366 436756 233765 308050 194657 435426 433129 386977 140841 136428 356400 496170 57335 389627 375625 184631 255361 454672 119519 334233 383164 157349 100449 15554 66998 57625 234164 79397 327508 375708 319035 322094 266219 56301 245907 52931 256785 32213 367928 157824 467045 49924 ...

output:

49

result:

ok single line: '49'

Test #23:

score: 0
Accepted
time: 1ms
memory: 5880kb

input:

100 20000 10000
214869 191290 19116 251609 491675 223459 457066 63933 189882 450667 343040 67504 433800 357884 11077 254264 429652 49101 262977 349432 333510 236391 383768 216721 363804 214450 456066 61650 170593 294394 37815 62425 405074 488694 194382 476654 123487 152483 247976 339464 430823 10631...

output:

65

result:

ok single line: '65'

Test #24:

score: 0
Accepted
time: 1ms
memory: 5808kb

input:

100 20000 5000
437462 329536 281051 49656 311386 383880 414050 304141 222086 464737 473489 111375 486227 33389 425895 173908 13428 333673 416322 248683 193081 170119 7585 258089 30268 462767 229201 424598 229857 498012 391803 83729 496967 399202 254599 55990 344248 65292 466212 268316 439263 329296 ...

output:

35

result:

ok single line: '35'

Test #25:

score: 0
Accepted
time: 1ms
memory: 5876kb

input:

100 20000 8000
186991 153145 224998 168406 333689 14632 43352 351492 312667 7271 450525 115816 251856 477325 64515 195920 60688 271020 155268 30582 63814 316250 14753 299856 424233 33441 328071 95459 447508 188164 355273 77339 155202 373087 447826 215904 212918 277562 304754 31015 4340 350427 250433...

output:

52

result:

ok single line: '52'

Test #26:

score: 0
Accepted
time: 1ms
memory: 5880kb

input:

100 20000 15000
44059 345504 396488 324911 213580 103158 409930 350640 488727 232174 193116 195392 481090 498251 410616 438595 455380 289496 327872 112377 139575 216353 343918 272424 127610 59561 247654 479113 123751 28485 333387 158487 420901 114134 490297 130126 23097 287176 146717 282195 283608 1...

output:

88

result:

ok single line: '88'

Test #27:

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

input:

100 8000 6000
300083 476523 482608 21733 28565 486450 130857 230311 413484 166500 162587 260465 293137 250677 91590 495361 213360 89633 310942 46372 284836 308066 312348 22024 254554 461569 41723 400947 197082 286616 390455 302256 462378 481962 455426 45603 457483 404009 279406 207812 461602 279234 ...

output:

78

result:

ok single line: '78'

Test #28:

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

input:

100 8000 3000
349688 110364 204130 261795 399833 443387 7687 397959 231285 426706 308452 125270 252485 405799 90 6212 392185 196397 230660 90964 309814 58734 321188 94974 274155 258035 133847 137190 142104 270143 419182 422564 131482 172427 436081 120129 165426 468786 292634 422791 107056 157405 394...

output:

47

result:

ok single line: '47'

Test #29:

score: 0
Accepted
time: 1ms
memory: 5588kb

input:

100 8000 5000
432732 28718 32127 157910 400081 293228 282303 467763 177603 377587 436200 15806 290625 208627 320226 295877 97340 275915 225419 227052 425917 326666 203460 408584 69791 222820 24515 254501 384537 56310 391749 32870 230072 142265 218590 430854 215072 28096 199398 235671 96365 493361 48...

output:

70

result:

ok single line: '70'

Test #30:

score: 0
Accepted
time: 1ms
memory: 5884kb

input:

100 20000 7500
265668 267070 51164 288683 360507 70115 344194 159434 288683 288683 118552 204469 495058 260491 455254 288683 161325 148274 141485 316912 356624 270993 288683 270981 456336 288683 494888 243289 454834 386616 288683 160061 288683 102794 309555 179758 414065 480849 415057 288683 204579 ...

output:

65

result:

ok single line: '65'

Test #31:

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

input:

100 40000 12000
148990 264865 225361 15902 148990 387814 368692 148990 358572 154517 148990 148990 148990 148990 114698 148990 148990 148990 461229 148990 148990 148990 447993 166967 63548 148990 375511 149289 148990 148990 497498 148990 442420 148990 168189 295994 148990 148990 326163 457297 148990...

output:

76

result:

ok single line: '76'

Test #32:

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

input:

100 5 1
220 274 166 49 133 19 7 91 40 67 286 73 142 58 229 13 280 31 295 199 100 43 97 217 190 202 139 1 79 172 148 283 127 178 181 64 25 16 253 37 151 154 268 85 4 223 106 103 61 298 112 22 130 214 211 28 193 115 289 163 169 196 226 121 184 82 76 55 265 124 109 52 157 262 241 247 235 205 238 88 70 ...

output:

0

result:

ok single line: '0'

Test #33:

score: 0
Accepted
time: 1ms
memory: 5588kb

input:

100 2 1
199 214 271 253 274 262 289 16 181 1 76 250 88 298 19 232 190 85 175 178 7 79 172 133 202 142 166 259 187 34 136 241 286 13 31 28 112 226 43 205 127 40 52 4 67 220 139 208 151 229 10 25 121 292 277 295 49 148 97 115 160 82 145 196 268 100 193 184 256 244 265 91 247 163 157 238 64 109 235 283...

output:

0

result:

ok single line: '0'

Test #34:

score: 0
Accepted
time: 1ms
memory: 5672kb

input:

99 5 1
226 120 145 2 40 222 71 134 194 92 93 103 152 89 106 163 58 110 187 44 169 211 156 176 29 215 37 65 148 219 183 47 127 173 43 197 124 117 205 180 33 201 99 135 82 1 208 79 149 128 142 64 198 9 190 113 5 229 75 19 212 72 170 159 61 50 177 36 100 218 78 12 131 162 51 26 141 57 16 23 155 107 191...

output:

33

result:

ok single line: '33'

Test #35:

score: 0
Accepted
time: 1ms
memory: 5672kb

input:

100 500000 1
292 154 187 4 52 286 91 172 250 118 121 133 196 298 136 211 76 142 241 58 217 271 202 226 37 277 49 85 190 283 235 61 163 223 55 253 160 151 265 232 43 259 127 175 106 1 268 103 193 166 184 82 256 13 244 145 7 295 97 25 274 94 220 205 79 64 229 46 130 280 100 16 169 208 67 34 181 73 22 ...

output:

1

result:

ok single line: '1'

Test #36:

score: 0
Accepted
time: 1ms
memory: 5880kb

input:

100 2000 500
418148 67772 425443 340480 340480 340480 340480 340480 340480 316215 294520 338888 340480 100549 115089 340480 107308 340480 340480 340480 340480 340480 174618 18800 340480 301568 340480 340480 340480 340480 232718 340480 340480 259501 295002 340480 340480 138230 340480 41270 340480 194...

output:

66

result:

ok single line: '66'

Test #37:

score: 0
Accepted
time: 1ms
memory: 5600kb

input:

100 2000 300
377953 322264 413478 413478 376432 413478 413478 334955 233334 66253 413478 304735 413478 413478 21922 413478 413478 413478 413478 161562 413478 413478 413478 413478 91165 413478 460936 413478 418372 262631 413478 352490 224110 276955 413478 191376 39467 56781 413478 413478 460179 41347...

output:

58

result:

ok single line: '58'

Test #38:

score: 0
Accepted
time: 1ms
memory: 5668kb

input:

100 1300 500
275326 32201 43613 32201 32201 32201 32201 32201 32201 32201 109685 32201 32201 32201 317745 32201 32201 32201 32201 32201 481269 100696 214472 32201 10494 38972 434257 258191 32201 32201 32201 330759 461123 184513 312960 401127 32201 32201 379885 150822 32201 44681 150926 402532 20978 ...

output:

66

result:

ok single line: '66'

Test #39:

score: 0
Accepted
time: 1ms
memory: 5540kb

input:

100 1300 300
105199 105199 135094 238839 105199 105199 105199 105199 105199 114122 190730 105199 105199 251539 438687 80445 105199 400921 105199 105199 105199 105199 105199 105199 105199 105199 431617 105199 105199 469254 123139 350126 6811 372888 360852 93084 199402 105199 105199 105199 105199 1051...

output:

65

result:

ok single line: '65'

Test #40:

score: 0
Accepted
time: 1ms
memory: 5808kb

input:

100 2000 80
332966 226626 332966 225313 332966 332966 183595 332966 233583 332966 379780 449197 366550 332966 174233 332966 309128 332966 332966 199315 332966 43405 406348 455211 332966 332966 332966 110679 311635 332966 332966 332966 487496 332966 385059 332966 223471 239312 387602 332966 332966 10...

output:

54

result:

ok single line: '54'

Test #41:

score: 0
Accepted
time: 1ms
memory: 5540kb

input:

100 2000 130
384497 481777 50122 20784 343979 343979 398541 259243 65525 110266 343979 343979 343979 248299 343979 343979 343979 343979 493144 343979 452004 343979 343979 343979 343979 343979 150234 377797 196132 343979 343979 29893 424743 69112 343979 343979 229115 343979 343979 450379 343979 42121...

output:

55

result:

ok single line: '55'

Test #42:

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

input:

100 1300 50
397272 101950 473518 17739 473518 473518 473518 468065 250285 473518 166170 473518 473518 184167 224701 193447 473518 473518 473518 318583 222407 473518 317358 473518 473518 473518 473518 14161 473518 473518 100624 473518 473518 176415 473518 113482 462613 473518 449088 473518 473518 259...

output:

50

result:

ok single line: '50'

Test #43:

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

input:

100 1300 100
435913 93884 217777 145492 145492 280703 145492 340217 43451 145492 145492 314747 351065 340743 145492 145492 145492 477577 145492 176153 145492 284890 13898 145492 432377 145492 145492 235162 219042 145492 488155 145492 145492 145492 467400 299157 145492 145492 145492 142783 145492 145...

output:

52

result:

ok single line: '52'

Test #44:

score: 0
Accepted
time: 1ms
memory: 5608kb

input:

100 2000 1000
131926 62202 165169 131926 131926 393587 7138 46568 131926 131926 131926 131926 396926 234879 131926 131926 131926 328546 131926 131926 37402 328699 300984 456035 160067 400781 65346 131926 131926 131926 179303 331672 131926 186742 131926 131926 131926 250103 131926 131926 131926 21872...

output:

73

result:

ok single line: '73'

Test #45:

score: 0
Accepted
time: 1ms
memory: 5676kb

input:

100 1300 700
459203 224768 459203 459203 459203 459203 459203 172480 209823 23 459203 459203 459203 459203 459203 203877 459203 459203 399243 459203 445094 390194 51075 459203 29023 459203 235059 315626 459203 459203 408210 300568 24624 459203 459203 223172 459203 397353 277240 459203 459203 459203 ...

output:

75

result:

ok single line: '75'

Test #46:

score: 0
Accepted
time: 1ms
memory: 5540kb

input:

3 2 1
1 2 3
3 4 5

output:

0

result:

ok single line: '0'

Test #47:

score: 0
Accepted
time: 1ms
memory: 5652kb

input:

100 500000 499999
176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 176385 17...

output:

100

result:

ok single line: '100'

Subtask #3:

score: 37
Accepted

Dependency #2:

100%
Accepted

Test #48:

score: 37
Accepted
time: 5ms
memory: 5704kb

input:

5000 233332 10000
421792 375018 481154 336831 239001 405616 387728 193044 450941 324370 238058 90659 431129 164919 47539 459063 498299 50838 171390 288397 159733 478192 6313 157409 366112 335593 328170 245357 341333 328352 250456 17602 438402 281715 81204 117468 456833 337362 432232 186808 408980 44...

output:

2973

result:

ok single line: '2973'

Test #49:

score: 0
Accepted
time: 4ms
memory: 5684kb

input:

5000 200000 100000
463972 56767 110693 292681 499566 41997 404179 244788 168434 455510 181483 119385 230325 255774 31791 162590 237076 440750 144186 459644 25418 393933 200590 3860 419876 374095 174245 423036 434239 95121 302917 418831 446448 140289 346795 283524 124706 199600 65161 276828 239470 36...

output:

4969

result:

ok single line: '4969'

Test #50:

score: 0
Accepted
time: 4ms
memory: 5640kb

input:

5000 200000 50000
390962 366941 47056 264653 117656 198976 254472 398425 456087 371287 236591 2258 5679 403623 464839 39953 214394 225500 163063 21966 12942 99235 180052 145749 110806 243882 436329 212301 178355 385664 382160 165605 47030 280986 233711 244374 195242 101972 146181 395092 5192 211774 ...

output:

3742

result:

ok single line: '3742'

Test #51:

score: 0
Accepted
time: 3ms
memory: 5580kb

input:

5000 200000 5000
412170 439436 423195 109785 446995 279063 261657 305828 405878 469830 250956 310049 58169 123746 458586 322197 276326 297809 50860 400354 179442 405807 358054 240050 268671 87055 12503 2895 261404 412130 390958 1991 235872 371126 134045 359202 31136 180095 180545 363632 223780 35317...

output:

2909

result:

ok single line: '2909'

Test #52:

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

input:

5000 200000 2000
86255 269733 470311 241609 370510 121746 16392 175001 857 302917 22537 227703 238055 141526 55297 228844 494741 183338 85915 435314 161970 194007 314244 57427 477283 204491 274489 293563 251994 318878 194836 404172 403414 202276 160305 408009 307402 237847 469358 305925 313829 44507...

output:

2820

result:

ok single line: '2820'

Test #53:

score: 0
Accepted
time: 4ms
memory: 5708kb

input:

5000 200000 8000
55319 472639 257094 420744 97206 377271 144238 75067 282580 331367 98069 28481 323234 491424 429932 296328 309663 390086 299578 329614 318774 273824 431663 437020 277997 205917 449171 269254 96207 263888 305054 28236 176350 217017 418469 355861 140875 163612 39349 82422 192430 23006...

output:

2872

result:

ok single line: '2872'

Test #54:

score: 0
Accepted
time: 3ms
memory: 5700kb

input:

5000 200000 20000
364777 99315 204678 453818 247564 93495 277220 368164 358536 44339 219166 429748 65704 304360 179252 417418 209106 407076 291702 398044 444937 18482 273224 480051 47306 166303 437761 271816 491353 342394 329193 346156 372214 285652 57848 445253 391374 170311 475239 262609 383220 13...

output:

3087

result:

ok single line: '3087'

Test #55:

score: 0
Accepted
time: 3ms
memory: 5632kb

input:

5000 200000 40000
72067 110481 263797 36637 290527 402012 162424 277517 331046 473231 105780 386456 185137 236418 263441 185006 148716 423368 183813 37872 111666 226918 70103 74307 336942 5159 409237 57493 118722 367955 157865 743 132814 497385 411056 192241 63513 15724 220351 136307 310182 53927 25...

output:

3524

result:

ok single line: '3524'

Test #56:

score: 0
Accepted
time: 3ms
memory: 5684kb

input:

5000 100000 50000
102920 441021 140300 251197 293853 231473 279326 274320 126824 176024 368042 27936 19396 343134 190006 271901 107608 427720 418562 343604 11564 253791 462233 369046 437649 380683 400009 440122 257989 366851 34567 298271 298795 91732 55603 326997 278203 452272 74873 36827 149663 102...

output:

4888

result:

ok single line: '4888'

Test #57:

score: 0
Accepted
time: 3ms
memory: 5612kb

input:

5000 100000 5000
473763 116865 466007 147529 444751 158381 393699 85889 330439 396004 303283 4445 118318 46596 409166 89897 445084 187858 395557 422104 341560 370603 27103 497263 181064 411102 143981 115217 415359 61384 110414 341073 304073 274642 47110 206510 69678 240507 441496 405292 463064 41616...

output:

2786

result:

ok single line: '2786'

Test #58:

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

input:

5000 100000 2000
43548 272158 34671 252439 66145 386375 246273 56615 156058 47562 299199 31644 251665 221113 498334 65805 159449 53968 102856 157441 408288 88943 164156 123142 27117 393201 77127 266363 109450 111311 217449 27313 281000 364199 376408 287202 23578 173909 147899 264580 139168 142218 36...

output:

2698

result:

ok single line: '2698'

Test #59:

score: 0
Accepted
time: 3ms
memory: 5636kb

input:

5000 100000 8000
419995 119296 337902 470746 229116 340649 470876 498496 472717 96683 261124 260984 371991 238429 165943 132692 426756 109715 408045 363621 490458 380961 220755 433872 177738 250359 54218 197665 369973 298073 262499 102804 248019 171918 231185 350148 68209 452465 130881 350203 152260...

output:

2880

result:

ok single line: '2880'

Test #60:

score: 0
Accepted
time: 3ms
memory: 5620kb

input:

5000 100000 20000
331402 331507 396897 237358 153764 287567 7956 161038 465314 99515 327003 173845 117432 219850 32541 122560 253212 195102 22362 61766 425978 201996 342663 213437 47997 332716 168107 378825 291933 16618 412535 474929 7730 497258 98690 133416 238830 135699 61631 17675 175715 96074 33...

output:

3281

result:

ok single line: '3281'

Test #61:

score: 0
Accepted
time: 3ms
memory: 5704kb

input:

5000 100000 40000
327322 162909 132466 255759 417172 139794 72052 155630 65598 428083 289132 261492 318169 430123 356475 66706 344890 273251 339303 262439 220945 19698 264354 476734 1516 291854 387696 353722 11807 205602 196906 411932 222978 200551 267172 228569 230406 308868 262872 434985 22164 376...

output:

4231

result:

ok single line: '4231'

Test #62:

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

input:

5000 50000 5000
69026 208262 170986 68305 356687 264015 471340 447592 226233 318998 90722 201767 176971 278958 450079 124961 478942 286884 356392 114120 448595 475580 404523 215718 292196 182892 321391 143598 176260 340620 362421 319332 243386 246333 4454 396554 53025 241093 21696 156000 138251 1131...

output:

2803

result:

ok single line: '2803'

Test #63:

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

input:

5000 50000 2000
361766 217345 259095 495419 175387 31709 110220 164187 11681 85054 395431 135149 305834 176625 455726 159689 301690 299390 132113 35627 187421 29462 95083 72584 69408 177695 230285 353128 246763 371903 55747 70250 370263 319135 177728 171772 339003 210144 185259 209215 245358 439787 ...

output:

2649

result:

ok single line: '2649'

Test #64:

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

input:

5000 50000 8000
312531 287967 167638 126803 172266 242033 462787 331114 6169 301115 470650 494275 452868 330086 367809 84589 295957 21080 291903 452338 319314 478023 453121 231714 164547 112754 52761 175097 451457 379376 304072 231578 320601 391081 74521 133176 224230 50043 114041 432691 391664 1538...

output:

3037

result:

ok single line: '3037'

Test #65:

score: 0
Accepted
time: 3ms
memory: 9780kb

input:

5000 50000 20000
352343 444456 129455 63036 415631 405431 466537 342473 73146 80102 43126 499679 319403 261245 76721 264983 277802 489576 304115 69911 110120 150286 255062 381910 131570 189777 297781 338087 9913 309686 341014 465524 274999 497931 33541 346751 185370 94873 111072 19201 261981 272024 ...

output:

4119

result:

ok single line: '4119'

Test #66:

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

input:

5000 50000 40000
424107 164537 282708 485149 321650 88866 456420 106651 173479 11164 462137 116954 108534 62019 100990 467976 460384 264636 96576 112352 216158 295581 194102 51250 133396 271379 103107 2084 22443 318896 263284 380149 58258 296446 415694 26971 99671 38788 288414 381636 56956 367303 38...

output:

5000

result:

ok single line: '5000'

Test #67:

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

input:

5000 20000 5000
337272 340625 335483 210758 476956 333570 416793 199881 5845 73765 473389 243290 301723 302633 26074 229792 209037 56226 401299 84169 81845 178781 424003 134426 97015 293790 173214 164014 318916 429958 249354 265021 177108 74317 149985 284078 18215 890 217276 408727 397326 32214 4062...

output:

3246

result:

ok single line: '3246'

Test #68:

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

input:

5000 20000 2000
497025 413399 30446 118074 287662 400170 18984 353428 162406 404751 286934 45796 165002 147839 498299 185485 345381 203754 384237 491910 293619 252900 295664 27345 249875 358149 392380 84692 254186 145878 37747 403856 252329 4461 339818 241060 495922 89663 104042 491639 370932 198396...

output:

2700

result:

ok single line: '2700'

Test #69:

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

input:

5000 20000 8000
350913 18858 428681 33 58527 394946 379187 74094 363699 498320 204842 269122 220990 102538 94665 146593 110642 116922 231251 368022 403325 164638 37274 282168 206042 393002 322920 406754 349854 410957 273427 394393 438977 444757 354065 78841 359761 188774 5684 288484 171108 139292 44...

output:

4015

result:

ok single line: '4015'

Test #70:

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

input:

5000 20000 1000
472866 246458 18382 128253 379646 373796 57109 142428 185206 58553 372520 420556 57622 328272 376432 208664 149367 315792 224306 473081 135069 67999 75729 452060 63628 4242 424037 310609 433198 472362 244932 289569 408950 12383 292460 321100 201019 387870 423502 104770 215566 471878 ...

output:

2548

result:

ok single line: '2548'

Test #71:

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

input:

5000 20000 5100
210281 76586 413032 355318 48105 264599 414001 285955 143233 76070 252998 233313 193397 409811 198437 123971 437408 384849 252813 203671 149156 174857 372939 125304 223737 359168 135243 125290 191729 336869 154749 172553 182685 185908 320897 103939 379486 185049 449638 218224 370998 ...

output:

3262

result:

ok single line: '3262'

Test #72:

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

input:

5000 5000 3000
345603 259347 457252 53819 21084 290117 58042 155808 35221 262298 255695 87320 86214 277750 314848 493910 29232 24620 141999 58599 209510 62132 428154 398665 218644 427584 427000 203865 345102 497781 152466 2818 496007 46813 193977 362476 474879 231614 47580 118808 406704 221935 26896...

output:

4892

result:

ok single line: '4892'

Test #73:

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

input:

5000 5000 1000
442643 427786 115434 461305 80383 40531 131588 39034 259498 99929 346614 119292 46660 71404 362622 185796 142817 372606 198483 93416 154946 20853 50041 101856 46020 211968 197158 204796 52899 247111 406425 493579 116301 288805 256154 385813 101025 121262 240152 114899 297232 460505 44...

output:

2819

result:

ok single line: '2819'

Test #74:

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

input:

5000 5000 2000
444150 20471 426640 390713 281513 447409 295072 309630 3298 458954 33506 421467 391406 445418 214648 53172 448182 440021 241876 246585 300405 80478 495572 223314 496209 169199 438585 251353 99328 396702 165649 258387 394363 156683 301578 57379 116742 349474 178727 283252 242478 490233...

output:

3666

result:

ok single line: '3666'

Test #75:

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

input:

5000 5000 500
432819 107379 142855 326489 17141 410725 47197 119046 73545 418690 372840 37295 109784 331667 396671 126782 368583 393593 241781 136834 32871 128213 267429 138256 341249 6057 185040 373492 491384 159018 285915 157535 477709 115894 296454 83515 483338 49049 482745 478473 443300 404174 4...

output:

2489

result:

ok single line: '2489'

Test #76:

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

input:

5000 5000 200
228321 30903 283036 106041 171768 177274 256174 480737 71764 263200 240066 290343 317293 401084 481077 427747 485905 32571 231779 473871 38150 171828 495391 269523 357796 340502 54610 109334 94982 179478 55928 220969 53695 398338 456601 230913 64534 492164 383683 219561 401637 155109 2...

output:

2302

result:

ok single line: '2302'

Test #77:

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

input:

5000 1000 50
48441 41704 477114 383744 499841 200066 317311 397327 84585 244935 236734 104344 325103 147395 427042 152228 57166 445283 256824 309977 151298 184234 105132 366367 312845 333831 480067 329547 454006 315229 236937 426775 364416 76740 397299 143610 293176 289967 83533 116807 328416 293617...

output:

1452

result:

ok single line: '1452'

Test #78:

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

input:

5000 1000 100
482472 335777 394636 283454 307167 452257 280035 385798 442563 455894 450220 222541 33203 15682 101338 329363 122000 320015 103025 238649 99755 3868 260466 365008 459268 120599 242967 297169 165232 476290 101278 398884 2113 348711 410570 121439 450875 373479 73800 339034 498149 319947 ...

output:

1858

result:

ok single line: '1858'

Test #79:

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

input:

5000 1000 200
403161 338757 448219 208597 208256 999 359255 409236 281589 77161 23148 352536 409588 483181 295996 40411 120785 399304 480327 148154 302588 325036 209995 77476 262801 435634 272109 30846 94551 314694 279256 179762 365249 467227 416219 390 219808 373606 374868 358642 224112 447977 3578...

output:

2268

result:

ok single line: '2268'

Test #80:

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

input:

5000 1000 500
261816 481505 355382 67053 228893 433167 485782 316650 464504 482876 345218 155387 12315 123151 485150 17621 10341 459867 297453 445821 207743 57013 36636 163101 102197 334304 4494 340400 398200 20661 330333 427105 205971 21397 29673 198985 314835 155789 454786 447706 454132 229138 383...

output:

3660

result:

ok single line: '3660'

Test #81:

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

input:

5000 300 10
294665 118144 421853 399204 312876 366838 84346 38809 458425 400342 195244 484831 92473 389916 50444 487526 362399 167434 133031 489104 110474 250797 404071 457015 68622 24931 420803 485018 113768 247958 137554 262237 192851 288069 258211 42237 243632 249875 353797 146837 236294 16097 28...

output:

493

result:

ok single line: '493'

Test #82:

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

input:

5000 300 50
194542 418742 398973 274394 436628 183193 207945 400346 484911 146893 45436 9628 52698 370228 403979 6744 124079 219366 328822 241580 390780 332044 235544 126899 82521 119188 464162 26966 261084 98904 74406 310686 255533 370429 42354 170684 189331 449235 190915 23777 492038 43699 396413 ...

output:

1512

result:

ok single line: '1512'

Test #83:

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

input:

5000 300 100
363815 437558 255450 19995 139399 35894 39263 320866 330490 250984 351308 102569 396072 112227 6061 292484 115138 324461 73776 156379 250128 413191 190071 145623 155189 308556 133671 395091 421214 240636 466101 202179 366353 324254 221564 2733 58305 467662 362735 156688 448709 261763 29...

output:

2230

result:

ok single line: '2230'

Test #84:

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

input:

5000 300 200
238606 165016 72841 286686 8386 118411 366292 16012 152503 161892 243400 39811 327668 97130 7927 60401 190901 342860 282248 496540 362061 219721 200445 61353 452878 415961 373290 190884 341138 427939 74135 366946 20555 220334 185912 185679 326135 71876 66070 23812 301898 45265 359219 63...

output:

3931

result:

ok single line: '3931'

Test #85:

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

input:

5000 30 10
280930 98742 431884 365998 439105 304477 102241 227771 28235 149835 464808 407100 317570 238691 121451 488661 71366 332291 426291 273277 24278 496952 15693 220181 102268 403763 16118 477669 415913 444854 7618 196232 148753 777 169279 77824 443475 20342 377976 317217 262849 187870 5504 309...

output:

1868

result:

ok single line: '1868'

Test #86:

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

input:

5000 30 5
160407 279646 331432 185106 355102 325428 293558 324852 216079 146997 12669 183500 162486 311554 260523 303460 368633 80102 121683 249175 2843 371363 241860 321049 400346 27200 488168 381436 499318 28035 366907 241325 30405 170616 165816 195159 422600 104562 345464 380497 254243 256812 317...

output:

1074

result:

ok single line: '1074'

Test #87:

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

input:

5000 30 11
361932 332532 215347 144818 184564 450781 294716 293728 181863 402085 75740 319651 386417 367496 225816 110532 427387 494469 285392 204094 233349 320938 327270 53990 423358 305799 476309 96648 454880 396901 119026 279486 367263 300551 64699 14716 326439 229019 98110 224362 62626 364860 77...

output:

1989

result:

ok single line: '1989'

Test #88:

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

input:

5000 30 20
348049 205305 256661 128117 33269 461586 69506 360251 493432 339745 39315 311878 126923 404212 256420 29430 237264 194990 395754 16212 273888 444814 65307 21980 272281 192918 454851 240200 132503 67876 54746 138727 465910 240792 369876 340085 116976 365607 472961 70647 254708 132168 26836...

output:

3466

result:

ok single line: '3466'

Test #89:

score: 0
Accepted
time: 5ms
memory: 5896kb

input:

5000 30 10
60861 203932 349891 343079 203932 203932 39455 305976 203932 203932 203932 78845 331948 203932 471742 203932 452213 41877 203932 36734 203932 203932 192246 203932 203932 483453 358204 203932 203932 203932 319708 203932 418251 203932 394612 203932 431550 151610 203932 203932 203932 203932 ...

output:

3237

result:

ok single line: '3237'

Test #90:

score: 0
Accepted
time: 5ms
memory: 5700kb

input:

5000 30 5
276513 276513 135364 390438 276513 103517 268491 276513 276513 276513 276513 450385 83539 276513 245047 276513 189465 142044 449426 276513 396789 276513 115220 276513 276513 431260 276513 10129 429227 276513 276513 276513 276513 276513 276513 63741 167820 51531 116415 311484 450662 350512 ...

output:

2854

result:

ok single line: '2854'

Test #91:

score: 0
Accepted
time: 6ms
memory: 5640kb

input:

5000 30 10
262922 405492 134120 51822 198135 340356 143122 53372 198135 23198 198135 121908 198135 283242 274443 198135 287836 193367 198135 9162 198135 98494 198135 359461 198135 86046 338206 176947 452115 230067 198135 494686 13216 274962 198135 469622 198135 198135 114441 207285 482186 88946 1981...

output:

3389

result:

ok single line: '3389'

Test #92:

score: 0
Accepted
time: 5ms
memory: 5656kb

input:

5000 30 20
106283 106283 106283 214001 474683 106283 143971 106283 106283 247912 106283 106283 106283 106283 106283 61749 372595 106283 162411 106283 157803 61420 106283 106283 336675 106283 106283 471371 98511 480833 460449 319128 106283 223224 106283 85710 437449 106283 106283 83382 141647 106283 ...

output:

4132

result:

ok single line: '4132'

Test #93:

score: 0
Accepted
time: 6ms
memory: 5936kb

input:

5000 30 23
308281 98366 250976 308281 424520 308281 24891 308281 308281 432053 214036 169052 308281 308281 308281 308281 451815 308281 481705 308281 308281 27241 308281 44376 309741 294985 308281 308281 47757 347741 308281 308281 308281 308281 310118 308281 181760 308281 7634 90863 472389 90075 3082...

output:

4451

result:

ok single line: '4451'

Test #94:

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

input:

5000 5 1
11845 14176 14242 12601 2182 3799 3769 11599 11467 14161 3595 1108 12823 2815 3193 5500 4867 4471 12673 5863 4156 940 7861 6319 316 2572 469 6862 13582 11839 13630 14767 5401 2542 13828 13267 3340 688 1168 1729 1804 11449 5557 3472 4279 14026 9226 14071 1003 1870 3424 1447 874 11995 10657 2...

output:

0

result:

ok single line: '0'

Test #95:

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

input:

5000 2 1
6268 10642 3004 13903 1456 12031 6952 6691 448 2938 14275 8656 7255 12361 5236 13975 5521 3634 2155 106 10918 9766 2548 12259 5239 1999 9220 2839 13516 9316 5125 487 4648 14800 3529 13228 2737 8878 1540 10309 274 1372 2269 3262 14608 14056 12454 13393 5779 12202 4339 13069 13492 1522 6409 1...

output:

0

result:

ok single line: '0'

Test #96:

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

input:

4998 5 1
1352 10627 10858 3312 121 2508 2858 6375 5329 810 4908 5349 8041 9816 1654 715 4111 2662 7061 5017 7422 3606 7926 2021 5552 1934 9823 7271 7134 5251 4408 9241 9339 9311 9721 11608 4117 7547 6168 9494 10834 8503 2039 7009 11125 11510 8972 6861 593 2206 9714 3200 2781 7128 10432 1184 9213 576...

output:

1666

result:

ok single line: '1666'

Test #97:

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

input:

5000 500000 1
1738 13663 13960 4258 157 3226 3676 8197 6853 1042 6310 6877 10339 12622 2128 919 5287 3424 9079 6451 9544 4636 10192 2599 7138 2488 12631 9349 9172 6751 5668 11881 12007 11971 12499 14926 5293 9703 7930 12208 13930 10933 2623 9013 14305 14800 11536 8821 763 2836 12490 4114 3577 9166 1...

output:

1

result:

ok single line: '1'

Test #98:

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

input:

3 2 1
1 2 3
3 4 5

output:

0

result:

ok single line: '0'

Test #99:

score: 0
Accepted
time: 15ms
memory: 5688kb

input:

5000 500000 499999
337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 337225 3...

output:

5000

result:

ok single line: '5000'

Subtask #4:

score: 0
Time Limit Exceeded

Test #100:

score: 0
Time Limit Exceeded

input:

500000 500000 10
200184 74991 71203 334998 316800 34483 120570 301054 331108 232072 189788 397143 490296 56807 361700 88818 42376 460305 371750 450351 338384 429789 426045 445029 152316 408919 188124 144966 457495 475025 225370 260510 383159 495247 54319 246245 240728 372033 439599 119720 449020 451...

output:


result:


Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%