QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#510941 | #7845. Fast Forward | 122 | WA | 0ms | 3588kb | C++14 | 535b | 2024-08-09 14:22:40 | 2024-08-09 14:22:40 |
Judging History
answer
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
#define int long long
#define INF 0x3f3f3f3f
#define inf 1e9
signed main() {
IOS;
int n,m;
cin>>n>>m;
vector<int>vec(2*n+1,0);
for(int i=1;i<=n;i++)
{
cin>>vec[i];
vec[i+n]=vec[i];
}
for(int i=1;i+n<=2*n;i++)
{int s=0;int ans=0;
for(int j=i,k=1;k<=n-1;j++,k++)
{
s+=vec[j];
int a=s/m;
if(a>0) s-=m*a;
ans+=a;
// cout<<s<<endl;
}
cout<<ans<<" ";
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3588kb
input:
7 7 1 1 1 1 1 1 1
output:
0 0 0 0 0 0 0
result:
ok single line: '0 0 0 0 0 0 0 '
Test #2:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
3 3 1 1 3
output:
0 1 1
result:
ok single line: '0 1 1 '
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3480kb
input:
10 5 4 1 5 5 1 3 2 1 5 2
output:
5 5 5 4 4 5 5 5 5 4
result:
wrong answer 1st lines differ - expected: '5 4 5 4 4 5 4 4 5 4', found: '5 5 5 4 4 5 5 5 5 4 '