結果

問題 No.781 円周上の格子点の数え上げ
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2019-12-17 18:11:27
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 215 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 11,504 KB
実行使用メモリ 89,136 KB
最終ジャッジ日時 2023-09-17 05:43:44
合計ジャッジ時間 7,589 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
19,632 KB
testcase_01 AC 73 ms
15,232 KB
testcase_02 AC 72 ms
15,108 KB
testcase_03 AC 70 ms
15,056 KB
testcase_04 AC 68 ms
15,012 KB
testcase_05 AC 71 ms
15,240 KB
testcase_06 AC 78 ms
15,020 KB
testcase_07 AC 87 ms
15,248 KB
testcase_08 AC 1,320 ms
15,120 KB
testcase_09 AC 1,287 ms
15,224 KB
testcase_10 AC 76 ms
15,364 KB
testcase_11 AC 80 ms
15,716 KB
testcase_12 TLE -
testcase_13 TLE -
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)
(1 .. R).each do |x|
  (0 .. R).each do |y|
    r2 = x ** 2 + y ** 2
    C[r2] += 1 unless r2 < X || r2 > Y
  end
end
puts (C.values.max || 0) * 4
0