結果

問題 No.2185 平方数の下6桁
ユーザー Kome_soudou
提出日時 2023-01-13 21:47:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 1,823 ms
コンパイル使用メモリ 166,284 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 17:03:55
合計ジャッジ時間 2,909 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
	string s;
	cin >> s;
	int64_t n = 0;
	for(int i = 0; i < 6; i++)
	{
		n *= 10;
		n += s[i] - '0';
	}
	const int64_t mod = 1000000;
	
	for(int64_t i = 1; i <= 1000000; i++)
	{
		if((i * i) % mod == n)
		{
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
	return 0;
}
0