QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#496802#9136. Exponent Calculatorucup-team4361#WA 0ms3964kbC++141.9kb2024-07-28 16:10:352024-07-28 16:10:35

Judging History

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

  • [2024-07-28 16:10:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3964kb
  • [2024-07-28 16:10:35]
  • 提交

answer

#include <bits/stdc++.h>

#define LL long long
#define ull unsigned long long
#define F(i, j, k) for (int i = j; i <= k; ++i)
#define DF(i, j, k) for (int i = j; i >= k; --i)

using namespace std;

template <typename T> inline void read(T &n) {
    T w = 1;
    n = 0;
    char ch = getchar();
    while (!isdigit(ch) && ch != EOF) {
        if (ch == '-') w = -1;
        ch = getchar();
    }
    while (isdigit(ch) && ch != EOF) {
        n = (n << 3) + (n << 1) + (ch & 15);
        ch = getchar();
    }
    n *= w;
}

template <typename T> inline void write(T x) {
    T l = 0;
    ull y = 0;
    if (!x) { putchar(48); return; }
    if (x < 0) { x = -x; putchar('-'); }
    while (x) { y = y * 10 + x % 10; x /= 10; ++l; }
    while (l) { putchar(y % 10 + 48); y /= 10; --l; }
}

template <typename T> inline void writes(T x) {
    write(x);
    putchar(' ');
}

template <typename T> inline void writeln(T x) {
    write(x);
    puts("");
}

template <typename T> inline void checkmax(T &a, T b) { a = a > b ? a : b; }

template <typename T> inline void checkmin(T &a, T b) { a = a < b ? a : b; }

int main() {
    //freopen(".in", "r", stdin);
    //freopen(".out", "w", stdout);
    cout << 25 << '\n';
    double x = 1;
    F(i, 1, 17) x = x * 0.5;
    cout << fixed << setprecision(17) << "$1 = $1 * " << x << '\n';
    cout << "$2 = $1 * $1\n";
    cout << "$2 = $2 * 0.5\n";
    cout << "$3 = $2 * $1\n";
    cout << "$3 = $3 * " << fixed << setprecision(17) << 1.0 / 6 << '\n';
    double now = pow(x * 20, 3) * 1.0 / 6 + x * 20 * x * 10 + x * 20.0 + 1;

    cout << "$0 = $1 + 1\n";
    cout << "$0 = $0 + $2\n";
    cout << "$0 = $0 + $3\n";
    F(i, 1, 17) {
        cout << "$0 = $0 * $0\n";
        now *= now;
    }
    //cout << fixed << setprecision(20) << now << ' ' << exp(20) << '\n';
    //cout << fixed << setprecision(20) << fabs(now - exp(20)) / exp(20) << '\n';
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

input

output:

25
$1 = $1 * 0.00000762939453125
$2 = $1 * $1
$2 = $2 * 0.5
$3 = $2 * $1
$3 = $3 * 0.16666666666666666
$0 = $1 + 1
$0 = $0 + $2
$0 = $0 + $3
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 ...

result:

wrong answer x=-20,jury=2.06115e-09,participant=2.06115e-09,error=3.88023e-08