# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
331726 |
2020-11-29T18:51:48 Z |
anishrajeev |
Utrka (COCI14_utrka) |
Java 11 |
|
537 ms |
26752 KB |
import java.io.*;
import java.util.HashMap;
public class utrka {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//BufferedReader bf = new BufferedReader(new FileReader("tester.in"));
PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
int N = Integer.parseInt(bf.readLine());
HashMap<String, Integer> names = new HashMap<>();
for(int i = 0; i < N; i++){
String name = bf.readLine();
if(names.containsKey(name))names.put(name, names.get(name)+1);
else names.put(name, 1);
}
for(int i = 0; i < N-1; i++){
String name = bf.readLine();
names.replace(name, names.get(name)-1);
}
for(String s:names.keySet()){
if(names.get(s)!=0)System.out.println(s);
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
74 ms |
8804 KB |
Output is correct |
2 |
Correct |
73 ms |
8544 KB |
Output is correct |
3 |
Correct |
105 ms |
10260 KB |
Output is correct |
4 |
Correct |
190 ms |
12112 KB |
Output is correct |
5 |
Correct |
165 ms |
11944 KB |
Output is correct |
6 |
Correct |
390 ms |
19552 KB |
Output is correct |
7 |
Correct |
468 ms |
23588 KB |
Output is correct |
8 |
Correct |
464 ms |
25968 KB |
Output is correct |
9 |
Correct |
537 ms |
26752 KB |
Output is correct |
10 |
Correct |
516 ms |
26752 KB |
Output is correct |