Home B3052. 나머지
Post
Cancel

B3052. 나머지

문제

image

제출 코드

image

  • 사용 알고리즘 : 구현
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package bronze;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class B3052_remain {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		Set set = new HashSet<>();
		for(int i=0; i<10; i++) {
			set.add(sc.nextInt()%42);
		}
		System.out.println(set.size());
	}

}
This post is licensed under CC BY 4.0 by the author.