Little Jay

[C++] 백준 3052번 나머지 본문

알고리즘/BOJ

[C++] 백준 3052번 나머지

Jay, Lee 2021. 3. 6. 20:41
#include <iostream>
using namespace std;

int main() {

	const int DIVISOR = 42;
	int arr[42]{ 0 };
	int count = 0;

	int a;
	for (int i = 0; i < 10; i++) {
		cin >> a;
		arr[a % 42]++;
	}

	for (int i : arr) {
		if (i > 0) {
			count++;
		}
	}

	cout << count << "\n";


	return 0;
}

'알고리즘 > BOJ' 카테고리의 다른 글

[C++] 백준 2476번 주사위  (0) 2021.03.06
[C++] 백준 1284번 집 주소  (0) 2021.03.06
[C++] 백준 14656번 조교는 새디스트야!!  (0) 2021.03.06
[C++] 백준 2566번 최댓값  (0) 2021.03.06
[C++] 백준 2511번 카드놀이  (0) 2021.03.06
Comments