QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#822535#9848. Paid LeaveFurinaHateComma#WA 81ms5304kbC++14803b2024-12-20 13:59:432024-12-20 13:59:43

Judging History

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

  • [2024-12-20 13:59:43]
  • 评测
  • 测评结果:WA
  • 用时:81ms
  • 内存:5304kb
  • [2024-12-20 13:59:43]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define ll long long
const int N = 2e5 + 10;
vector<int> blk;
int n, m, x, y, ans, lst, now;
void calc(int l, int n){
	ans += 2 * (n / (y + 2));	
	n %= (y + 2);
	if(n > (l + 1)){
		ans ++;
		lst = (n - (l + 1));
	}
	else lst = n;
}
void solve(){
	cin >> n >> m >> x >> y;
	for(int i = 1 ; i <= m ; i ++){
		cin >> now;
		blk.push_back(now - lst - 1);
		lst = now;
	}
	blk.push_back(n - lst);
	lst = 0;
	for(int i = 0 ; i <= m ; i ++){
		int fir = min(x, y - lst);
		if(blk[i] <= fir){
			lst = blk[i];
			continue;
		}
		ans ++; blk[i] -= fir + 1; lst = fir;
		calc(y - fir, blk[i]);
//		cout << i << ' ' << blk[i] << ' ' << ans << '\n';
	}
	cout << ans << '\n';
}

signed main(){
	solve();
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3544kb

input:

8 0 3 3


output:

2

result:

ok single line: '2'

Test #2:

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

input:

11 1 2 4
6

output:

2

result:

ok single line: '2'

Test #3:

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

input:

17 2 5 7
6 12

output:

1

result:

ok single line: '1'

Test #4:

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

input:

30 2 5 6
7 21

output:

5

result:

ok single line: '5'

Test #5:

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

input:

38 1 6 6
20

output:

8

result:

ok single line: '8'

Test #6:

score: -100
Wrong Answer
time: 81ms
memory: 5304kb

input:

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

output:

3577817531188625

result:

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