QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#89644#5253. DenormalizationFengfengWA 2ms3464kbC++20510b2023-03-20 20:29:132023-03-20 20:29:16

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-20 20:29:16]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3464kb
  • [2023-03-20 20:29:13]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

const int N=1e4+10;

double a[N];
int n;
int ans[N];
int main()
{
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	for(int i=1;i<=10000;i++)
	{
		int f=1;
		double d=i/a[1];
		ans[1]=i;
		for(int j=2;j<=n;j++)
		{
			double t=a[j]*d;
			if(t-(int)t<1e-10){
				ans[j]=t;
			}	
			else {
				f=0;break;
			}
		}
		if(f) break;
	}
	for(int i=1;i<=n;i++) cout<<ans[i]<<'\n';
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3464kb

input:

2
0.909840249060
0.414958698174

output:

10000
0

result:

wrong answer Integer parameter [name=r_i] equals to 0, violates the range [1, 10000]