#5

by asd

Submitted 4 years 3 months 1 day ago
Sat Jan 11 17:26:23 CST 2020
Judger: YourFa
Dataset Version: v0

0 ms / 0 KB
Final 0
Problem: testProblemSet.realOI
Language: GNU C++ 11


#1

0ms / 0KB / Restrict Function
Input
4 2
2 1 1 83449 5910
2 3 1 48086 35394
Output

												
Answer

												
Checker Information
Illegal Call Id:8

#2

0ms / 0KB / Restrict Function
Input
18 10
17 9 1 321 221
10 15 1 40 563
9 12 2 595 165
7 6 1 599 874
5 3 1 876 55
1 4 1 344 895
10 2 2 301 253
16 4 1 686 607
3 8 1 290 897
5 14 1 552 366
Output

												
Answer

												
Checker Information
Illegal Call Id:8

#3

0ms / 0KB / Restrict Function
Input
53 30
42 10 1 809 215
4 1 1 813 20
24 34 1 812 141
3 48 1 350 474
38 35 1 577 367
31 5 2 307 386
40 45 1 443 105
10 12 2 582 40
46 49 2 112 659
39 38 1 308 296
7 11 1 341 618
17 34 2 18 4
16 23 2 872 404
37 7 2 256 896
17 4 1 860 406
47 6 2 76 374
39 2 2 589 353
2 53 2 561 890
37 2 1 683 214
47 34 2 868 325
9 29 1 562 928
34 3 1 120 156
1 16 2 698 311
25 12 2 939 162
18 38 2 292 194
27 32 1 212 965
27 7 2 889 317
52 20 2 74 438
36 22 2 232 468
36 33 1 359 523
Output

												
Answer

												
Checker Information
Illegal Call Id:8

#4

0ms / 0KB / Restrict Function
Input
175 100
62 14 2 964 843
26 18 2 8 792
22 8 1 118 970
106 116 2 559 703
107 145 1 293 169
88 27 2 477 616
40 44 2 568 764
145 92 2 805 269
8 135 1 836 650
144 152 1 622 751
86 29 2 193 839
23 150 1 448 957
14 82 1 911 92
151 168 2 97 929
143 158 1 160 748
127 71 2 822 16
173 175 1 490 931
169 82 1 676 991
12 87 1 913 124
138 74 2 703 451
64 171 1 806 828
164 126 2 69 45
11 148 1 129 203
166 67 1 490 552
143 161 1 711 395
42 110 2 672 815
101 104 2 68 756
168 155 2 69 818
78 171 1 81 737
130 172 2 94 830
122 26 2 931 679
4 76 2 269 170
167 8 2 331 545
4 1 1 345 837
55 96 1 419 483
54 11 2 356 539
84 147 1 815 965
30 98 2 911 530
40 167 1 973 915
86 20 1 928 330
56 142 1 802 907
149 105 2 508 205
85 76 1 414 611
119 47 1 222 703
79 105 1 463 894
6 164 2 350 120
131 43 1 793 981
136 40 1 792 633
20 169 2 395 985
57 32 2 687 27
96 121 1 686 611
99 64 2 89 7
98 37 1 450 387
21 149 2 162 207
80 9 2 966 822
5 113 1 77 870
106 52 2 808 215
31 65 2 316 275
168 <...>
Output

												
Answer

												
Checker Information
Illegal Call Id:8

#5

0ms / 0KB / Restrict Function
Input
525 300
471 177 2 634 403
498 446 2 278 412
356 380 1 910 134
8 413 2 566 220
505 346 1 427 836
326 512 1 482 665
101 2 1 372 96
251 147 1 830 33
363 137 1 985 945
360 350 2 435 664
329 161 2 369 499
278 163 2 398 972
137 82 2 444 285
177 193 2 499 418
517 62 1 11 932
153 145 1 120 121
484 143 2 825 326
300 227 2 109 746
423 352 1 808 744
11 243 2 117 338
371 368 2 379 256
459 471 1 412 867
54 50 1 760 218
313 341 1 574 233
115 173 1 813 475
203 215 1 567 642
496 140 1 436 335
158 216 2 559 258
174 200 2 233 578
362 8 2 470 648
376 266 1 645 812
323 491 1 30 510
330 426 2 634 99
103 113 2 701 659
440 485 1 641 21
70 511 2 701 116
181 517 2 734 802
206 409 1 376 295
165 497 1 406 160
454 298 2 847 6
503 284 1 400 937
240 19 2 997 107
132 161 2 703 596
185 395 1 956 884
377 167 2 511 942
369 497 2 333 507
86 370 2 523 626
161 41 2 15 515
284 484 2 953 188
157 428 1 594 733
85 184 1 249 544
202 482 2 303 266
111 287 1 4 100
476 85 1 878 961
261 394 2 166 108<...>
Output

												
Answer

												
Checker Information
Illegal Call Id:8

#6

