Baekjoon 16894
약수 게임


QUESTION ❔



CODE ⌨️

#include <iostream>
#include <cmath>

using namespace std;
typedef long long ll;

ll N, cnt, temp;

void check()
{
	temp = N;

	for (ll i = 2; i <= sqrt(temp) && cnt < 2; i++)
	{
		while (temp % i == 0)
		{
			temp /= i;
			cnt++;
		}
	}

	if (temp > 1) cnt++;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> N;

	check();

	if (cnt == 2) cout << "cubelover\n";
	else cout << "koosaga\n";

	return 0;
}



RESULT 💛



SIMPLE DISCUSSION ✏️

게임 이론 관련 문제였다.



SOURCE 💎

Baekjoon_Link 👈 Click here


*****
NOT A TALENT ❎ NOT GIVING UP ✅
CopyRight ⓒ 2022 DCherish All Rights Reserved.