-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJCPC2017C.java
More file actions
42 lines (39 loc) · 1.33 KB
/
Copy pathJCPC2017C.java
File metadata and controls
42 lines (39 loc) · 1.33 KB
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
42
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.StringTokenizer;
/**
*
* @author rn-sshawish
*/
public class JCPC2017C {
public static void main(String[] args)throws Exception {
BufferedReader input = new BufferedReader(new FileReader("scoreboard.in"));
int n = Integer.parseInt(input.readLine());
StringTokenizer tokn ;
boolean [] state = null ;
for (int i = 0; i < n; i++) {
state = new boolean[13];
int solvedProblem = Integer.parseInt(input.readLine());
String words = input.readLine();
for (int j = 0; j < solvedProblem; j++) {
state[words.charAt(j) - 'A'] = true;
}
int max = Integer.MIN_VALUE;
char problem = ' ';
tokn = new StringTokenizer(input.readLine());
for (int j = 0; j < 13; j++) {
int value = Integer.parseInt(tokn.nextToken());
if (!state[j] && value > max) {
max = value;
problem = (char)('A' + j);
}
}
System.out.println(problem);
}
}
}