QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90130#5253. Denormalizationchiranko#WA 2ms3484kbC++14587b2023-03-22 13:36:332023-03-22 13:36:36

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-22 13:36:36]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3484kb
  • [2023-03-22 13:36:33]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(l,r) for(int i=l;i<=r;i++)

using namespace std;

typedef long double LD;
typedef long long ll;
const int N=1e4+10;

int n;
LD a[N];
ll b[N];
int tround(ll x)
{
	return x/10000;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n;
	rep(1,n)cin>>a[i];
	rep(1,n)b[i]=round(sqrt(a[i]*a[i]*1e16));
	rep(1,n)b[i]=tround(b[i]);
	ll d=b[1];
	rep(2,n)d=__gcd(d,b[i]);
	rep(1,n)b[i]/=d;
	rep(1,n)cout<<b[i]<<"\n";
//	LD q=0;
//	rep(1,n)q+=(LD)b[i]*b[i];
//	q=sqrt(q);
//	rep(1,n)cout<<b[i]/q<<"\n";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
0.909840249060
0.414958698174

output:

9098
4149

result:

wrong answer incorrect solution