Submission #937510
Source Code Expand
import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; import java.util.function.BiFunction; public class Main { Scanner sc = new Scanner(System.in); public static void main(String[] args) { new Main().run(); } double f(double x) { return x + p / Math.pow(2.0, x / 1.5); } double findX() { return (3 * Math.log(p * Math.log(2) / 1.5)) / Math.log(4); } double p; void run() { p = sc.nextDouble(); double x = findX(); System.out.println(x >= 0 ? f(x) : p); } int ni() { return Integer.parseInt(sc.next()); } void debug(Object... os) { System.err.println(Arrays.deepToString(os)); } class BIT<T> { int n; ArrayList<T> bit; BiFunction<T, T, T> bif; BIT(int n, BiFunction<T, T, T> bif, T defaultValue) { this.n = n; bit = new ArrayList<>(n + 1); for (int i = 0; i < n + 1; ++i) { bit.add(defaultValue); } this.bif = bif; } void update(int i, T v) { for (int x = i; x <= n; x += x & -x) { bit.set(x, bif.apply(bit.get(x), v)); } } T reduce(int i, T defaultValue) { T ret = defaultValue; for (int x = i; x > 0; x -= x & -x) { ret = bif.apply(ret, bit.get(x)); } return ret; } } long MOD = 1_000_000_007; long pow(long a, long r) { long sum = 1; while (r > 0) { if ((r & 1) == 1) { sum *= a; sum %= MOD; } a *= a; a %= MOD; r >>= 1; } return sum; } long C(int n, int r) { long sum = 1; for (int i = n; 0 < i; --i) { sum *= i; sum %= MOD; } long s = 1; for (int i = r; 0 < i; --i) { s *= i; s %= MOD; } sum *= pow(s, MOD - 2); sum %= MOD; long t = 1; for (int i = n - r; 0 < i; --i) { t *= i; t %= MOD; } sum *= pow(t, MOD - 2); sum %= MOD; return sum; } }
Submission Info
Submission Time | |
---|---|
Task | B - ムーアの法則 |
User | arukuka |
Language | Java8 (OpenJDK 1.8.0) |
Score | 100 |
Code Size | 2047 Byte |
Status | AC |
Exec Time | 149 ms |
Memory | 11348 KB |
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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 139 ms | 11344 KB |
02.txt | AC | 148 ms | 11340 KB |
03.txt | AC | 146 ms | 10704 KB |
04.txt | AC | 134 ms | 11336 KB |
05.txt | AC | 149 ms | 11344 KB |
06.txt | AC | 134 ms | 11340 KB |
07.txt | AC | 134 ms | 11212 KB |
08.txt | AC | 135 ms | 11344 KB |
09.txt | AC | 145 ms | 11348 KB |
10.txt | AC | 145 ms | 10572 KB |
11.txt | AC | 140 ms | 11340 KB |
12.txt | AC | 148 ms | 10376 KB |
13.txt | AC | 148 ms | 10704 KB |
14.txt | AC | 135 ms | 11340 KB |
15.txt | AC | 137 ms | 11340 KB |
16.txt | AC | 136 ms | 11216 KB |
17.txt | AC | 139 ms | 10692 KB |
18.txt | AC | 136 ms | 10576 KB |
19.txt | AC | 147 ms | 11348 KB |
20.txt | AC | 134 ms | 11340 KB |
21.txt | AC | 137 ms | 11344 KB |
22.txt | AC | 139 ms | 11220 KB |
23.txt | AC | 149 ms | 11344 KB |
24.txt | AC | 136 ms | 11340 KB |
25.txt | AC | 145 ms | 11348 KB |
sample_01.txt | AC | 147 ms | 11216 KB |
sample_02.txt | AC | 148 ms | 11216 KB |
sample_03.txt | AC | 147 ms | 11344 KB |