QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#591374#4270. Double Attendancechenxinyang2006#5 6ms3996kbC++202.2kb2024-09-26 15:36:392024-09-26 15:36:40

Judging History

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

  • [2024-09-26 15:36:40]
  • 评测
  • 测评结果:5
  • 用时:6ms
  • 内存:3996kb
  • [2024-09-26 15:36:39]
  • 提交

answer

#include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(j);i<=(k);i++)
#define per(i,j,k) for(int i=(j);i>=(k);i--)
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define db double
#define ldb long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define eb emplace_back
#define SZ(S) (int)S.size()
//#define mod 998244353
//#define mod 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3f
using namespace std;

template <class T>
void chkmax(T &x,T y){
	if(x < y) x = y;
}

template <class T>
void chkmin(T &x,T y){
	if(x > y) x = y;
}

inline int popcnt(int x){
	return __builtin_popcount(x);
}

inline int ctz(int x){
	return __builtin_ctz(x);
}


/*ll power(ll p,int k = mod - 2){
	ll ans = 1;
	while(k){
		if(k % 2 == 1) ans = ans * p % mod;
		p = p * p % mod;
		k /= 2;	
	}
	return ans;
}*/
int n,m,K,V;
int a[2][2005];

int trans(int x,int y){
	if(x == y) return 0;
	return (x > 0);
}

int getnxt(int p,int s,int sp){
	while(s <= V){
		if(a[p][s] != a[p][s + 1] && (!sp || a[p][s + 1])) return s + 1;
		s++;
	}
	return V + 1;
}

int dp[2005][2][2];
void trans(int i){
	rep(p,0,1){
		per(q,1,0){
			if(dp[i][p][q] > V) continue;
			int s = dp[i][p][q];
			if(s + K <= V) chkmin(dp[i + trans(a[p ^ 1][s + K],q * a[p ^ 1][s])][p ^ 1][a[p][s] == a[p][s + K]],s + K);

			int t0 = getnxt(p ^ 1,s,0),t1 = getnxt(p,s,1);
			chkmin(dp[i][p][0],t0);
			chkmin(dp[i + 1][p][q],t1);
			if(t0 == t1) chkmin(dp[i + 1][p][0],t0);
		}
	}	
}

