U E D R , A S I H C RSS

Light More Light/문보창

소감

2005/02/19 Accepted 0:00.613 448
간단한 문제였으나, 처음에 문제 분석을 잘못하여 시간을 소비했다. 정수론 문제의 경우 문제분석만 잘해 준다면 의외로 쉽게 풀리는 것 같다. 수행시간과 메모리 사용량이 많다. 보다 좋은 알고리즘을 생각해야 한다.

코드

~cpp 
// no10110 - Light, more Light
#include <iostream>
#include <cmath>
using namespace std;
int main()
{	
	unsigned int n;
	while (cin >> n)
	{
		if (n == 0)
			break;
		if (int(sqrt(n)) == double(sqrt(n)))
			cout << "yes\n";
		else
			cout << "no\n";
	}
	return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:38
Processing time 0.0135 sec