結果

問題 No.1593 Perfect Distance
ユーザー rainyrainy
提出日時 2021-07-21 13:04:15
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 28,188 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-09-24 13:04:27
合計ジャッジ時間 9,566 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,892 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

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