Submission #736826


Source Code Expand

import java.io.*;
public class Main{
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args) throws IOException{
		double P = new Double(br.readLine());
		double left = 0, right = 100, x = 0;
		double e = 0.0001;
		
		for (int i = 0; i  < 1000; i++){
			x = (left+right)/2;
			//System.out.println(x);
			
			double t1 = P/(Math.pow(2, (x+e)/1.5)) + x+e;
			double t2 = P/(Math.pow(2, (x-e)/1.5)) + x-e;

			double grad = (t1 - t2)/(2*e);
			if (grad > 0){
				right = x;
			}else{
				left = x;
			}
		}
		
		System.out.println(Math.min(P, P/(Math.pow(2, (x)/1.5)) + x));
	}

}

Submission Info

Submission Time
Task B - ムーアの法則
User haqishen
Language Java7 (OpenJDK 1.7.0)
Score 100
Code Size 672 Byte
Status AC
Exec Time 179 ms
Memory 7764 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 25
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 AC 175 ms 7764 KiB
02.txt AC 171 ms 7632 KiB
03.txt AC 167 ms 7636 KiB
04.txt AC 171 ms 7764 KiB
05.txt AC 179 ms 7764 KiB
06.txt AC 167 ms 7764 KiB
07.txt AC 170 ms 7760 KiB
08.txt AC 163 ms 7764 KiB
09.txt AC 171 ms 7636 KiB
10.txt AC 175 ms 7764 KiB
11.txt AC 171 ms 7636 KiB
12.txt AC 171 ms 7764 KiB
13.txt AC 175 ms 7764 KiB
14.txt AC 167 ms 7764 KiB
15.txt AC 163 ms 7764 KiB
16.txt AC 167 ms 7636 KiB
17.txt AC 167 ms 7636 KiB
18.txt AC 171 ms 7636 KiB
19.txt AC 171 ms 7764 KiB
20.txt AC 171 ms 7636 KiB
21.txt AC 167 ms 7764 KiB
22.txt AC 163 ms 7764 KiB
23.txt AC 171 ms 7632 KiB
24.txt AC 167 ms 7636 KiB
25.txt AC 167 ms 7636 KiB
sample_01.txt AC 162 ms 7764 KiB
sample_02.txt AC 167 ms 7636 KiB
sample_03.txt AC 164 ms 7764 KiB