結果

問題 No.1593 Perfect Distance
ユーザー simansiman
提出日時 2021-07-13 14:37:52
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 148 bytes
コンパイル時間 1,145 ms
コンパイル使用メモリ 11,156 KB
実行使用メモリ 15,388 KB
最終ジャッジ日時 2023-09-15 09:24:07
合計ジャッジ時間 3,665 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 84 ms
15,084 KB
testcase_03 WA -
testcase_04 AC 82 ms
15,052 KB
testcase_05 AC 82 ms
15,256 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 81 ms
15,272 KB
testcase_18 AC 82 ms
15,112 KB
testcase_19 AC 82 ms
15,088 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
L = Math.sqrt(N).ceil
ans = 0

0.upto(L) do |x|
  0.upto(L) do |y|
    next if x ** 2 + y ** 2 != N

    ans += 1
  end
end

puts ans
0