-
Notifications
You must be signed in to change notification settings - Fork 3
/
CCC08S1.java
36 lines (35 loc) · 1.07 KB
/
CCC08S1.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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
/**
* CCC '08 S1 - It's Cold Here!
* Question type: Implementation
* 3/3 on DMOJ
* @author Tommy Pang
*/
public class CCC08S1 {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer st;
public static void main(String[] args) throws IOException{
int temperature = 201;
String ans = "";
while (true){
st = new StringTokenizer(br.readLine());
String s = st.nextToken();
String s2 = st.nextToken();
if (s2.contains("-")) {
int v = Integer.parseInt((s2.split("-"))[1]);
if (-1 * v < temperature) {
temperature = -1 * v;
ans = s;
}
}
if (s.equals("Waterloo")){
System.out.println(ans);
return;
}
}
}
}