Submission #7209763
Source Code Expand
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
template<class S, class T> inline S max_L(S a,T b){
return a>=b?a:b;
}
inline void rd(double &x){
scanf("%lf",&x);
}
inline void wt_L(char a){
putchar_unlocked(a);
}
inline void wt_L(double x){
printf("%.15f",x);
}
int main(){
double P, res, x;
rd(P);
x =max_L(0.0, 1.5 * log(P / 1.5 * log(2.0)) / log(2.0));
res = x + pow(2, -x/1.5) * P;
wt_L(res);
wt_L('\n');
return 0;
}
// cLay varsion 20190830-1
// --- original code ---
// {
// double P, x, res;
// rd(P);
// x = max(0.0, 1.5 * log(P / 1.5 * log(2.0)) / log(2.0));
// res = x + pow(2, -x/1.5) * P;
// wt(res);
// }
Submission Info
| Submission Time | |
|---|---|
| Task | B - ムーアの法則 |
| User | LayCurse |
| Language | C++14 (GCC 5.4.1) |
| Score | 100 |
| Code Size | 714 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 256 KiB |
Compile Error
./Main.cpp: In function ‘void rd(double&)’:
./Main.cpp:8:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lf",&x);
^
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, sample_01.txt, sample_02.txt, sample_03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 1 ms | 256 KiB |
| 02.txt | AC | 1 ms | 256 KiB |
| 03.txt | AC | 1 ms | 256 KiB |
| 04.txt | AC | 1 ms | 256 KiB |
| 05.txt | AC | 1 ms | 256 KiB |
| 06.txt | AC | 1 ms | 256 KiB |
| 07.txt | AC | 1 ms | 256 KiB |
| 08.txt | AC | 1 ms | 256 KiB |
| 09.txt | AC | 1 ms | 256 KiB |
| 10.txt | AC | 1 ms | 256 KiB |
| 11.txt | AC | 1 ms | 256 KiB |
| 12.txt | AC | 1 ms | 256 KiB |
| 13.txt | AC | 1 ms | 256 KiB |
| 14.txt | AC | 1 ms | 256 KiB |
| 15.txt | AC | 1 ms | 256 KiB |
| 16.txt | AC | 1 ms | 256 KiB |
| 17.txt | AC | 1 ms | 256 KiB |
| 18.txt | AC | 1 ms | 256 KiB |
| 19.txt | AC | 1 ms | 256 KiB |
| 20.txt | AC | 1 ms | 256 KiB |
| 21.txt | AC | 1 ms | 256 KiB |
| 22.txt | AC | 1 ms | 256 KiB |
| 23.txt | AC | 1 ms | 256 KiB |
| 24.txt | AC | 1 ms | 256 KiB |
| 25.txt | AC | 1 ms | 256 KiB |
| sample_01.txt | AC | 1 ms | 256 KiB |
| sample_02.txt | AC | 1 ms | 256 KiB |
| sample_03.txt | AC | 1 ms | 256 KiB |