結果

問題 No.781 円周上の格子点の数え上げ
ユーザー cielciel
提出日時 2019-01-13 15:31:38
言語 Crystal
(1.11.2)
結果
AC  
実行時間 291 ms / 2,000 ms
コード長 140 bytes
コンパイル時間 16,486 ms
コンパイル使用メモリ 255,088 KB
実行使用メモリ 252,140 KB
最終ジャッジ日時 2023-09-13 09:57:47
合計ジャッジ時間 19,055 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,376 KB
testcase_01 AC 3 ms
4,456 KB
testcase_02 AC 3 ms
4,384 KB
testcase_03 AC 2 ms
4,404 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 2 ms
4,456 KB
testcase_06 AC 3 ms
5,440 KB
testcase_07 AC 5 ms
7,012 KB
testcase_08 AC 248 ms
212,828 KB
testcase_09 AC 244 ms
212,820 KB
testcase_10 AC 3 ms
4,872 KB
testcase_11 AC 4 ms
5,704 KB
testcase_12 AC 267 ms
234,268 KB
testcase_13 AC 291 ms
252,140 KB
testcase_14 AC 12 ms
17,348 KB
testcase_15 AC 3 ms
5,096 KB
testcase_16 AC 3 ms
4,904 KB
testcase_17 AC 160 ms
150,484 KB
testcase_18 AC 130 ms
127,464 KB
testcase_19 AC 132 ms
130,564 KB
testcase_20 AC 147 ms
132,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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