結果

問題 No.1593 Perfect Distance
ユーザー ohreitetsu
提出日時 2021-08-29 20:24:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 68,432 KB
実行使用メモリ 6,816 KB
最終ジャッジ日時 2024-11-22 08:12:44
合計ジャッジ時間 1,312 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <math.h>
using namespace std;
typedef long long LL;
int main()
{
	LL N,N2;
	cin >> N;
	N2 = N * N;
	LL nums = 0;
	for (int x = 1; x <= N; x++) {
		double y = sqrt(N*N - x * x);
		if (y>0 && y==(int)y && x * x + y*y == N2) {
			nums++;
		}
	}
	cout << nums << endl;
	return 0;
}
0