QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#797268 | #9848. Paid Leave | rotcar07 | WA | 86ms | 7064kb | C++23 | 391b | 2024-12-02 20:01:23 | 2024-12-02 20:01:29 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n,x,y,m;cin>>n>>m>>x>>y;x++,y+=2;
vector<ll> v(m+1,1);
for(int i=1;i<=m;i++) cin>>v[i];
v.push_back(n);
ll cur=0,ans=0;
for(int i=1;i<=m+1;i++){
ll d=v[i]-v[i-1];
if(!d) continue;
ans+=d/y*2;d%=y;
if(d<=min(y-cur,x))cur=d;
else cur=d-min(y-cur,x),ans++;
}
cout<<ans<<'\n';
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3592kb
input:
8 0 3 3
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
11 1 2 4 6
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
17 2 5 7 6 12
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
30 2 5 6 7 21
output:
5
result:
ok single line: '5'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
38 1 6 6 20
output:
8
result:
ok single line: '8'
Test #6:
score: -100
Wrong Answer
time: 86ms
memory: 7064kb
input:
1000000000000000000 200000 335 557 100001107740026995 100006839102156826 100022686256019614 100026614627087325 100028132190673912 100028139572417710 100034215622293235 100034900480199246 100036139505369203 100044008392310726 100044464248012860 100048368217638304 100053064689708568 100060255356679151...
output:
3577817531189370
result:
wrong answer 1st lines differ - expected: '3577817531189003', found: '3577817531189370'