Submission #1481806
Source Code Expand
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int t_pre = 1, a_pre = 1; for(int i=0; i<n; i++){ String[] str = br.readLine().split(" "); int t = Integer.parseInt(str[0]); int a = Integer.parseInt(str[1]); int rate = (int)Math.ceil(Math.max((double)t_pre/t, (double)a_pre/a)); t_pre = rate * t; a_pre = rate * a; } System.out.println(t_pre + a_pre); } }
Submission Info
Submission Time | |
---|---|
Task | C - AtCoDeer and Election Report |
User | kengo0o0 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 750 Byte |
Status | WA |
Exec Time | 107 ms |
Memory | 22340 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 68 ms | 18388 KB |
0_001.txt | AC | 68 ms | 21076 KB |
0_002.txt | AC | 68 ms | 16980 KB |
1_003.txt | AC | 73 ms | 21076 KB |
1_004.txt | AC | 85 ms | 22340 KB |
1_005.txt | WA | 85 ms | 17620 KB |
1_006.txt | WA | 91 ms | 19652 KB |
1_007.txt | WA | 73 ms | 20820 KB |
1_008.txt | WA | 70 ms | 20692 KB |
1_009.txt | WA | 70 ms | 17876 KB |
1_010.txt | WA | 69 ms | 21332 KB |
1_011.txt | WA | 68 ms | 18004 KB |
1_012.txt | WA | 70 ms | 19028 KB |
1_013.txt | WA | 107 ms | 22068 KB |
1_014.txt | AC | 84 ms | 19892 KB |