結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,764 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 29 ms
4,380 KB
testcase_10 AC 273 ms
4,380 KB
testcase_11 AC 700 ms
4,376 KB
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