QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#800846 | #9848. Paid Leave | GSYL# | WA | 1ms | 3820kb | C++14 | 810b | 2024-12-06 16:10:46 | 2024-12-06 16:10:50 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,x,y;
cin>>n>>m>>x>>y;
vector<int> a(m+2);
a[0] = 0;
a.back() = n+1;
for(int i=1;i<=m;i++)cin>>a[i];
int last = 0;
int ad = 0;
for(int i=1;i<a.size();i++){
// cerr<<i<<endl;
int d = a[i]-a[i-1]-1;
// cerr<<d<<endl;
if(d>y+2){
ad += d/(y+2)*2;
d%=y+2;
last = max(y-x,last);
}
// cerr<<' '<<d<<endl;
while(1){
int d1 = x;
int d2 = y-last;
int dd = min(d1,d2);
if(dd>=d){
last = d;
break;
}
last = dd;
d-=dd+1;
ad++;
}
}
cout<<ad<<endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3568kb
input:
8 0 3 3
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
11 1 2 4 6
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
17 2 5 7 6 12
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
30 2 5 6 7 21
output:
5
result:
ok single line: '5'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
38 1 6 6 20
output:
8
result:
ok single line: '8'
Test #6:
score: -100
Wrong Answer
time: 1ms
memory: 3704kb
input:
1000000000000000000 200000 335 557 100001107740026995 100006839102156826 100022686256019614 100026614627087325 100028132190673912 100028139572417710 100034215622293235 100034900480199246 100036139505369203 100044008392310726 100044464248012860 100048368217638304 100053064689708568 100060255356679151...
output:
2147483647
result:
wrong answer 1st lines differ - expected: '3577817531189003', found: '2147483647'