Notice
Recent Posts
Recent Comments
Link
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Tags
more
Archives
Today
Total
관리 메뉴

main

[백준 - 3052번] 나머지 본문

Algorithm

[백준 - 3052번] 나머지

1984 2022. 1. 23. 00:04
  • set 기본 사용법
  • set 중복허용 하지 않고 자동 정렬된다.

 

#include <iostream>
#include <set>

using namespace std;

int main(void)
{
	int num;

	set<int> s;

	for (int i = 0; i < 10; i++)
	{
		cin >> num;
		s.insert(num %42);
	}
	cout << s.size();

}

 

[참고 자료]

https://codediver.tistory.com/49

728x90
Comments