結果

問題 No.781 円周上の格子点の数え上げ
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2019-12-17 18:07:06
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 216 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 11,372 KB
実行使用メモリ 19,524 KB
最終ジャッジ日時 2023-09-17 05:30:59
合計ジャッジ時間 5,566 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
19,396 KB
testcase_01 AC 69 ms
15,200 KB
testcase_02 WA -
testcase_03 AC 69 ms
15,224 KB
testcase_04 AC 69 ms
15,096 KB
testcase_05 AC 68 ms
15,068 KB
testcase_06 AC 93 ms
15,024 KB
testcase_07 WA -
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

X, Y = gets.split.map(&:to_i)
R = Math.sqrt(Y).ceil
C = Hash.new(0)
(-R .. R).each do |x|
  (-R .. R).each do |y|
    r = x ** 2 + y ** 2
    C[x ** 2 + y ** 2] += 1 unless r < X || r > Y
  end
end
puts C.values.max
0