結果
| 問題 | No.781 円周上の格子点の数え上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-18 00:48:35 |
| 言語 | Ruby (4.0.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 269 bytes |
| 記録 | |
| コンパイル時間 | 182 ms |
| コンパイル使用メモリ | 9,216 KB |
| 実行使用メモリ | 100,480 KB |
| 最終ジャッジ日時 | 2026-03-22 08:23:48 |
| 合計ジャッジ時間 | 13,175 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 6 RE * 1 |
コンパイルメッセージ
Syntax OK
ソースコード
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