QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#832457 | #9848. Paid Leave | isWFnoya# | WA | 89ms | 7232kb | C++23 | 712b | 2024-12-25 21:42:51 | 2024-12-25 21:42:56 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1919810;
typedef long long ll;
ll n,m,x,y,k;
// int op[N],num[N];
ll a[N];
// ll x;
ll ans;
ll leave;
void cal(ll l,ll r){
if(l>r) return;
ll res=y+2;
ll len=r-l+1;
ll step=x;
if(y-leave<x){
step=y-leave;
}
ll num=len/res;
ans+=num*2;
len-=num*res;
// cout<<l<<" "<<r<<" "<<num<<endl;
if(len>step){
ans++;
leave=max(0ll,len-(step+1));
}else{
leave=len;
}
}
int main(){
cin>>n>>m>>x>>y;
for(int i=1;i<=m;i++) cin>>a[i];
a[m+1]=n+1;
for(int i=1;i<=m+1;i++){
cal(a[i-1]+1,a[i]-1);
// cout<<ans<<endl;
}
cout<<ans<<endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3628kb
input:
8 0 3 3
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
11 1 2 4 6
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
17 2 5 7 6 12
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
30 2 5 6 7 21
output:
5
result:
ok single line: '5'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
38 1 6 6 20
output:
8
result:
ok single line: '8'
Test #6:
score: 0
Accepted
time: 88ms
memory: 6972kb
input:
1000000000000000000 200000 335 557 100001107740026995 100006839102156826 100022686256019614 100026614627087325 100028132190673912 100028139572417710 100034215622293235 100034900480199246 100036139505369203 100044008392310726 100044464248012860 100048368217638304 100053064689708568 100060255356679151...
output:
3577817531189003
result:
ok single line: '3577817531189003'
Test #7:
score: 0
Accepted
time: 30ms
memory: 4164kb
input:
359425126796044126 68013 72652123 104564477 12364747588532 15686712628578 18813370684281 25724948758873 44798252398370 46102702267960 47217527349110 48844320792601 54754265123103 54806360671978 62305720129343 63581566857034 65595780369827 70008379838832 70267866349567 73221506834291 75195943248778 7...
output:
6874665214
result:
ok single line: '6874665214'
Test #8:
score: 0
Accepted
time: 67ms
memory: 6120kb
input:
262596908761956329 168384 3636195729392389 4701187958082704 180856665012 2046521914925 4435875568321 7791606316598 7967918469337 10759374091980 13334965697210 13808557560157 14413058365948 15227606613351 15400179661925 16056774911176 16373092992406 16928423852148 17030158634019 20292485890472 215947...
output:
0
result:
ok single line: '0'
Test #9:
score: 0
Accepted
time: 11ms
memory: 3880kb
input:
182120752693123471 24446 5222 5444 10378437090275 11172570340677 22619272427490 28237570137025 32399061878139 40124230809350 66379513233883 73089169763850 75431308592943 88100676178136 96539264171131 99867522582249 105515696857693 116232680791280 134767581061788 139536195601494 141852652699289 14927...
output:
66882391718207
result:
ok single line: '66882391718207'
Test #10:
score: 0
Accepted
time: 17ms
memory: 3928kb
input:
618640706630768198 37828 924861983 1094084390 55588491214423 62355560535287 67750392137064 109318266217100 123464566398720 125659489407376 129347610524196 133193174843679 146627311659270 151005616010720 179065907374332 184701092167211 202528392053602 261456340065691 286222110380541 294706290720884 3...
output:
1130857948
result:
ok single line: '1130857948'
Test #11:
score: 0
Accepted
time: 35ms
memory: 5900kb
input:
881476573578831848 80000 44 79 72555691666351 77509757815395 77773472573826 85373990157744 105001415881452 120852205497925 133665977400854 148581475247014 154517553727045 154666328655777 158259473705257 167507631093982 168213472450675 171392265103406 180888502239034 184443004586547 186042947889942 1...
output:
21764853668568234
result:
ok single line: '21764853668568234'
Test #12:
score: 0
Accepted
time: 27ms
memory: 4256kb
input:
948792564573514502 80345 30 48 12219747242920 17356669824583 44069602100732 46377973555898 53345896270231 54805430465936 73797431460064 111520238316524 112122519910031 116081664232229 123444299301663 130982470457732 133685472691747 138570742852228 159540354743259 161368560794681 167481361723269 1697...
output:
37951702582891448
result:
ok single line: '37951702582891448'
Test #13:
score: 0
Accepted
time: 47ms
memory: 4704kb
input:
163909913845761226 128089 31568399 43751342 172575303713 3000457788686 3443571216852 6041654468031 6336287956263 7556706050361 8287340699183 11407915310552 15290759349375 16657391431982 18364662349755 18420051226665 18425441071023 20408417671615 20700764746286 21088661317622 21972011597907 223623682...
output:
7492712704
result:
ok single line: '7492712704'
Test #14:
score: 0
Accepted
time: 84ms
memory: 6868kb
input:
822899442500504878 194280 212635219453755143 379406979582891623 4775543983333 6791130266043 8631669216886 10093958291364 17653425498000 18295115670980 20977690939535 21337408539340 24508835889976 24520168455661 29475287800429 32023984008155 35484089213461 37439633876412 49612832954591 55041446601056...
output:
0
result:
ok single line: '0'
Test #15:
score: 0
Accepted
time: 6ms
memory: 3880kb
input:
96714032625698 24908 2863972027 2953205775 3308322170 5226111003 10797112295 18784108258 19822274598 30036705431 35535085260 38627912190 39662892043 51595495720 64489456745 66160370686 72413953194 78807937797 91378943741 91420659440 92238411576 93246917089 99853219993 101077681500 108948890860 11063...
output:
49943
result:
ok single line: '49943'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
169 3 16 26 35 105 143
output:
9
result:
ok single line: '9'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
306 23 13 20 3 23 29 33 67 79 81 84 85 89 93 108 113 150 166 168 186 189 211 212 245 266 272
output:
16
result:
ok single line: '16'
Test #18:
score: 0
Accepted
time: 67ms
memory: 4820kb
input:
47068761889208183 161631 42164418634 57749164246 323588936409 459190426757 594613056665 1287335372887 1395342146866 1556600544184 1939005844997 2234039862941 2844174625765 2905944541617 3384822970590 3953486117420 4166297457888 4206584397299 4241601292960 4268922330815 4339357464597 4660447927297 49...
output:
1528075
result:
ok single line: '1528075'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
30 3 8 15 10 27 28
output:
2
result:
ok single line: '2'
Test #20:
score: 0
Accepted
time: 52ms
memory: 6348kb
input:
230139667889709 140511 454059413 618147327 3907065618 3930556610 4233636571 4690661390 12995546974 13557207227 15075444276 16704142277 18415905760 22841691881 24082622049 25347413381 25712230868 30509796594 35783071041 37407465384 37411516778 39944239772 42260968171 44631433274 44927225548 464085699...
output:
657380
result:
ok single line: '657380'
Test #21:
score: 0
Accepted
time: 53ms
memory: 6028kb
input:
25745839358475954 129360 21387037534 25564520912 95346702917 131666169818 141339963167 165949673344 903984795740 1010405517379 1089856406571 1449548876690 1458143471489 1802105103000 1917505322647 1957338365277 2441703843517 2538801573859 2580333918790 3126248660846 3318594344648 3347470876904 39828...
output:
1929608
result:
ok single line: '1929608'
Test #22:
score: 0
Accepted
time: 52ms
memory: 4900kb
input:
13061306488076 153849 34959776 60602444 6810743 10530459 181327191 402480339 436519548 696874171 736464686 783035402 821316768 827004735 933278149 1026341292 1046777989 1100226815 1324529340 1618239301 1620284521 1829340398 1864972743 1924256817 2161230649 2285344893 2371724504 2412998270 2526199337...
output:
349143
result:
ok single line: '349143'
Test #23:
score: 0
Accepted
time: 88ms
memory: 6976kb
input:
1000000000000000000 199984 59 89 1392043484371 3774291509023 3880275353624 21138298694198 33633666060409 45682547880528 48171088596841 49654253279951 50409217429172 58932674345741 63832542576504 64531979969971 68581739068996 71471409248752 71815611575264 78497563942933 78570944302446 83032448375242 ...
output:
21978021977897119
result:
ok single line: '21978021977897119'
Test #24:
score: 0
Accepted
time: 87ms
memory: 6312kb
input:
1000000000000000000 199947 62 119 1768143964670 3551818283253 4417874115465 8632437464920 11167140437906 12441209858164 19311369703150 27432778562883 30180972948862 64083673275342 66930106105287 68783632713372 73536860547263 81549965503053 88075401898461 95213659819398 101535599446473 10375403546286...
output:
16528925619729160
result:
ok single line: '16528925619729160'
Test #25:
score: 0
Accepted
time: 87ms
memory: 6504kb
input:
1000000000000000000 199914 49 76 5310954831666 9686731572776 12061010528745 18372313562762 24579325382939 33008685549901 34439497754326 41811739285845 44530097521226 51631571257496 53922597763424 54810436287001 62422818828130 70348082074187 84828307401187 84914386996864 88083743204125 10162042787878...
output:
25641025640902369
result:
ok single line: '25641025640902369'
Test #26:
score: 0
Accepted
time: 89ms
memory: 6268kb
input:
1000000000000000000 199949 1690052 1774021 5850465264181 7720490744452 9519727141271 14527626378312 22470967929082 29559521461733 35017561475483 45923638705651 46529614128701 47143236294837 48255979746878 56334117617889 67545905625843 68252693336724 74281867574025 78783369155692 80692317859551 83519...
output:
1127380966058
result:
ok single line: '1127380966058'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
1 0 1 1
output:
0
result:
ok single line: '0'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
2 0 1 1
output:
1
result:
ok single line: '1'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
2 0 1 2
output:
1
result:
ok single line: '1'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
1 1 1 2 1
output:
0
result:
ok single line: '0'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
2 2 1 1 1 2
output:
0
result:
ok single line: '0'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
1000000000000000000 0 1 1
output:
666666666666666666
result:
ok single line: '666666666666666666'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
1000000000000000000 0 1 2
output:
500000000000000000
result:
ok single line: '500000000000000000'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
5 4 1000000000000000000 1000000000000000000 1 2 4 5
output:
0
result:
ok single line: '0'
Test #35:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
5 1 500000000000000000 1000000000000000000 3
output:
0
result:
ok single line: '0'
Test #36:
score: 0
Accepted
time: 88ms
memory: 6424kb
input:
1000000000000000000 199937 1504701 1997473 11561451796378 14430187380139 16423020464303 17734759862264 18678931246571 19467388505317 32602064077409 37884398858603 43797911697710 53567794306235 66343560073989 68500499450604 76591106085137 76929118621007 78962083561165 80693607913764 83627001753863 89...
output:
1001263966378
result:
ok single line: '1001263966378'
Test #37:
score: 0
Accepted
time: 86ms
memory: 5732kb
input:
1000000000000000000 199959 1089475 1893638 7754838734611 17449221347557 32406000789471 37496884320420 41243645091595 44363311511716 48044844615673 49009903291505 51147114330869 58218184109035 58512609502650 69354850004179 69809457024083 71513812318108 84464451142228 89010331597606 93197850965454 103...
output:
1056166846191
result:
ok single line: '1056166846191'
Test #38:
score: 0
Accepted
time: 84ms
memory: 6888kb
input:
1000000000000000000 199949 3229440727775 3643019740087 22513008746949 23069062883041 26164141466776 26975022842714 28590935830562 30870041789826 36399580751296 51531622370934 56119055988345 60149231328008 60982333162701 74917642353839 75196611787598 75988695523210 77788504111561 81292644258984 92226...
output:
424790
result:
ok single line: '424790'
Test #39:
score: 0
Accepted
time: 88ms
memory: 7132kb
input:
1000000000000000000 199905 3538923840370 6271274485369 5329967357530 8856096673095 17855369934992 18542641748287 21240635197775 30000948014274 33771165928346 34208160730199 39852774177080 50536035661978 54976484611998 55542577659119 55835793779785 57524155087895 60759725726162 67196320251787 6960278...
output:
219181
result:
ok single line: '219181'
Test #40:
score: 0
Accepted
time: 87ms
memory: 6312kb
input:
1000000000000000000 199956 3522274097203 4701199120463 2746558202561 13049869619879 16215094951483 27207197864006 37204844800107 43988498519692 52635436161855 74742515034238 74891613588750 78916538528949 79949631449838 85404947126844 97806426458246 99067826970318 112149287955476 112762741935347 1162...
output:
306700
result:
ok single line: '306700'
Test #41:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
1000000000000000000 100 1728306 2599044 11996847154642428 12087605526407024 20518444469636121 25563403156596850 26065534691577653 38243221746888430 77515816822994851 86457146386952196 108995570511172836 113214920692949906 124218753627601096 139598144731092081 146637898927971415 158220994072786870 16...
output:
769513121294
result:
ok single line: '769513121294'
Test #42:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
1000000000000000000 100 1431443 1712318 3228568841288096 5280520284951630 7058415258544990 9187921169852088 16348445760520954 31056137292136166 35855051174006532 42722999685481660 53061469975930758 86400712837417250 94109315299701392 98333812005596645 106190731848877900 113117241146918898 1289318024...
output:
1168005980129
result:
ok single line: '1168005980129'
Test #43:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
1000000000000000000 100 1174762 1891779 11616811726399784 24742031147488419 33326211585969817 46818539927769481 52525893411127849 53451810523760566 68074717599426285 81875310264807963 109492976324715957 123138890515361629 134755949595628968 145570612550304179 156946595815425640 163127791070556070 16...
output:
1057204824393
result:
ok single line: '1057204824393'
Test #44:
score: 0
Accepted
time: 86ms
memory: 6040kb
input:
1000000000000000000 199906 1234567 1234567 1731818490801 2122807652085 6736036960556 12927436934877 18826295352394 34307858707399 37337021260245 40452754693506 49817096344510 50366812225110 56821799348163 60851825722095 62867305791124 64631921750179 75433611988435 80207943996474 87238064243938 98313...
output:
1619998425032
result:
ok single line: '1619998425032'
Test #45:
score: 0
Accepted
time: 84ms
memory: 6568kb
input:
1000000000000000000 199991 1234567 2469134 6280610355519 15906769305529 21365794686592 24186088343943 27021020313261 28704076929298 31522118949484 42490635317097 42824572021342 48004868495661 49523894791526 50680040830506 55507784162387 56539457043467 60105462866064 60451862107886 61188588946907 621...
output:
809999835301
result:
ok single line: '809999835301'
Test #46:
score: 0
Accepted
time: 36ms
memory: 7232kb
input:
200000 200000 134 191 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:
0
result:
ok single line: '0'
Test #47:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
10 10 134 191 1 2 3 4 5 6 7 8 9 10
output:
0
result:
ok single line: '0'
Test #48:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
840761157363669040 174 546605067911748 750396926178795 10332189812832358 11932140136734135 21152651031857350 22702326943137281 29209152438589745 41659057507735876 44743873491781355 47789635892953403 50447744265370836 59728593216689825 59911321104694047 60105974188290993 77002512541558093 77306075814...
output:
2134
result:
ok single line: '2134'
Test #49:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
79573069671956483 174 114007625 210710069 75720009541528 79421439338662 92080821186751 317143776822336 706731608519858 730263062216363 808573562873746 1460776366703072 1464732766008796 2293933911411311 4095954196988451 4125742927859673 4310921111013938 4597744530175896 5075651290699043 5701815174467...
output:
755284824
result:
ok single line: '755284824'
Test #50:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
376698978431729568 174 15 21 1719752919887528 4602948539675789 5036859451995575 5363477163127639 6437879335814540 7795179862065102 8935901473541292 10035275876991869 10283012166743229 11668866594768807 12836444500414840 13369963442698542 16035835054750929 24731662954097051 28967649198448587 30063542...
output:
32756432907106805
result:
ok single line: '32756432907106805'
Test #51:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
459005690724361261 174 1652 3042 2463758135008105 4253723265723222 6968029119221207 9335756721474367 10470907765581374 11232287948796586 15239230715100851 15846025160785950 16272970321940501 22316057550800146 27723654293499328 36143192146801943 36709422619275299 39085880846724634 39614689229943935 4...
output:
301580611513944
result:
ok single line: '301580611513944'
Test #52:
score: -100
Wrong Answer
time: 78ms
memory: 6560kb
input:
22931396418858020 199941 79340070399 130564324373 55562319434 230872235990 301044358558 349345893309 381279899279 410054478793 655772931940 695353518783 703438087947 784511589013 865918633646 983949312747 1133878471479 1165761769205 1194733781987 1643031323289 1675070951846 1752348234931 18805356202...
output:
247071
result:
wrong answer 1st lines differ - expected: '246999', found: '247071'