QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#510941#7845. Fast Forward122WA 0ms3588kbC++14535b2024-08-09 14:22:402024-08-09 14:22:40

Judging History

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

  • [2024-08-09 14:22:40]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3588kb
  • [2024-08-09 14:22:40]
  • 提交

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 '