QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#235559#6564. Frequent Flierugly2333WA 10ms5364kbC++20376b2023-11-02 21:48:022023-11-02 21:48:03

Judging History

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

  • [2023-11-02 21:48:03]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:5364kb
  • [2023-11-02 21:48:02]
  • 提交

answer

//Δ_G
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef double DB;
const int N = 222222;
int n,m,k;
LL s[N],t,ans;
int main(){
	int i,x;
	scanf("%d%d%d",&n,&m,&k);
	for(i=1;i<=n;i++){
		scanf("%d",&x);
		t=s[i-1];
		if(i-k>=0)
			t-=s[i-k];
		t=min((LL)x,k-t);
		s[i]=s[i-1]+t;
		ans+=t;
	}
	printf("%lld\n",ans);
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3892kb

input:

8 3 2
3
1
4
1
5
9
2
6

output:

8

result:

ok single line: '8'

Test #2:

score: -100
Wrong Answer
time: 10ms
memory: 5364kb

input:

200000 2467 999931035
182548858
69876218
33328350
919486767
739850600
948199964
392292320
39077742
366752074
917496841
246661698
37219034
56677740
188278971
965701828
28059790
13200243
825730775
542597589
320715170
939054378
470563899
914247467
990100491
290827128
903662394
611104879
18631185
412134...

output:

999931035

result:

wrong answer 1st lines differ - expected: '82994275905', found: '999931035'