QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#545789#9136. Exponent Calculatorpengpeng_fudan#AC ✓0ms3876kbC++20824b2024-09-03 17:16:582024-09-03 17:16:58

Judging History

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

  • [2024-09-03 17:16:58]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3876kb
  • [2024-09-03 17:16:58]
  • 提交

answer

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

#define endl '\n'
void solve(void) {
    int n = 4, k = 2048;
    cout << 25 << endl;
    cout << "$0 = $1 * " << fixed << 1. / k << endl;
    for (int i = 1; i <= n; i++) cout << "$" << i << " = $0 * $" << i - 1 << endl;
    for (int i = 1; i <= n; i++) {
        double frac = 1;
        for (int j = 1; j <= i + 1; j++) frac /= j;
        cout << "$" << i << " = $" << i << " * " << fixed << frac << endl;
    }
    cout << "$0 = $0 + 1" << endl; 
    for (int i = 1; i <= n; i++) cout << "$0 = $0 + $" << i << endl;
    for (int i = 2; i <= k; i *= 2) cout << "$0 = $0 * $0" << endl;
    return;
}

int main() {
    //ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);

    cout << setprecision(15);
    solve();

    return 0;
}

详细

Test #1:

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

input:

input

output:

25
$0 = $1 * 0.000488281250000
$1 = $0 * $0
$2 = $0 * $1
$3 = $0 * $2
$4 = $0 * $3
$1 = $1 * 0.500000000000000
$2 = $2 * 0.166666666666667
$3 = $3 * 0.041666666666667
$4 = $4 * 0.008333333333333
$0 = $0 + 1
$0 = $0 + $1
$0 = $0 + $2
$0 = $0 + $3
$0 = $0 + $4
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0...

result:

ok max relative diff is 3.42876e-12. Checker runtime is 186 ms

Extra Test:

score: 0
Extra Test Passed