0ms / 0KB / Restrict Function
Input
1750 1000
696 659 1 32 665
1061 969 1 590 751
835 293 1 40 20
383 34 1 338 388
1712 947 2 100 704
1223 649 1 154 911
1199 78 1 921 780
762 1571 1 910 751
949 1184 2 653 590
1501 955 2 364 864
1618 843 1 250 298
883 343 2 424 46
1604 1371 2 48 377
1310 1578 2 247 774
1248 208 1 70 876
1640 785 1 529 780
1202 1425 1 715 814
1667 1112 1 608 966
1696 521 2 505 351
224 604 1 160 98
1532 943 2 66 435
1508 721 2 217 602
1234 1196 1 385 484
1131 899 1 475 551
1368 1674 2 866 663
1466 649 1 524 135
694 241 1 399 471
731 1495 2 158 177
707 1266 1 183 229
720 392 2 489 907
319 299 1 920 35
1573 964 1 860 362
1200 388 2 541 554
537 1626 2 594 765
1067 96 2 743 182
14 651 1 411 261
1226 241 2 362 299
499 144 2 749 393
156 783 2 805 508
365 168 1 511 491
654 99 1 188 874
1657 274 2 535 315
1622 599 1 224 254
518 752 1 274 862
1627 4 1 802 541
1127 1180 2 785 554
325 315 1 685 436
38 533 1 621 644
1363 964 2 110 654
1059 1376 2 572 640
1499 1574 1 126 535
126 769 2 464 922<...>
Output

												
Answer

												
Checker Information
Illegal Call Id:8

#7

0ms / 0KB / Restrict Function
Input
5250 3000
9 1961 1 496 960
2759 542 2 859 900
2658 4514 2 362 450
3959 3811 1 816 389
361 3096 2 764 796
936 1134 1 850 4
2615 3384 2 255 112
3229 3026 2 670 309
4302 2718 1 491 665
2242 1066 2 706 777
5185 232 1 691 268
1620 3308 2 845 62
1901 4654 1 538 570
4225 3179 2 384 954
2586 4487 1 141 589
4159 4270 2 138 354
4204 1436 2 49 945
3658 1782 2 732 249
1933 3213 1 238 280
1104 4273 1 575 986
3983 374 2 537 437
2239 4173 1 986 526
926 1820 1 15 293
1671 3950 1 29 762
115 2560 2 969 698
2328 3115 2 684 964
1287 4326 1 32 477
2844 2388 1 648 618
61 770 1 69 70
2724 5237 1 556 990
4948 715 1 634 639
317 3631 2 416 701
4863 4699 2 844 108
2320 4974 1 640 117
4929 924 2 495 514
1539 539 2 446 839
688 87 2 17 136
4962 5114 2 478 630
3606 3607 2 238 18
3884 4252 1 385 478
927 5054 2 95 434
2273 953 1 23 217
3264 4577 2 513 239
234 618 2 168 778
3566 67 2 851 325
3854 4489 2 769 366
369 2325 2 635 347
720 207 2 579 216
95 3640 1 138 652
2516 590 1 169 345
613 369 <...>
Output

												
Answer

												
Checker Information
Illegal Call Id:8

#8

0ms / 0KB / Restrict Function
Input
17500 10000
9920 2878 1 276 554
15413 677 2 938 331
16081 15233 2 963 159
1898 5048 1 55 49
5993 4691 2 844 950
16 5517 2 305 857
13800 2282 1 639 297
14850 13719 2 950 696
8145 4386 2 530 227
14306 14816 2 770 829
12651 11715 2 675 583
11176 14922 2 926 649
7092 16426 2 957 466
10885 2700 1 631 737
8774 6840 2 4 115
1780 10228 2 373 860
12373 5428 2 667 350
9201 8883 1 852 170
4237 4231 1 536 913
11683 14925 1 199 515
3834 12181 1 998 940
11055 1594 2 441 226
14096 7022 1 914 114
2042 3900 2 457 245
11579 16722 2 338 891
7182 16035 1 516 744
13085 12262 1 439 251
10389 17006 1 132 211
12278 17347 1 202 780
13701 10584 1 509 632
5382 2039 1 316 34
4980 4378 2 595 999
14445 12465 1 970 175
8651 3509 1 723 657
5117 5545 2 572 577
16069 5291 2 481 275
559 229 1 802 2
8082 2850 1 23 799
561 8070 1 913 692
5696 6297 1 248 392
17091 13927 1 975 763
16261 2167 1 887 387
4384 16514 1 995 346
3510 7756 2 315 234
9716 16451 1 334 559
10166 11642 1 871 989
11656 13226 2 728<...>
Output

												
Answer

												
Checker Information
Illegal Call Id:8

#9

