QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#494392#9136. Exponent Calculatorucup-team266#AC ✓0ms3872kbC++231.8kb2024-07-27 15:36:122024-07-27 15:36:14

Judging History

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

  • [2024-07-27 15:36:14]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3872kb
  • [2024-07-27 15:36:12]
  • 提交

answer

/*
Things to notice:
1. do not calculate useless values
2. do not use similar names
 
Things to check:
1. submit the correct file
2. time (it is log^2 or log)
3. memory
4. prove your naive thoughts 
5. long long
6. corner case like n=0,1,inf or n=m
7. check if there is a mistake in the ds or other tools you use
8. fileio in some oi-contest

9. module on time 
10. the number of a same divisor in a math problem
11. multi-information and queries for dp and ds problems
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fi first
#define se second
#define pii pair<long long,long long>
#define mp make_pair
#define pb push_back
const int mod=998244353;
const int inf=0x3f3f3f3f;
const int INF=1e18;
const int B=(1LL<<19); 
double R[105];
void solve()
{
//	cin>>R[1];
	cout<<"25\n";
	cout<<fixed<<setprecision(20)<<"$1 = $1 * "<<1.0/8192.0<<"\n";
	R[1]=R[1]*1.0/8192.0;
	cout<<"$0 = $1 + 1.0\n";
	R[0]=R[1]+1.0;
	cout<<"$2 = $1 + 0.0\n";
	R[2]=R[1];
	double fac=1;
	for(int i=2;i<=4;i++)
	{
		fac/=(double)(i);
		cout<<"$2 = $2 * $1"<<"\n";
		R[2]=R[2]*R[1];
		cout<<fixed<<setprecision(20)<<"$2 = $2 * "<<1.0/(double)(i)<<"\n";
		R[2]=R[2]*1.0/(double)(i);
		cout<<"$0 = $0 + $2\n";
		R[0]=R[0]+R[2];
	}
	for(int i=1;i<=13;i++) cout<<"$0 = $0 * $0\n",R[0]=R[0]*R[0];
//	cout<<fixed<<setprecision(20)<<R[0]<<"\n"; 
//	for(int i)
//	double x;
//	cin>>x;
//	x/=8192.0;
//	double r=1.0;
//	double res=1.0;
//	for(int iter=1;iter<=4;iter++) res/=(double)(iter),res*=(double)(x),r+=res;
//	for(int iter=0;iter<13;iter++) r*=r;
//	cout<<fixed<<setprecision(12)<<r<<"\n";
}
signed main()
{
//	ios::sync_with_stdio(0);
//	cin.tie(0);
	int _=1;
//	cin>>_;
	while(_--) solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

input

output:

25
$1 = $1 * 0.00012207031250000000
$0 = $1 + 1.0
$2 = $1 + 0.0
$2 = $2 * $1
$2 = $2 * 0.50000000000000000000
$0 = $0 + $2
$2 = $2 * $1
$2 = $2 * 0.33333333333333333334
$0 = $0 + $2
$2 = $2 * $1
$2 = $2 * 0.25000000000000000000
$0 = $0 + $2
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0 * $0
$0 = $0...

result:

ok max relative diff is 9.43613e-12. Checker runtime is 194 ms

Extra Test:

score: 0
Extra Test Passed