QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#89655#5253. DenormalizationFengfengWA 2ms3572kbC++20525b2023-03-20 20:47:442023-03-20 20:47:47

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:47:47]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3572kb
  • [2023-03-20 20:47:44]
  • 提交

answer

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

const int N=1e4+10;

long double a[N];
int n;
int ans[N];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	for(int i=1;i<=10000;i++)
	{
		int f=1;
		long double d=i/a[1];
		ans[1]=i;
		for(int j=2;j<=n;j++)
		{
			long double t=a[j]*d;
			int tt=(int)t+(t-(int)t>1-1e-6?1:0);
			if(t>=1&&t<=10000&&t-tt<1e-18){
				ans[j]=tt;
			}	
			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: 100
Accepted
time: 0ms
memory: 3396kb

input:

2
0.909840249060
0.414958698174

output:

9665
4408

result:

ok good solution

Test #2:

score: 0
Accepted
time: 2ms
memory: 3508kb

input:

3
0.005731604132
0.696198848562
0.717826101486

output:

75
9110
9393

result:

ok good solution

Test #3:

score: -100
Wrong Answer
time: 2ms
memory: 3572kb

input:

10
0.338936215010
0.390914583549
0.048893426174
0.446152513833
0.137891103101
0.017985796057
0.459132554353
0.201452557127
0.362800863500
0.358493585479

output:

10000
6716
0
0
0
0
0
0
0
0

result:

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