#76

by asd

Submitted 4 years 9 months 1 day ago
Tue Feb 04 21:31:34 CST 2020
Judger: ZJS
Dataset Version: v0

12437 ms / 6920 KB
Final 95
Problem: lss2.game
Language: GNU C++ 11


#1

15ms / 6916KB / Accepted
Input
1814 473184 40081
410 526 1454 1459 2396 2493 2535 2602 2706 2830 2967 3191 3315 3479 3679 3805 4132 4420 4893 4945 5445 6352 7111 7503 7529 8014 8527 8575 8590 8672 9110 9325 9537 9861 10594 10814 11183 11560 11687 12156 12395 13277 13449 13542 13584 135<...>
Output
1363999
Answer
1363999
Checker Information
"1363999"

#2

0ms / 6916KB / Accepted
Input
1460 19075 26
16 21 25 31 38 40 50 69 107 111 133 138 160 168 175 192 200 204 208 216 220 230 232 240 265 271 288 331 337 344 349 352 374 418 449 454 457 475 499 539 573 599 601 604 606 611 624 643 685 691 702 703 714 726 737 741 751 755 769 790 814 846 8<...>
Output
34699
Answer
34699
Checker Information
"34699"

#3

15ms / 6916KB / Accepted
Input
1562 78589 91
94 132 287 330 426 463 494 516 592 615 686 733 781 852 973 1002 1074 1207 1265 1276 1286 1298 1300 1302 1327 1369 1419 1425 1485 1493 1595 1672 1690 1791 1858 1863 1919 1959 1991 1999 2051 2055 2060 2062 2103 2115 2154 2205 2213 2460 2487 26<...>
Output
138911
Answer
138911
Checker Information
"138911"

#4

31ms / 6920KB / Accepted
Input
1817 241812 876
456 694 854 860 1000 1132 1178 1306 1321 1326 1353 1409 1549 1583 1881 1888 2027 2047 2294 2315 2323 2418 2432 2454 2479 2628 2884 3081 3082 3118 3171 3246 3268 3574 3606 3626 3634 3714 3856 3857 4146 4335 4688 4723 4746 4880 4994 5017 513<...>
Output
545286
Answer
545286
Checker Information
"545286"

#5

31ms / 6916KB / Accepted
Input
1137 146140 5582
299 458 492 515 556 931 1328 1462 1550 1615 1659 1867 1868 2043 2236 2399 2624 2684 2697 2911 2935 2987 3056 3059 3117 3373 3395 3478 3545 3826 4222 4502 4617 4630 4930 4973 5001 5192 5333 5422 5788 5836 5996 6248 6295 6559 6564 7087 7100<...>
Output
398744
Answer
398744
Checker Information
"398744"

#6

30ms / 6916KB / Accepted
Input
1330 60466 525
29 84 91 100 159 167 230 253 272 347 418 424 443 499 513 541 585 621 648 726 799 816 889 900 984 994 1014 1082 1084 1088 1173 1311 1314 1358 1365 1399 1404 1461 1514 1553 1562 1581 1610 1615 1668 1698 1808 1857 1875 1950 1965 1971 1988 2052<...>
Output
136098
Answer
136098
Checker Information
"136098"

#7

15ms / 6916KB / Accepted
Input
1273 167567 7542
112 125 156 680 748 1000 1004 1037 1175 1274 1358 1416 1435 1524 1749 1798 2017 2293 2359 2419 2680 3618 3833 3858 3920 4268 4309 4336 4402 4482 4916 4945 5058 5309 5366 5489 5537 5539 5575 5841 5968 6153 6431 6450 6646 6657 6670 6719 688<...>
Output
465121
Answer
465121
Checker Information
"465121"

#8

0ms / 6916KB / Accepted
Input
1414 33298 810
8 42 73 106 168 170 174 178 188 200 236 240 317 318 324 333 340 365 371 372 374 392 401 409 436 468 533 553 564 578 598 603 620 635 636 649 658 671 677 697 702 706 717 721 828 846 853 880 897 906 920 947 965 1034 1068 1073 1098 1156 1158 11<...>
Output
87076
Answer
87076
Checker Information
"87076"

