結果

問題 No.1593 Perfect Distance
ユーザー 小野寺健小野寺健
提出日時 2021-11-12 21:55:00
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 136 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-05-04 08:26:37
合計ジャッジ時間 3,134 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
12,160 KB
testcase_01 AC 92 ms
12,160 KB
testcase_02 AC 92 ms
12,032 KB
testcase_03 AC 93 ms
12,288 KB
testcase_04 AC 96 ms
12,160 KB
testcase_05 AC 92 ms
12,288 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 91 ms
12,032 KB
testcase_18 AC 92 ms
12,160 KB
testcase_19 AC 95 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i

cnt = 0
1.upto(Integer.sqrt(N)-1) {|i|
	n = N - i**2
	next if n == 0
	cnt += 1 if Integer.sqrt(n)**2 == n
}

puts cnt * 2
0