QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#832415 | #9848. Paid Leave | isWFnoya# | WA | 87ms | 6756kb | C++23 | 752b | 2024-12-25 21:16:12 | 2024-12-25 21:16:13 |
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;
if((y-leave)*2<y){
ll nw=y-leave;
len-=(nw+1);
ans++;
}
if(len<0) return;
ll num=len/res;
ans+=num*2;
len-=num*res;
// cout<<l<<" "<<r<<" "<<num<<endl;
if(len>x){
ans++;
leave=max(0ll,len-(x+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;
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: 3644kb
input:
8 0 3 3
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
11 1 2 4 6
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
17 2 5 7 6 12
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3628kb
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: -100
Wrong Answer
time: 87ms
memory: 6756kb
input:
1000000000000000000 200000 335 557 100001107740026995 100006839102156826 100022686256019614 100026614627087325 100028132190673912 100028139572417710 100034215622293235 100034900480199246 100036139505369203 100044008392310726 100044464248012860 100048368217638304 100053064689708568 100060255356679151...
output:
3577817531187261
result:
wrong answer 1st lines differ - expected: '3577817531189003', found: '3577817531187261'