結果

問題 No.781 円周上の格子点の数え上げ
ユーザー ゆうなんとかゆうなんとか
提出日時 2019-01-18 01:02:41
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 62 ms
コンパイル使用メモリ 11,316 KB
実行使用メモリ 93,520 KB
最終ジャッジ日時 2023-09-14 02:08:04
合計ジャッジ時間 16,579 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 139 ms
93,236 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 150 ms
93,176 KB
testcase_08 TLE -
testcase_09 TLE -
testcase_10 AC 133 ms
93,460 KB
testcase_11 AC 139 ms
93,396 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 AC 215 ms
93,376 KB
testcase_15 WA -
testcase_16 AC 136 ms
93,356 KB
testcase_17 AC 1,246 ms
93,308 KB
testcase_18 WA -
testcase_19 AC 1,259 ms
93,264 KB
testcase_20 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

x, y = gets.strip.split.map(&:to_i)
ans = Array.new(10_000_000, 0)
sqrt = Integer.sqrt y
1.step(sqrt) do |i|
    a = i * i
    0.step(sqrt) do |j|
        b = j * j
        if a + b < y
            ans[a + b] += 1 
        end
    end
end

puts ans[x..y].max * 4
0