Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
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 29 30 31
Archives
Today
Total
관리 메뉴

게임 개발 메모장

5. 모두의 약수 본문

문제 해결력 훈련

5. 모두의 약수

Dev_Moses 2024. 1. 8. 15:58

 

#include <iostream>

using namespace std;

int main()
{
	int n;
	cin >> n;
	
	int Result[50001] = {0,};

	for (int i = 1; i <= n; ++i)
	{	
		for (int j = i; j <= n; j = j + i)
		{
			Result[j]++;
		}
	}

	for (int idx = 1; idx <= n; ++idx)
	{
		cout << Result[idx] << " ";
	}
}

'문제 해결력 훈련' 카테고리의 다른 글

7. 숫자의 총 개수  (0) 2024.01.08
6. 자릿수의 합  (1) 2024.01.08
4. 영어 단어 복구  (0) 2024.01.08
3. 숫자만 추출  (2) 2024.01.08
2. 나이 계산  (0) 2024.01.07