QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#496611#9136. Exponent CalculatorjianglyWA 0ms3820kbC++201.1kb2024-07-28 13:50:492024-07-28 13:50:49

Judging History

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

  • [2024-07-28 13:50:49]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3820kb
  • [2024-07-28 13:50:49]
  • 提交

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(12);
    
    // $1 = x
    double x = 20.0;
    // std::cout << 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::cout << ex << "\n";
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3820kb

input:

input

output:

25
$1 = $1 * 0.000976562500
$0 = $1 * 0.000198412698
$0 = $0 + 0.001388888889
$0 = $0 * $1
$0 = $0 + 0.008333333333
$0 = $0 * $1
$0 = $0 + 0.041666666667
$0 = $0 * $1
$0 = $0 + 0.166666666667
$0 = $0 * $1
$0 = $0 + 0.500000000000
$0 = $0 * $1
$0 = $0 + 1.000000000000
$0 = $0 * $1
$0 = $0 * 1.0000000...

result:

wrong answer x=-20,jury=2.06115e-09,participant=0,error=1