n명의 사람이 m개의 메세지를 보냈다
누가 보낸 메세지를 몇명이 안읽었는지 m개가 나와있고
p번째 메세지를 안 읽은 사람을 출력
단 사람은 1번부터 A, B, C, D,,,,
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int p = sc.nextInt();
sc.nextLine();
int[] lst = new int[26];
char[] how = new char[100];
for (int i = 0; i < m; i++){
String tmp = sc.nextLine().trim();
lst[(int)(tmp.charAt(0) - 'A')] = Integer.parseInt(tmp.substring(2));
how[i] = tmp.charAt(0);
}
if (lst[(int)(how[p - 1] - 'A')] == 0){
System.out.print("");
return ;
}
int[] read = new int[n];
for (int i = 0 ; i < p - 1; i++){
if (lst[(int)(how[i] - 'A')] == lst[(int)(how[p - 1] - 'A')]){
read[(int)(how[i] - 'A')]++;
}
}
for (int i = p - 1; i < m; i++)
read[(int)(how[i] - 'A')]++;
for (int i = 0; i < n; i++){
if (read[i] == 0){
char tmp = (char)('A' + i);
System.out.print(tmp + " ");
}
}
}
}
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int p = sc.nextInt();
sc.nextLine();
String[] lst = new String[m];
for (int i = 0; i < m; i++)
lst[i] = sc.nextLine().trim();
int[] read = new int[26];
int p_person = Integer.parseInt(lst[p - 1].substring(2));
for (int i = 0; i < p - 1; i++){
if (Integer.parseInt(lst[i].substring(2)) == p_person)
read[(int)(lst[i].charAt(0) - 'A')]++;
}
for (int i = p - 1; i < m; i++)
read[(int)(lst[i].charAt(0) - 'A')]++;
for (int i = 0; i < n; i++){
if (p_person == 0){
System.out.print("");
break;
}
if (read[i] == 0)
System.out.print((char)('A' + i) + " ");
}
}
}
A 0 식으로 들어오기 때문에 String으로 받아줌