QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#111998#5253. Denormalizationxaphoenix#WA 2ms3584kbC++141.6kb2023-06-09 13:41:552023-06-09 13:41:56

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-09 13:41:56]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3584kb
  • [2023-06-09 13:41:55]
  • 提交

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;
LD 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;
		LD d = (LD)a[1] * a[1];
		repn(i, 2, n) {
			LD val = a[1] * f[i] / f[1];
			a[i] = round(val);
			d += (LD)a[i] * (LD)a[i];
			if (abs(val - a[i]) > eps) {
				flag = 1;
				break;
			}
		}
		if (flag) continue;
		d = sqrt(d);
		repn(i, 1, n) {
			LD y = a[i] / d;
			if (abs(y - f[i]) > eps) {
				flag = 1;
				break;
			}
		}
		if (flag) continue;
		int m = a[1];
		repn(i, 2, n) m = __gcd(m, a[i]);
		if (m != 1) continue;
		break;
	}
	repn(i, 1, n) cout << a[i] << "\n";
	return 0;
}

详细

Test #1:

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

input:

2
0.909840249060
0.414958698174

output:

10000
4561

result:

wrong answer incorrect solution