int main(){	
//	freopen("test.in","r",stdin);
//	freopen("test.out","w",stdout);
	scanf("%d%d%d",&n,&m,&K);
	rep(i,1,n){
		int l,r;
		scanf("%d%d",&l,&r);
		rep(k,l,r - 1) a[0][k] = i;
		chkmax(V,r - 1);
	}
	rep(i,1,m){
		int l,r;
		scanf("%d%d",&l,&r);
		rep(k,l,r - 1) a[1][k] = i;
		chkmax(V,r - 1);
	}
	memset(dp,0x3f,sizeof(dp));
	dp[(a[0][0] > 0)][0][0] = 0;
	rep(i,0,n + m){
		trans(i);
		trans(i);
/*		printf("i=%d\n",i);
		rep(p,0,1){
			rep(q,0,1) printf("(%d,%d) %d\n",p,q,dp[i][p][q]);
		}*/
	}
	int answer = 0;
	rep(i,0,n + m){
		rep(p,0,1){
			rep(q,0,1) if(dp[i][p][q] <= V) chkmax(answer,i);
		}
	}
	printf("%d\n",answer);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

3 1 8
10 20
100 101
20 21
15 25

output:

3

result:

ok single line: '3'

Test #2:

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

input:

1 5 3
1 100
1 2
2 3
3 4
4 5
5 6

output:

4

result:

ok single line: '4'

Test #3:

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

input:

10 10 5
4 9
43 48
69 70
70 72
52 67
75 83
100 103
103 1501
10 27
28 40
5 7
27 29
30 39
40 42
42 45
67 80
0 5
45 59
10 20
22 23

output:

18

result:

ok single line: '18'

Test #4:

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

input:

1 1 1
0 1
0 1

output:

1

result:

ok single line: '1'

Test #5:

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

input:

1 10 2
1 2000
4 5
10 11
7 8
3 4
9 10
1 2
2 3
8 9
6 7
5 6

output:

10

result:

ok single line: '10'

Test #6:

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

input:

10 10 90
1440 1620
0 180
1080 1260
900 1080
180 360
720 900
540 720
360 540
1620 1800
1260 1440
1170 1350
990 1170
1530 1710
1350 1530
90 270
450 630
270 450
630 810
810 990
1710 1890

output:

20

result:

ok single line: '20'

Test #7:

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

input:

10 10 90
1080 1260
1440 1620
900 1080
1620 1800
180 360
360 540
540 720
1800 1980
1260 1440
720 900
90 270
1710 1890
810 990
1170 1350
1530 1710
630 810
1350 1530
990 1170
450 630
270 450

output:

20

result:

ok single line: '20'

Test #8:

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

input:

10 10 166
1 2
664 996
332 664
1660 1992
0 1
1328 1660
996 1328
3 4
2 3
4 5
333 334
1494 1826
498 830
1162 1494
334 335
336 337
0 332
830 1162
335 336
332 333

output:

20

result:

ok single line: '20'

Test #9:

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

input:

10 10 166
2 3
0 1
3 4
1328 1660
1999 2000
996 1328
1 2
332 664
4 5
664 996
334 335
335 336
333 334
1162 1494
0 332
498 830
336 337
830 1162
332 333
1999 2000

output:

19

result:

ok single line: '19'

Test #10:

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

input:

10 10 1
1607 1721
327 413
222 264
1744 1746
35 50
619 766
995 1127
1421 1541
1236 1294
984 995
626 1122
1313 1386
65 141
1394 1428
1553 1764
1766 1990
1551 1552
465 531
1500 1531
623 625

output:

20

result:

ok single line: '20'

Test #11:

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

input:

10 10 1000000000
664 1247
157 183
1975 1986
1289 1374
1448 1461
233 326
1888 1913
183 194
1927 1933
1499 1672
1138 1387
402 652
266 396
1439 1452
1954 1956
684 737
1700 1887
1576 1678
1473 1485
886 1004

output:

10

result:

ok single line: '10'

Test #12:

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

input:

10 10 3
786 792
1395 1579
1348 1371
303 371
430 431
1331 1343
813 1050
1833 1853
654 706
622 634
237 302
1261 1266
49 216
1514 1524
1524 1607
1004 1018
748 918
1020 1141
1967 1994
1710 1735

output:

20

result:

ok single line: '20'

Test #13:

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

input:

10 10 4
82 206
370 769
1086 1131
267 330
836 984
995 1052
778 805
1880 1956
1956 1999
1531 1761
1687 1730
1879 1968
694 710
441 674
738 1302
1734 1737
1357 1365
1372 1604
1606 1672
722 726

output:

20

result:

ok single line: '20'

Test #14:

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

input:

10 10 9
1667 1724
266 375
1736 1936
1312 1659
858 886
442 708
193 198
1127 1244
383 428
935 1021
614 628
1797 1832
199 218
229 268
386 404
413 587
962 1248
814 878
1462 1732
1420 1424

output:

20

result:

ok single line: '20'

Test #15:

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

input:

10 10 16
14 88
1638 1644
645 970
1218 1232
1401 1589
1972 1994
1657 1721
1145 1188
1243 1246
179 244
1925 1958
355 433
706 832
564 587
12 270
1541 1728
1499 1529
294 348
1160 1205
1004 1032

output:

20

result:

ok single line: '20'

Test #16:

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

input:

10 10 64
998 1233
1868 1888
1898 1943
1811 1818
243 292
185 202
205 211
342 454
1269 1313
970 973
770 1192
1424 1435
710 715
60 74
77 250
1992 1998
715 758
1393 1397
1523 1695
359 439

output:

20

result:

ok single line: '20'

Test #17:

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

input:

10 10 31
1755 1831
1513 1514
559 565
1557 1727
1891 1997
56 159
527 544
1745 1749
572 1106
483 504
1789 1824
1306 1439
1680 1789
1490 1528
1089 1144
832 1010
18 306
813 820
598 757
1184 1229

output:

19

result:

ok single line: '19'

Test #18:

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

input:

10 10 995
1139 1304
1108 1135
1682 1771
1897 1913
244 404
1359 1362
1385 1608
420 496
787 1053
562 769
506 514
164 315
324 338
699 1240
1936 1957
634 695
385 454
20 107
525 621
1920 1931

output:

10

result:

ok single line: '10'

Test #19:

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

input:

10 10 1256
1757 1979
898 939
486 649
1074 1085
1346 1584
1201 1345
1013 1034
1070 1071
1109 1198
56 398
587 588
589 615
49 65
338 467
1201 1252
559 578
635 689
706 743
1495 1831
995 1043

output:

10

result:

ok single line: '10'

Test #20:

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

input:

10 10 1554
951 962
1902 1934
1220 1367
1499 1621
386 387
993 1127
536 813
1862 1893
526 532
401 431
1048 1050
986 990
609 645
793 957
1945 1989
521 548
1057 1063
1137 1823
1004 1017
229 459

output:

10

result:

ok single line: '10'

Test #21:

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

input:

10 10 324854
1281 1570
126 135
1900 1963
1578 1583
1593 1693
17 98
1079 1246
1832 1850
187 449
569 739
1960 1970
1262 1402
1704 1707
940 1104
1628 1676
1716 1727
1808 1869
1877 1892
1560 1565
145 337

output:

10

result:

ok single line: '10'

Test #22:

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

input:

10 10 73118142
223 258
514 576
1173 1204
712 1162
653 656
342 458
1633 1831
1891 1923
1288 1609
133 206
118 138
1440 1494
1332 1432
152 509
65 109
712 748
1532 1578
611 669
1946 1957
513 519

output:

10

result:

ok single line: '10'

Test #23:

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

input:

1 1 217
366 1554
481 937

output:

2

result:

ok single line: '2'

Test #24:

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

input:

1 1 223
1577 1888
243 879

output:

2

result:

ok single line: '2'

Test #25:

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

input:

1 1 95
1009 1709
1182 1759

output:

2

result:

ok single line: '2'

Test #26:

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

input:

1 1 39
1210 1758
864 1497

output:

2

result:

ok single line: '2'

Test #27:

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

input:

1 1 197
426 1381
926 1911

output:

2

result:

ok single line: '2'

Test #28:

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

input:

2 2 259
1047 1333
1560 1784
1587 1963
31 532

output:

4

result:

ok single line: '4'

Test #29:

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

input:

2 2 263
942 1287
1472 1620
610 783
1123 1183

output:

3

result:

ok single line: '3'

Test #30:

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

input:

2 2 12
709 1247
1344 1924
1973 1993
256 811

output:

4

result:

ok single line: '4'

Test #31:

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

input:

2 2 289
1936 1962
111 426
699 717
757 1534

output:

4

result:

ok single line: '4'

Test #32:

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

input:

10 2 13
728 734
1682 1716
1962 1964
917 918
1028 1220
455 459
1514 1537
505 588
1968 1986
1336 1441
1838 1842
904 1063

output:

12

result:

ok single line: '12'

Test #33:

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

input:

10 2 147
1684 1853
1562 1611
1217 1246
519 586
1104 1130
121 267
1461 1528
1555 1558
467 512
457 467
1764 1803
891 1103

output:

11

result:

ok single line: '11'

Test #34:

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

input:

2 10 105
1429 1992
1994 2000
312 356
1285 1307
247 283
822 827
1327 1908
205 214
456 697
784 803
975 1181
840 852

output:

12

result:

ok single line: '12'

Test #35:

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

input:

2 10 88
127 248
381 439
1812 1870
1900 1988
1332 1339
299 300
1512 1811
796 859
298 299
22 86
395 793
1041 1062

output:

11

result:

ok single line: '11'

Test #36:

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

input:

10 1 13
1186 1197
1551 1683
1725 1751
720 855
1027 1118
225 232
224 225
1849 1978
300 672
896 1017
1416 1650

output:

11

result:

ok single line: '11'

Test #37:

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

input:

10 1 147
1759 1772
973 978
1561 1632
458 773
1198 1266
139 153
987 1132
1820 1997
1157 1167
1536 1558
1875 1894

output:

10

result:

ok single line: '10'

Test #38:

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

input:

1 10 105
1601 1738
938 1059
70 108
152 194
1367 1389
1897 1912
1464 1668
1782 1847
243 338
785 845
197 209

output:

11

result:

ok single line: '11'

Test #39:

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

input:

1 10 88
1831 1885
225 342
208 210
1537 1790
1289 1290
160 197
652 661
689 776
1171 1252
1291 1459
813 870

output:

11

result:

ok single line: '11'

Test #40:

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

input:

10 10 43
1112 1136
1173 1242
196 313
1561 1603
1341 1448
428 756
1951 1989
1299 1310
1731 1919
1267 1279
1649 1682
1990 1992
295 380
883 898
15 46
1744 1784
1233 1426
1569 1603
150 173
560 723

output:

18

result:

ok single line: '18'

Test #41:

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

input:

10 10 131
1297 1299
791 825
882 968
972 1251
1293 1294
1497 1605
185 740
1460 1473
1329 1448
1861 1904
1422 1439
995 1088
1289 1321
1678 1915
372 585
760 761
1145 1170
1244 1281
16 277
765 979

output:

15

result:

ok single line: '15'

Test #42:

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

input:

10 10 286
1146 1277
224 231
302 921
1586 1708
193 201
1979 1989
999 1034
1086 1123
231 235
1058 1071
350 635
668 701
1589 1976
892 1282
1502 1568
9 22
221 295
788 867
29 89
1401 1446

output:

14

result:

ok single line: '14'

Test #43:

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

input:

10 10 99
71 108
448 470
1286 1348
1732 1966
1225 1233
1161 1174
1680 1725
480 937
109 152
223 335
1456 1465
1276 1299
1252 1254
1488 1879
101 118
159 203
1407 1437
1330 1353
898 1075
427 725

output:

15

result:

ok single line: '15'

Test #44:

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

input:

10 10 293
1260 1747
1170 1226
817 891
1763 1960
411 415
476 497
423 434
904 1096
551 716
156 323
615 630
1596 1764
133 185
384 603
1269 1371
976 1155
1156 1166
44 93
188 332
715 804

output:

11

result:

ok single line: '11'

Test #45:

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

input:

10 9 219
22 32
270 284
1291 1365
442 617
1198 1274
1624 1840
1172 1174
363 389
43 79
793 906
621 630
1788 1922
50 63
190 219
634 840
271 289
1784 1785
1111 1130
1351 1729

output:

13

result:

ok single line: '13'

Test #46:

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

input:

8 9 292
1623 1648
291 870
264 289
953 1208
1401 1587
1732 1903
1728 1732
924 938
361 475
624 825
1202 1219
1042 1119
960 1027
286 293
1252 1296
1305 1397
1769 1999

output:

11

result:

ok single line: '11'

Test #47:

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

input:

10 7 230
139 205
1593 1726
536 540
263 449
219 246
1754 1758
830 1046
1864 1873
1222 1225
1269 1421
570 649
806 818
1034 1512
443 562
820 972
1608 1901
741 775

output:

13

result:

ok single line: '13'

Test #48:

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

input:

3 5 150
501 541
1442 1596
762 992
1351 1491
1564 1635
316 361
648 1016
1180 1351

output:

7

result:

ok single line: '7'

Test #49:

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

input:

6 10 150
1710 1753
572 768
1630 1634
1638 1648
1480 1577
817 1271
7 46
687 793
87 161
1845 1973
1346 1395
1711 1810
884 1050
285 584
1458 1621
1056 1207

output:

13

result:

ok single line: '13'

Subtask #2:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #50:

score: 10
Accepted
time: 0ms
memory: 3984kb

input:

196 2 2
903 907
1092 1095
1044 1045
1965 1973
475 483
1291 1292
1909 1913
1210 1241
195 203
1143 1144
17 25
1808 1811
1832 1834
96 104
1895 1899
1462 1473
1169 1171
280 281
860 863
174 182
756 757
1090 1092
747 752
298 299
1654 1659
850 857
59 66
320 342
909 910
130 131
1630 1632
489 490
1823 1826
1...

output:

198

result:

ok single line: '198'

Test #51:

score: 10
Accepted
time: 1ms
memory: 3876kb

input:

113 2 10
1225 1232
489 496
863 869
1316 1323
130 138
1723 1733
1792 1796
1603 1627
126 130
1601 1603
1856 1870
1561 1583
870 915
802 806
1667 1677
1167 1191
1778 1779
592 593
1840 1844
1513 1519
1542 1547
757 766
1839 1840
1677 1684
1927 1934
76 77
995 1026
1139 1140
1705 1716
635 675
1488 1493
1590...

output:

115

result:

ok single line: '115'

Test #52:

score: 10
Accepted
time: 1ms
memory: 3872kb

input:

2 180 8
1138 1978
747 987
1731 1732
1009 1010
790 809
827 828
1714 1715
375 377
166 167
57 61
700 707
634 641
1410 1415
1103 1108
963 965
395 408
594 600
64 78
1496 1505
1205 1232
1822 1828
1510 1512
53 57
996 997
1710 1714
698 699
784 786
559 560
366 375
1645 1655
517 550
113 118
1771 1778
988 991
...

output:

180

result:

ok single line: '180'

Test #53:

score: 10
Accepted
time: 1ms
memory: 3936kb

input:

2 165 7
424 885
1285 1699
1124 1125
496 497
663 671
752 756
1282 1295
569 570
732 737
346 352
1809 1810
965 975
1719 1721
407 409
912 916
100 104
333 334
357 358
1515 1530
1017 1031
1844 1849
1371 1376
413 420
1309 1321
1162 1167
1580 1583
1726 1735
1799 1803
1742 1745
317 322
309 311
253 257
157 15...

output:

167

result:

ok single line: '167'

Test #54:

score: 10
Accepted
time: 0ms
memory: 3860kb

input:

1 1 1
0 1
0 1

output:

1

result:

ok single line: '1'

Test #55:

score: 10
Accepted
time: 6ms
memory: 3952kb

input:

1 1997 2
1 2000
146 147
1863 1864
157 158
1465 1466
677 678
980 981
1692 1693
1480 1481
1270 1271
406 407
1771 1772
1686 1687
1540 1541
1879 1880
217 218
1211 1212
1002 1003
1025 1026
779 780
1963 1964
1175 1176
876 877
519 520
1791 1792
569 570
1835 1836
50 51
1393 1394
1671 1672
656 657
929 930
10...

output:

1997

result:

ok single line: '1997'

Test #56:

score: 10
Accepted
time: 0ms
memory: 3996kb

input:

999 999 1
1120 1122
988 990
1612 1614
1650 1652
1954 1956
698 700
1794 1796
420 422
406 408
1314 1316
246 248
1202 1204
22 24
766 768
1036 1038
1258 1260
1684 1686
6 8
1118 1120
1520 1522
286 288
224 226
1644 1646
144 146
594 596
1914 1916
318 320
888 890
444 446
1344 1346
1368 1370
1740 1742
708 71...

output:

1998

result:

ok single line: '1998'

Test #57:

score: 10
Accepted
time: 0ms
memory: 3988kb

input:

999 999 1
1504 1506
1374 1376
1164 1166
1306 1308
1012 1014
92 94
378 380
1240 1242
1126 1128
210 212
758 760
1626 1628
800 802
1734 1736
478 480
198 200
1256 1258
1756 1758
1678 1680
390 392
838 840
1316 1318
1100 1102
392 394
1850 1852
278 280
1296 1298
618 620
176 178
914 916
1856 1858
1450 1452
...

output:

1998

result:

ok single line: '1998'

Test #58:

score: 10
Accepted
time: 0ms
memory: 3996kb

input:

10 10 166
1660 1992
4 5
996 1328
1 2
332 664
1328 1660
2 3
0 1
664 996
3 4
334 335
1494 1826
498 830
0 332
335 336
336 337
830 1162
332 333
333 334
1162 1494

output:

20

result:

ok single line: '20'

Test #59:

score: 10
Accepted
time: 0ms
memory: 3916kb

input:

10 10 166
0 1
4 5
1328 1660
3 4
664 996
332 664
996 1328
2 3
1 2
1999 2000
830 1162
1999 2000
332 333
498 830
334 335
0 332
335 336
336 337
333 334
1162 1494

output:

19

result:

ok single line: '19'

Test #60:

score: 10
Accepted
time: 0ms
memory: 3988kb

input:

100 100 10
4 5
320 340
780 800
1340 1360
40 60
200 220
920 940
0 1
680 700
2 3
1500 1520
1040 1060
500 520
620 640
1300 1320
980 1000
140 160
1240 1260
580 600
1440 1460
60 80
180 200
520 540
7 8
1780 1800
460 480
8 9
760 780
1820 1840
1260 1280
1460 1480
1060 1080
1100 1120
1080 1100
1380 1400
3 4
...

output:

200

result:

ok single line: '200'

Test #61:

score: 10
Accepted
time: 0ms
memory: 3984kb

input:

100 100 10
840 860
20 40
320 340
1800 1820
1340 1360
240 260
300 320
7 8
220 240
140 160
400 420
1560 1580
1580 1600
200 220
1020 1040
720 740
1300 1320
260 280
340 360
1680 1700
1200 1220
120 140
1520 1540
980 1000
660 680
1140 1160
440 460
100 120
500 520
1280 1300
600 620
180 200
760 780
2 3
280 ...

output:

199

result:

ok single line: '199'

Test #62:

score: 0
Wrong Answer
time: 1ms
memory: 3940kb

input:

1500 1500 1
1412 1413
767 768
1122 1123
1487 1488
988 989
782 783
1147 1148
298 299
343 344
433 434
1246 1247
1968 1969
1439 1441
1642 1644
799 800
1826 1827
1422 1423
873 875
903 904
1615 1616
744 745
70 71
1537 1539
1211 1212
538 539
983 984
1252 1253
865 866
1977 1978
1753 1754
803 804
998 999
55...

output:

3000

result:

wrong answer 1st lines differ - expected: '1947', found: '3000'

Subtask #3:

score: 0
Runtime Error

Test #104:

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

input:

1 1 1
0 1
0 1

output:

1

result:

ok single line: '1'

Test #105:

score: 0
Runtime Error

input:

1 2000 2
999999996 1000000000
336 337
502 503
1906 1907
963 964
1351 1352
1795 1796
1510 1511
304 305
1930 1931
1735 1736
1469 1470
338 339
813 814
182 183
209 210
321 322
849 850
721 722
394 395
889 890
1758 1759
1440 1441
560 561
1470 1471
1916 1917
793 794
1366 1367
158 159
1602 1603
214 215
1119...

output:


result:


Subtask #4:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%