#9

15ms / 6920KB / Accepted
Input
1559 638710 522
1392 1700 2292 2950 3601 3762 4738 4933 5552 5735 6047 6811 7264 7321 7570 8011 8257 8548 8557 8623 9225 9376 9541 9854 9863 9894 9944 10177 10311 10976 11317 11757 12109 12349 12663 13244 13693 13795 14526 15333 15540 15747 16380 17306 17<...>
Output
1068556
Answer
1068556
Checker Information
"1068556"

#10

15ms / 6916KB / Accepted
Input
1284 133077 4560
37 163 296 313 332 351 438 727 842 909 1122 1297 1338 1354 1372 1397 1420 1455 1500 1640 1759 1817 1962 1964 2006 2027 2074 2084 2108 2164 2283 2363 2399 2524 2553 2641 2721 2877 3006 3122 3251 3273 3533 3742 3935 4093 4164 4170 4245 4699<...>
Output
354265
Answer
354265
Checker Information
"354265"

#11

31ms / 6916KB / Accepted
Input
1882 35648 87
3 6 38 43 44 78 106 114 123 128 139 162 191 197 241 246 273 278 297 302 312 333 341 357 376 378 386 387 408 474 508 539 582 590 592 597 599 620 634 636 638 651 652 655 657 667 674 681 684 686 708 729 779 785 791 809 847 856 857 858 887 893 9<...>
Output
72063
Answer
72063
Checker Information
"72063"

#12

30ms / 6916KB / Accepted
Input
1276 59604 4
10 16 41 92 101 102 177 212 269 329 377 400 410 538 560 576 604 609 618 724 788 817 857 879 899 1028 1104 1145 1157 1165 1170 1201 1237 1388 1496 1521 1524 1541 1584 1633 1799 1801 1811 1882 1897 1999 2000 2001 2054 2057 2084 2183 2202 2277 2<...>
Output
64404
Answer
64404
Checker Information
"64404"

#13

31ms / 6916KB / Accepted
Input
1088 56497 1102
35 107 125 324 368 381 393 432 523 579 682 870 880 882 945 948 998 1040 1072 1124 1148 1150 1159 1225 1252 1253 1282 1350 1380 1407 1441 1472 1505 1595 1619 1716 1783 1796 1853 1993 2018 2027 2143 2166 2237 2260 2261 2264 2297 2299 2307 23<...>
Output
141603
Answer
141603
Checker Information
"141603"

#14

31ms / 6916KB / Accepted
Input
1980 59669 94
15 20 65 66 78 136 147 237 241 265 391 433 442 460 464 487 553 562 575 589 594 638 665 667 695 711 780 855 861 874 938 960 976 991 1019 1039 1053 1071 1077 1082 1091 1144 1152 1188 1239 1260 1275 1297 1331 1355 1389 1446 1457 1550 1568 1570 <...>
Output
113495
Answer
113495
Checker Information
"113495"

#15

30ms / 6920KB / Accepted
Input
1122 330385 4
34 407 695 1615 1675 1788 1876 1886 2443 2467 2492 2521 3441 3638 3741 4007 4189 4467 4554 4748 5078 5263 5349 5988 6117 6279 6432 6485 7151 7408 7441 7622 7874 8799 8991 9386 9454 9887 10115 10362 10606 10715 10896 11250 11431 11816 11961 1<...>
Output
334847
Answer
334847
Checker Information
"334847"

#16

15ms / 6920KB / Accepted
Input
1128 35713 1
19 27 28 87 102 151 170 183 199 234 268 278 289 295 389 396 424 433 471 545 546 551 594 653 659 714 740 753 759 797 801 812 815 830 843 847 897 940 1081 1118 1126 1247 1254 1282 1342 1358 1380 1392 1420 1444 1569 1603 1614 1652 1699 1713 1717<...>
Output
36841
Answer
36841
Checker Information
"36841"

