QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#111995 | #5253. Denormalization | xaphoenix# | WA | 2ms | 3524kb | C++14 | 1.3kb | 2023-06-09 13:31:17 | 2023-06-09 13:31:21 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define LC k<<1
#define RC k<<1|1
#define IO cin.sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define rep(i,a,n) for (int i = a; i < n; i++)
#define repn(i,a,n) for (int i = a; i <= n; i++)
#define per(i,a,n) for (int i = (n) - 1; i >= a; i--)
#define pern(i,a,n) for (int i = n; i >= a; i--)
typedef long long LL;
typedef long double LD;
typedef unsigned long long ull;
typedef pair<int, int> PII;
typedef pair<int, LL> PIL;
typedef pair<LL, int> PLI;
typedef pair<double, double> PDD;
typedef pair<ull, ull> PUU;
typedef pair<LL, LL> PLL;
const int N = 11000;
const int M = 1100000;
const int mod = 1e9+7;
const int inf = (int)1e9;
const LL INF = 1e18;
const double eps = 1e-9;
mt19937_64 Rand((unsigned long long)new char);
#define rand Rand
int n;
double f[N];
int a[N];
int main() {
IO;
cin >> n;
repn(i, 1, n) cin >> f[i];
repn(x, 1, 10000) {
a[1] = x;
int flag = 0;
repn(i, 2, n) {
double val = a[1] * f[i] / f[1];
a[i] = round(val);
if (abs(val - a[i]) > eps) {
flag = 1;
break;
}
}
if (!flag) break;
}
repn(i, 1, n) cout << a[i] << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3524kb
input:
2 0.909840249060 0.414958698174
output:
10000 4561
result:
wrong answer incorrect solution