結果

問題 No.781 円周上の格子点の数え上げ
ユーザー cielciel
提出日時 2019-01-13 15:30:56
言語 Crystal
(1.11.2)
結果
AC  
実行時間 252 ms / 2,000 ms
コード長 142 bytes
コンパイル時間 18,195 ms
コンパイル使用メモリ 254,196 KB
実行使用メモリ 200,044 KB
最終ジャッジ日時 2023-09-13 09:58:08
合計ジャッジ時間 18,928 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,448 KB
testcase_01 AC 2 ms
4,416 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 2 ms
4,500 KB
testcase_04 AC 2 ms
4,412 KB
testcase_05 AC 2 ms
4,456 KB
testcase_06 AC 3 ms
5,140 KB
testcase_07 AC 4 ms
6,152 KB
testcase_08 AC 210 ms
160,800 KB
testcase_09 AC 207 ms
160,864 KB
testcase_10 AC 3 ms
4,776 KB
testcase_11 AC 4 ms
5,320 KB
testcase_12 AC 239 ms
182,352 KB
testcase_13 AC 252 ms
200,044 KB
testcase_14 AC 10 ms
13,700 KB
testcase_15 AC 3 ms
4,992 KB
testcase_16 AC 3 ms
4,832 KB
testcase_17 AC 132 ms
120,268 KB
testcase_18 AC 111 ms
97,228 KB
testcase_19 AC 113 ms
99,980 KB
testcase_20 AC 122 ms
99,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x,y=gets.not_nil!.split.map &.to_i
r=Math.sqrt(y).to_i
h=[0]*(r*r*4)
(1..r).each{|x|(0..r).each{|y|h[x*x+y*y]+=1}}
p (x..y).map{|i|h[i]}.max*4
0