Algorithm/백준
백준 3052번: 나머지
hmhmchm
2021. 8. 31. 12:10
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Baekjoon_나머지 {
static int N;
static int res;
static int arr[];
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
arr = new int[42];
for (int tc = 0; tc < 10; tc++) {
N = Integer.parseInt(in.readLine());
res = N % 42;
arr[res] = 1;
}
int cnt = 0;
for (int i = 0; i < arr.length; i++) {
if(arr[i] == 1) {
cnt ++;
}
}
System.out.println(cnt);
}
}
728x90