반응형
SMALL
문제
문제풀이
using System;
using System.Collections.Generic;
using System.IO;
namespace BOJ2501
{
internal class Program
{
static void Main(string[] args)
{
StreamReader sr = new StreamReader(Console.OpenStandardInput());
StreamWriter sw = new StreamWriter(Console.OpenStandardOutput());
int[] NK = Array.ConvertAll(sr.ReadLine().Split(), int.Parse);
int N = NK[0];
int K = NK[1];
List<int> measureList = new List<int>();
for (int i = 1; i <= N; i++)
{
if (N % i == 0) { measureList.Add(i); }
}
if (measureList.Count < K) { sw.WriteLine(0); }
else
{
int final = measureList[K - 1];
sw.WriteLine(final);
}
sr.Close();
sw.Close();
}
}
}
결과창
반응형
LIST
'Algorithm > BOJ' 카테고리의 다른 글
[BOJ] 7785번 회사에 있는 사람 - 미해결 (0) | 2023.02.12 |
---|---|
[BOJ] 오등큰수 C# 사용 풀이 (복습 대상) (0) | 2023.02.10 |
[BOJ] 통계학 C#사용 풀이 - 미해결 (0) | 2023.02.09 |
[BOJ] 1297번 TV 크기 C# 사용 풀이 (0) | 2023.02.08 |
[BOJ] 2581번 소수 C# 사용 풀이 (0) | 2023.02.06 |