QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#797275#9848. Paid Leaverotcar07WA 89ms7852kbC++23397b2024-12-02 20:05:212024-12-02 20:05:27

Judging History

你现在查看的是最新测评结果

  • [2024-12-02 20:05:27]
  • 评测
  • 测评结果:WA
  • 用时:89ms
  • 内存:7852kb
  • [2024-12-02 20:05:21]
  • 提交

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,0);
	for(int i=1;i<=m;i++) cin>>v[i];
	v.push_back(n+1);
	ll cur=0,ans=0;
	for(int i=1;i<=m+1;i++){
		ll d=v[i]-v[i-1]-1;
		if(d<=0) 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: 3584kb

input:

8 0 3 3


output:

2

result:

ok single line: '2'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

11 1 2 4
6

output:

2

result:

ok single line: '2'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3464kb

input:

17 2 5 7
6 12

output:

1

result:

ok single line: '1'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

30 2 5 6
7 21

output:

5

result:

ok single line: '5'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

38 1 6 6
20

output:

8

result:

ok single line: '8'

Test #6:

score: -100
Wrong Answer
time: 89ms
memory: 7852kb

input:

1000000000000000000 200000 335 557
100001107740026995 100006839102156826 100022686256019614 100026614627087325 100028132190673912 100028139572417710 100034215622293235 100034900480199246 100036139505369203 100044008392310726 100044464248012860 100048368217638304 100053064689708568 100060255356679151...

output:

3577817531188653

result:

wrong answer 1st lines differ - expected: '3577817531189003', found: '3577817531188653'