QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#558949 | #9136. Exponent Calculator | ucup-team3691# | AC ✓ | 0ms | 3784kb | C++23 | 1.4kb | 2024-09-11 19:26:07 | 2024-09-11 19:26:10 |
Judging History
answer
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <iomanip>
using namespace std;
using ll = long long;
using ld = long double;
void solve() {
ld x;
cin >> x;
cout << "25\n";
cout << fixed << setprecision(16);
cerr << fixed << setprecision(16);
vector <ld> v(10);
ld coeff = 1;
for (int i = 0; i < 8; i++) {
coeff /= 2;
}
cout << "$1 = $1 * " << coeff << '\n';
x *= coeff;
int start = 6;
ld ans = x / start;
cout << "$0 = $1 * " << (long double) 1/start << '\n';
for (int i = start - 1; i >= 2; i--) {
ans += 1;
ans *= x;
ans /= i;
cout << "$0 = $0 + 1\n";
cout << "$0 = $0 * $1\n";
cout << "$0 = $0 * " << (long double) 1/i << '\n';
}
ans *= x;
ans += x + 1;
cout << "$0 = $0 * $1\n";
cout << "$0 = $0 + $1\n";
cout << "$0 = $0 + 1\n";
for (int i = 0; i < 8; i++) {
ans *= ans;
cout << "$0 = $0 * $0\n";
}
//cerr << ans;
}
int main() {
#ifdef LOCAL
freopen("test.in", "r", stdin);
freopen("test.out", "w", stdout);
#endif // LOCAL
ios_base::sync_with_stdio(false);
cin.tie(0);
int nrt = 1;
//cin >> nrt;
while (nrt--) {
solve();
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3784kb
input:
input
output:
25 $1 = $1 * 0.0039062500000000 $0 = $1 * 0.1666666666666667 $0 = $0 + 1 $0 = $0 * $1 $0 = $0 * 0.2000000000000000 $0 = $0 + 1 $0 = $0 * $1 $0 = $0 * 0.2500000000000000 $0 = $0 + 1 $0 = $0 * $1 $0 = $0 * 0.3333333333333333 $0 = $0 + 1 $0 = $0 * $1 $0 = $0 * 0.5000000000000000 $0 = $0 * $1 $0 = $0 + ...
result:
ok max relative diff is 9.66167e-10. Checker runtime is 235 ms
Extra Test:
score: 0
Extra Test Passed