QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#700301 | #5253. Denormalization | Ashbourne | WA | 3ms | 3840kb | C++23 | 862b | 2024-11-02 12:40:21 | 2024-11-02 12:40:36 |
Judging History
answer
#include<bits/stdc++.h>
#define double long double
#define pdd pair<double, int>
using namespace std;
const double eps = 1e-9;
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(abs(round(t) - t) >= eps) continue;
for(int j = 1; j <= n; ++ j){
double sd = b[j] * t;
double se = sqrt(sd);
if(abs(round(se) - se) >= 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 + eps) << endl;
}
break;
}
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 3840kb
input:
2 0.909840249060 0.414958698174
output:
1.20801 4.83203 10.8721 19.3281 30.2002 43.4883 59.1924 77.3125 97.8486 120.801 146.169 173.953 204.153 236.77 271.802 309.25 349.114 391.395 436.091 483.203 532.731 584.676 639.036 695.812 755.005 816.613 880.638 947.078 1015.93 1087.21 1160.9 1237 1315.52 1396.46 1479.81 1565.58 1653.76 1744.36 18...
result:
wrong output format Expected integer, but "1.20801" found