0ms / 0KB / Restrict Function
Input
52500 30000
28547 25830 1 832 666
24861 10075 1 286 264
48725 32274 1 86 485
7027 51121 2 704 513
132 887 2 486 442
27314 45431 2 827 17
6919 34573 2 288 319
40755 9441 2 770 734
35218 16698 2 496 526
27570 18422 2 574 725
48423 24451 1 20 945
33664 4926 2 276 616
33412 44511 1 250 603
2327 39873 1 66 556
38339 36781 2 425 623
4425 45189 2 291 995
17082 42070 2 606 833
37610 42569 2 772 284
28200 971 2 584 881
51431 47887 2 983 852
35751 30587 2 241 449
10172 636 1 881 132
9194 640 1 250 235
10985 29142 1 731 610
50989 19547 1 706 919
37368 12326 2 4 261
21099 38513 2 273 525
40096 8074 2 705 164
10196 32092 2 609 732
21506 14065 2 423 736
36713 41002 1 27 840
48124 32301 2 848 223
43288 2201 1 310 64
20930 16245 1 354 346
35591 6551 2 931 718
42093 17088 1 110 938
439 168 2 100 721
34289 4693 2 724 643
26692 46277 1 721 508
3987 45380 2 809 603
37276 49854 1 645 125
26207 25231 2 738 93
12468 1531 1 52 288
7095 4717 2 508 832
11802 28338 2 407 904
17432 45468 2 8<...>
Output

												
Answer

												
Checker Information
Illegal Call Id:8

#10

0ms / 0KB / Restrict Function
Input
175000 100000
153075 40169 1 606 697
23058 33296 2 246 413
150668 67209 2 187 960
85854 151518 1 711 560
159893 96638 2 104 799
57742 156279 1 258 802
46834 35646 2 622 387
65972 57664 1 795 337
97173 135482 1 850 291
160042 26431 2 916 63
79991 36506 2 460 134
130651 95391 1 963 321
5710 147061 1 785 752
9528 166688 1 984 44
133695 137310 2 496 601
66028 11138 2 900 99
85685 143581 2 249 493
81601 123739 2 896 568
151722 170810 1 479 501
151579 112806 2 707 519
137469 65018 2 815 451
171117 150606 2 959 56
82869 17867 1 881 43
80627 107555 1 815 85
23004 13433 1 808 999
134479 130292 1 635 88
59407 105901 2 906 325
1959 153365 2 504 605
167532 17596 2 70 367
96046 118594 1 799 348
61444 106102 2 742 282
32081 64652 2 93 33
148451 36744 2 614 193
79677 164843 2 710 169
11565 77267 2 888 785
128583 100012 2 880 515
139003 112013 2 549 558
109716 51180 2 454 835
125910 143184 2 890 18
63505 39862 2 418 590
9066 113042 2 978 155
54341 133625 1 490 202
25990 38693 1 31 2<...>
Output

												
Answer

												
Checker Information
Illegal Call Id:8
#include <bits/stdc++.h>

using namespace std;

typedef pair<int,int> pii;
typedef long long ll;


const int INF=1000000007;
const int maxn=200005;


int c[maxn];
int ans[maxn];
int n,p;

int main(){
	//freopen("bomb.in","r",stdin);
//	freopen("bomb.out","w",stdout);
	scanf("%d%d",&n,&p);
	while(p--){
		int s,m,d,i,a;
		scanf("%d%d%d%d%d",&s,&m,&d,&i,&a);
		if(d==1){
			int e=s+m-1;
			if(e>n)e=n;
			c[s]+=i;
			c[s+1]-=i;
			c[s+1]+=a;
			c[e+1]-=a;
			c[e+1]-=i+(e-s)*a;
			c[e+2]+=i+(e-s)*a;
		}
		else{
			int e=s-m+1;
			if(e<=0)e=1;
			swap(e,s);
			i=i+(e-s)*a;
			a=-a;
			c[s]+=i;
			c[s+1]-=i;
			c[s+1]+=a;
			c[e+1]-=a;
			c[e+1]-=i+(e-s)*a;
			c[e+2]+=i+(e-s)*a;
		}
		//ans[0]=0;
		//for(int i=1;i<=n;++i){
		//	ans[i]=ans[i-1]+c[i];
		//}
		//for(int i=1;i<=n;++i){cerr<<c[i]<<' ';}
		//cerr<<endl;
		//for(int i=1;i<=n;++i){cerr<<ans[i]<<' ';}
		//cerr<<endl;
	}
	ans[0]=0;
	for(int i=1;i<=n;++i){
		ans[i]=ans[i-1]+c[i];
	}
//	for(int i=1;i<=n;++i){cerr<<ans[i]<<' ';}
//	cerr<<endl;
	int g=0;
	for(int i=1;i<=n;++i){
		g+=ans[i];
		printf("%d ",g);
	}
	return 0;
}
Main.cpp: In function ‘int main()’:
Main.cpp:20:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&n,&p);
  ~~~~~^~~~~~~~~~~~~~
Main.cpp:23:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d%d%d%d",&s,&m,&d,&i,&a);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~