QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#700375 | #5253. Denormalization | Ashbourne | WA | 1ms | 3752kb | C++23 | 953b | 2024-11-02 12:51:10 | 2024-11-02 12:51:16 |
Judging History
answer
#include<bits/stdc++.h>
#define double long double
#define pdd pair<double, int>
using namespace std;
const double eps = 1e-3;
int n, m;
double a, b;
signed main(){
ios::sync_with_stdio(0);
cin >> n;
vector<double>a(n + 1), b(n + 1);
double maxx = 0;
for(int i = 1; i <= n; ++ i){
cin >> a[i];
b[i] = a[i] * a[i];
maxx = max(b[i], maxx);
}
for(int i = 1; i <= 10000; ++ i){
bool flag = 1;
double t;
t = 1.0 * i * i / maxx;
// cout << t << endl;
// if(t >= 1236) cout << round(t) - t << " " << i << endl;
if(abs(round(t) - t) >= eps) continue;
// cout << i /<< endl;
for(int j = 1; j <= n; ++ j){
double sd = b[j] * t;
double se = sqrt(sd);
if(abs(round(se) - se) >= eps * eps){
flag = 0;
break;
}
}
if(flag){
double fac = sqrt(t);
// cout << fac << endl;
for(int j = 1; j <= n; ++j){
cout << (int)(a[j] * fac) << endl;
}
break;
}
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3752kb
input:
2 0.909840249060 0.414958698174
output:
9665 4407
result:
wrong answer incorrect solution