Submission #19852531
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
double p;
const ll MAXA = 1LL << 50;
double f(double x)
{
return x + p / pow(2.0, x / 1.5);
}
int main()
{
cin >> p;
double lo = 0;
double hi = p;
while (hi - lo > 0.00000001){
double t1 = (2*lo + hi) / 3;
double t2 = (lo + 2*hi) / 3;
if (f(t1) >= f(t2)){
lo = t1;
} else {
hi = t2;
}
}
cout << fixed << setprecision(10) << f((lo+hi)/2) << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - ムーアの法則 |
| User | unnohideyuki |
| Language | C++ (GCC 9.2.1) |
| Score | 100 |
| Code Size | 508 Byte |
| Status | AC |
| Exec Time | 10 ms |
| Memory | 4176 KiB |
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 | 10 ms | 3960 KiB |
| 02.txt | AC | 3 ms | 4016 KiB |
| 03.txt | AC | 2 ms | 3924 KiB |
| 04.txt | AC | 3 ms | 4036 KiB |
| 05.txt | AC | 3 ms | 3992 KiB |
| 06.txt | AC | 3 ms | 4096 KiB |
| 07.txt | AC | 2 ms | 4176 KiB |
| 08.txt | AC | 2 ms | 4036 KiB |
| 09.txt | AC | 2 ms | 3976 KiB |
| 10.txt | AC | 2 ms | 3996 KiB |
| 11.txt | AC | 2 ms | 4172 KiB |
| 12.txt | AC | 2 ms | 3980 KiB |
| 13.txt | AC | 2 ms | 4172 KiB |
| 14.txt | AC | 2 ms | 4092 KiB |
| 15.txt | AC | 2 ms | 4092 KiB |
| 16.txt | AC | 2 ms | 4072 KiB |
| 17.txt | AC | 2 ms | 4068 KiB |
| 18.txt | AC | 3 ms | 4068 KiB |
| 19.txt | AC | 5 ms | 4176 KiB |
| 20.txt | AC | 2 ms | 4048 KiB |
| 21.txt | AC | 3 ms | 4056 KiB |
| 22.txt | AC | 2 ms | 4072 KiB |
| 23.txt | AC | 2 ms | 4096 KiB |
| 24.txt | AC | 2 ms | 4152 KiB |
| 25.txt | AC | 2 ms | 4076 KiB |
| sample_01.txt | AC | 2 ms | 4176 KiB |
| sample_02.txt | AC | 2 ms | 3920 KiB |
| sample_03.txt | AC | 2 ms | 4124 KiB |