QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#496392#9136. Exponent Calculatorucup-team1231#AC ✓0ms3800kbC++14598b2024-07-28 08:11:202024-07-28 08:11:21

Judging History

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

  • [2024-07-28 08:11:21]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3800kb
  • [2024-07-28 08:11:20]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

double ifac(int x) {
    double ret = 1;
    for(int i = 1; i <= x; i++) ret *= i;
    return 1.0 / ret;
}

int main() {
    printf("25\n");
    const int T = 7, M = 10;
    printf("$1 = $1 * %.14lf\n", 1.0 / 1024.0);
    printf("$2 = $1 * %.14lf\n", ifac(T));
    for(int i = T - 1; i >= 1; i--) {
        printf("$2 = $2 + %.14lf\n", ifac(i));
        printf("$2 = $1 * $2\n");
    }
    printf("$2 = $2 + %.14lf\n", 1.0);
    printf("$0 = $2 * $2\n");

    for(int i = 1; i < M; i++) printf("$0 = $0 * $0\n");
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3800kb

input:

input

output:

25
$1 = $1 * 0.00097656250000
$2 = $1 * 0.00019841269841
$2 = $2 + 0.00138888888889
$2 = $1 * $2
$2 = $2 + 0.00833333333333
$2 = $1 * $2
$2 = $2 + 0.04166666666667
$2 = $1 * $2
$2 = $2 + 0.16666666666667
$2 = $1 * $2
$2 = $2 + 0.50000000000000
$2 = $1 * $2
$2 = $2 + 1.00000000000000
$2 = $1 * $2
$2 ...

result:

ok max relative diff is 2.11491e-13. Checker runtime is 188 ms

Extra Test:

score: 0
Extra Test Passed