QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#700599 | #5253. Denormalization | Ashbourne | WA | 1ms | 3868kb | C++23 | 662b | 2024-11-02 13:12:31 | 2024-11-02 13:12:31 |
Judging History
answer
#include<bits/stdc++.h>
#define double long double
const double eps = 1e-3;
using namespace std;
signed main(){
ios::sync_with_stdio(0);
int n;
cin >> n;
vector<double>a(n + 1);
for(int i = 1; i <= n; ++ i) cin >> a[i];
double mx = 0.0;
for(int i = 1; i <= n; ++ i) mx = max(mx, a[i]);
for(int i = 1; i <= 10000; ++ i){
double t = i / mx;
bool flag = 1;
if(fabs(round(t * t) - t * t) >= eps) continue;
for(int j = 1; j <= n; ++ j){
double tt = a[j] * t;
if(fabs(round(tt) - tt) >= eps){
flag = 0; break;
}
}
if(flag){
for(int j = 1; j <= n; ++ j) cout << round(a[j] * t) << endl;
break;
}
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3868kb
input:
2 0.909840249060 0.414958698174
output:
7946 3624
result:
wrong answer the greatest common divisor is 2, but expected 1.