QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#235559 | #6564. Frequent Flier | ugly2333 | WA | 10ms | 5364kb | C++20 | 376b | 2023-11-02 21:48:02 | 2023-11-02 21:48:03 |
Judging History
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'