Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 433 Bytes

020.md

File metadata and controls

36 lines (29 loc) · 433 Bytes

020 - Log Inequality (★3)

解答

b * log2(c) == log2(c^b) を利用して a < (c^b) を調べます。

#include <iostream>

// x^y を計算
long long Pow(long long x, long long y)
{
	long long r = 1;

	for (int i = 0; i < y; ++i)
	{
		r *= x;
	}

	return r;
}

int main()
{
	long long a, b, c;
	std::cin >> a >> b >> c;

	if (a < Pow(c, b))
	{
		std::cout << "Yes\n";
	}
	else
	{
		std::cout << "No\n";
	}
}