Submission #737418
Source Code Expand
#include <iostream>
#include <math.h>
using namespace std;
long double P;
long double cal_x(){
return -1.5 * (log2(3 / (P * log(2))) - 1);
}
long double cal_time(long double x){
return x + P / pow((long double)2, x / 1.5);
}
void solve(){
cin >> P;
// time(x) = x + P / 2^(x / 1.5)
// time'(x) = -1.5 * log2(3 / (2 * P * log(2)))
long double x;
long double time;
x = cal_x();
if(x <= 0)
time = P;
else
time = cal_time(x);
cout << time << endl;
}
int main(){
solve();
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - ムーアの法則 |
| User | mizdra |
| Language | C++14 (GCC 5.4.1) |
| Score | 0 |
| Code Size | 540 Byte |
| Status | WA |
| Exec Time | 6 ms |
| Memory | 256 KiB |
Judge Result
| Set Name | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 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 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | WA | 4 ms | 256 KiB |
| 02.txt | AC | 4 ms | 256 KiB |
| 03.txt | AC | 4 ms | 256 KiB |
| 04.txt | AC | 6 ms | 256 KiB |
| 05.txt | AC | 4 ms | 256 KiB |
| 06.txt | AC | 4 ms | 256 KiB |
| 07.txt | WA | 4 ms | 256 KiB |
| 08.txt | AC | 4 ms | 256 KiB |
| 09.txt | AC | 4 ms | 256 KiB |
| 10.txt | AC | 4 ms | 256 KiB |
| 11.txt | AC | 4 ms | 256 KiB |
| 12.txt | AC | 4 ms | 256 KiB |
| 13.txt | WA | 5 ms | 256 KiB |
| 14.txt | WA | 4 ms | 256 KiB |
| 15.txt | WA | 4 ms | 256 KiB |
| 16.txt | WA | 4 ms | 256 KiB |
| 17.txt | WA | 4 ms | 256 KiB |
| 18.txt | WA | 4 ms | 256 KiB |
| 19.txt | WA | 5 ms | 256 KiB |
| 20.txt | WA | 4 ms | 256 KiB |
| 21.txt | WA | 4 ms | 256 KiB |
| 22.txt | WA | 4 ms | 256 KiB |
| 23.txt | WA | 4 ms | 256 KiB |
| 24.txt | AC | 5 ms | 256 KiB |
| 25.txt | WA | 5 ms | 256 KiB |
| sample_01.txt | WA | 5 ms | 256 KiB |
| sample_02.txt | AC | 5 ms | 256 KiB |
| sample_03.txt | WA | 4 ms | 256 KiB |