-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathJava.java
41 lines (34 loc) · 1.25 KB
/
Java.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/****************************************/
/* */
/* CodinGame.com Solutions by pathosDev */
/* */
/* Puzzle: Bank Robbers */
/* Difficulty: Easy */
/* Date solved: 22.02.2019 */
/* */
/****************************************/
import java.util.Arrays;
import java.util.Scanner;
public class Solution
{
public static void main(String[] args)
{
//Read inputs.
Scanner scanner = new Scanner(System.in);
int R = Integer.parseInt(scanner.nextLine());
int V = Integer.parseInt(scanner.nextLine());
//List of times for each robber.
int[] T = new int[R];
for (int i = 0; i < V; i++)
{
String[] line = scanner.nextLine().split(" ");
int C = Integer.parseInt(line[0]);
int N = Integer.parseInt(line[1]);
//Add vault time to the robber that has "nothing to do".
T[0] += (int)(Math.pow(10, N) * Math.pow(5, C - N));
Arrays.sort(T);
}
//Print time of the robber with the most time.
System.out.println(T[R - 1]);
}
}