QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#496617 | #9136. Exponent Calculator | jiangly | WA | 1ms | 3916kb | C++20 | 1.1kb | 2024-07-28 13:52:25 | 2024-07-28 13:52:25 |
Judging History
answer
#include <bits/stdc++.h>
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
constexpr int T = 7;
constexpr int B = 10;
std::cout << std::fixed << std::setprecision(20);
// $1 = x
double x = -20.0;
std::cerr << std::exp(x) << "\n";
x = x / (1 << B);
std::cout << 2 * T + 1 + B << "\n";
std::cout << "$1 = $1 * " << 1.0 / (1 << B) << "\n";
double fac[T + 1];
fac[0] = 1;
for (int i = 1; i <= T; i++) {
fac[i] = fac[i - 1] * i;
}
// $0 = ex
double ex = x / fac[T];
std::cout << "$0 = $1 * " << 1 / fac[T] << "\n";
for (int i = T - 1; i >= 1; i--) {
ex = ex + 1 / fac[i];
std::cout << "$0 = $0 + " << 1 / fac[i] << "\n";
ex = ex * x;
std::cout << "$0 = $0 * $1\n";
}
ex = ex + 1.0;
std::cout << "$0 = $0 * " << 1.0 << "\n";
for (int i = 0; i < B; i++) {
std::cout << "$0 = $0 * $0\n";
ex = ex * ex;
}
std::cerr << ex << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3916kb
input:
input
output:
25 $1 = $1 * 0.00097656250000000000 $0 = $1 * 0.00019841269841269841 $0 = $0 + 0.00138888888888888894 $0 = $0 * $1 $0 = $0 + 0.00833333333333333322 $0 = $0 * $1 $0 = $0 + 0.04166666666666666435 $0 = $0 * $1 $0 = $0 + 0.16666666666666665741 $0 = $0 * $1 $0 = $0 + 0.50000000000000000000 $0 = $0 * $1 $...
result:
wrong answer x=-20,jury=2.06115e-09,participant=0,error=1