Submission #1000674
Source Code Expand
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskD solver = new TaskD(); solver.solve(1, in, out); out.close(); } static class TaskD { public void solve(int testNumber, InputReader in, PrintWriter out) { int[] p = in.readIntArray(6); int[] q = in.readIntArray(6); double min = 1.0; for (int i = 0; i < 6; i++) { if (q[i] + p[i] == 0) continue; double frac = 0; for (int j = 0; j < 6; j++) { int g = Math.max(q[i] * p[j], p[i] * q[j]); frac += g; } frac /= 100.0; frac /= (double) (p[i] + q[i]); min = Math.min(min, frac); } out.printf("%.20f\n", min); } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int[] readIntArray(int tokens) { int[] ret = new int[tokens]; for (int i = 0; i < tokens; i++) { ret[i] = nextInt(); } return ret; } public int nextInt() { return Integer.parseInt(next()); } } }
Submission Info
Submission Time | |
---|---|
Task | D - Dice Game |
User | lewin |
Language | Java8 (OpenJDK 1.8.0) |
Score | 1000 |
Code Size | 2455 Byte |
Status | AC |
Exec Time | 112 ms |
Memory | 8912 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 1000 / 1000 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt, 030.txt, 031.txt, 032.txt, 033.txt, 034.txt, 035.txt, 036.txt, 037.txt, 038.txt, example0.txt, example1.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 112 ms | 8780 KB |
001.txt | AC | 105 ms | 8788 KB |
002.txt | AC | 107 ms | 8780 KB |
003.txt | AC | 105 ms | 8912 KB |
004.txt | AC | 106 ms | 8780 KB |
005.txt | AC | 105 ms | 8784 KB |
006.txt | AC | 105 ms | 8784 KB |
007.txt | AC | 106 ms | 8780 KB |
008.txt | AC | 105 ms | 8780 KB |
009.txt | AC | 105 ms | 8788 KB |
010.txt | AC | 107 ms | 8784 KB |
011.txt | AC | 105 ms | 8780 KB |
012.txt | AC | 105 ms | 8784 KB |
013.txt | AC | 105 ms | 8776 KB |
014.txt | AC | 104 ms | 8776 KB |
015.txt | AC | 106 ms | 8784 KB |
016.txt | AC | 105 ms | 8784 KB |
017.txt | AC | 105 ms | 8780 KB |
018.txt | AC | 105 ms | 8784 KB |
019.txt | AC | 105 ms | 8780 KB |
020.txt | AC | 106 ms | 8788 KB |
021.txt | AC | 106 ms | 8784 KB |
022.txt | AC | 106 ms | 8784 KB |
023.txt | AC | 105 ms | 8784 KB |
024.txt | AC | 106 ms | 8780 KB |
025.txt | AC | 108 ms | 8780 KB |
026.txt | AC | 106 ms | 8784 KB |
027.txt | AC | 108 ms | 8908 KB |
028.txt | AC | 106 ms | 8784 KB |
029.txt | AC | 104 ms | 8788 KB |
030.txt | AC | 104 ms | 8784 KB |
031.txt | AC | 104 ms | 8788 KB |
032.txt | AC | 106 ms | 8780 KB |
033.txt | AC | 105 ms | 8784 KB |
034.txt | AC | 106 ms | 8788 KB |
035.txt | AC | 106 ms | 8780 KB |
036.txt | AC | 107 ms | 8784 KB |
037.txt | AC | 107 ms | 8788 KB |
038.txt | AC | 105 ms | 8660 KB |
example0.txt | AC | 104 ms | 8784 KB |
example1.txt | AC | 107 ms | 8784 KB |