QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#494392 | #9136. Exponent Calculator | ucup-team266# | AC ✓ | 0ms | 3872kb | C++23 | 1.8kb | 2024-07-27 15:36:12 | 2024-07-27 15:36:14 |
Judging History
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