#17

31ms / 6912KB / Accepted
Input
1187 82468 70
35 78 100 177 205 290 342 354 403 516 706 730 761 768 798 814 853 858 1033 1037 1090 1120 1220 1321 1387 1400 1603 1627 1695 1910 1962 1978 1990 2022 2058 2126 2173 2235 2242 2307 2373 2390 2497 2539 2661 2674 2764 2784 2844 3081 3154 3184 3<...>
Output
129370
Answer
129370
Checker Information
"129370"

#18

15ms / 6920KB / Accepted
Input
1473 443701 1952
311 381 390 778 1890 2314 3272 4142 4173 4335 4371 4389 4553 4642 4675 4854 5265 5350 5485 5816 7250 7331 7672 7834 8193 8349 8486 8860 9354 9432 9473 9529 10157 10285 10394 10919 11024 11427 11494 11626 12013 12020 12376 12393 12740 1274<...>
Output
1000863
Answer
1000863
Checker Information
"1000863"

#19

30ms / 6916KB / Accepted
Input
1038 11780 1
3 8 9 11 14 16 19 22 29 30 35 42 55 56 76 79 87 90 92 106 108 109 118 121 129 133 140 142 144 145 148 153 160 173 174 177 178 179 182 183 187 198 207 209 210 216 217 221 228 237 250 257 264 265 266 269 271 274 286 289 292 295 302 303 304 306 <...>
Output
12818
Answer
12818
Checker Information
"12818"

#20

15ms / 6912KB / Accepted
Input
1566 56804 1
2 32 87 151 152 157 166 212 227 228 241 247 249 298 369 383 437 443 459 462 481 651 653 691 696 728 756 775 794 810 864 902 904 922 949 966 1024 1027 1069 1075 1130 1178 1190 1232 1246 1317 1328 1368 1375 1405 1432 1461 1465 1493 1550 1554 15<...>
Output
58370
Answer
58370
Checker Information
"58370"

#1

12437ms / 6916KB / Time Limit Exceeded
Input
100000 1000000000 1
1 24 25 49 79 108 139 147 220 221 249 264 302 316 320 363 389 391 395 409 410 432 439 455 486 489 491 501 515 516 524 529 547 550 568 603 626 633 637 648 650 668 670 675 735 751 765 768 773 779 795 836 872 894 898 925 930 947 962 1000 <...>
Output

												
Answer

												
Checker Information

											
#include <bits/stdc++.h>

#define ln                '\n'
#define all(dat)           dat.begin(), dat.end()
#define loop(i, to)        for (int i = 0; i < to; ++i)
#define cont(i, to)        for (int i = 1; i <= to; ++i)
#define circ(i, fm, to)    for (int i = fm; i <= to; ++i)
#define foreach(i, dat)    for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)

typedef long long          num;

using namespace std;

const int nsz = 1e5;
const num inf = 0x3f3f3f3f3f3f3f3f;
int n, m, t, a[nsz + 5];
num dp[nsz + 5], ans;

void inline upd(num &a, num b) {
	a > b && (a = b);
}

int main() {
	ios::sync_with_stdio(0);
	cin >> n >> m >> t;
	cont (i, n) {
		cin >> a[i];
	}
	memset(dp, inf, sizeof(dp));
	dp[0] = 0;
	cont (i, n) {
		loop (j, i) {
			upd(dp[i], dp[j] + a[i] - a[j] + a[i] - a[j + 1] + max(0, t - (a[i] - a[j] + a[i] - a[j + 1] - a[j + 1] + a[j])) + a[i] - a[j + 1]);
		}
	}
	ans = dp[n] + m - a[n];
	cout << ans << ln;
}
Main.cpp: In function ‘int main()’:
Main.cpp:29:28: warning: overflow in implicit constant conversion [-Woverflow]
  memset(dp, inf, sizeof(dp));
                            ^