結果

問題 No.1593 Perfect Distance
ユーザー rainy
提出日時 2021-07-21 13:04:15
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 1,059 ms
コンパイル使用メモリ 28,928 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-07-17 13:57:42
合計ジャッジ時間 9,675 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 5 WA * 7 TLE * 3 -- * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>

int main(void) {
	int count = 0, num, numSquare;
	scanf("%d", &num);
	numSquare = num * num;
	for (int i = 1; i < num; i++) {
		for (int j = i; j < num; j++) {
			if (numSquare == ((i * i) + (j * j))) {
				count++;
				if (i == j) {
					count++;
				}
			}
		}
	}
	printf("%d", count);
	return 0;
}
0