結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
93,176 KB
testcase_01 WA -
testcase_02 AC 137 ms
93,168 KB
testcase_03 AC 136 ms
93,252 KB
testcase_04 WA -
testcase_05 AC 135 ms
93,164 KB
testcase_06 AC 144 ms
93,456 KB
testcase_07 AC 152 ms
93,296 KB
testcase_08 TLE -
testcase_09 TLE -
testcase_10 AC 136 ms
93,360 KB
testcase_11 AC 139 ms
93,248 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 AC 233 ms
93,400 KB
testcase_15 WA -
testcase_16 AC 137 ms
93,252 KB
testcase_17 AC 1,431 ms
93,364 KB
testcase_18 WA -
testcase_19 WA -
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
    sqrt.times do |j|
        b = j * j
        if a + b < 10_000_000
            ans[a + b] += 1 
        end
    end
end

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