QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#658579#9136. Exponent CalculatorArgharizaAC ✓0ms3844kbC++171.1kb2024-10-19 17:04:482024-10-19 17:04:49

Judging History

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

  • [2024-10-19 17:04:49]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3844kb
  • [2024-10-19 17:04:48]
  • 提交

answer

#include <bits/stdc++.h>
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define F(i, x, y) for (int i = (x); i <= (y); i++)
#define R(i, x, y) for (int i = (x); i >= (y); i--)
#define FIO(FILE) freopen(FILE".in", "r", stdin), freopen(FILE".out", "w", stdout)

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
bool Mbe;

const int N = 10;
double fc[N];

void solve() {
	double x; cin >> x;
	// x = x / 1024;
	printf("25\n");
	printf("$1 = $1 * 0.0009765625\n");
	fc[0] = 1;
	F (i, 1, 7) fc[i] = fc[i - 1] / i;
	// printf("$0 = %.14lf\n", fc[7]);
	// double y = fc[7];
	R (i, 6, 0) {
		// y = y * x + fc[i];
		if (i != 6) printf("$0 = $0 * $1\n");
		else printf("$0 = %.14lf * $1\n", fc[7]);
		printf("$0 = $0 + %.14lf\n", fc[i]);
	}
	F (i, 0, 9) {
		// y = y * y;
		printf("$0 = $0 * $0\n");
	}
	// out(y);
}

bool Med;
int main() {
	// FIO("");
	// ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cerr << (&Mbe - &Med) / 1048576.0 << " MB\n";
	int T = 1;
	// cin >> T;
	while (T--) solve();
	cerr << (int)(1e3 * clock() / CLOCKS_PER_SEC) << " ms\n";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

input

output:

25
$1 = $1 * 0.0009765625
$0 = 0.00019841269841 * $1
$0 = $0 + 0.00138888888889
$0 = $0 * $1
$0 = $0 + 0.00833333333333
$0 = $0 * $1
$0 = $0 + 0.04166666666667
$0 = $0 * $1
$0 = $0 + 0.16666666666667
$0 = $0 * $1
$0 = $0 + 0.50000000000000
$0 = $0 * $1
$0 = $0 + 1.00000000000000
$0 = $0 * $1
$0 = $0...

result:

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

Extra Test:

score: 0
Extra Test Passed