結果

問題 No.152 貯金箱の消失
ユーザー cielciel
提出日時 2015-02-16 19:09:26
言語 Ruby
(3.3.0)
結果
AC  
実行時間 211 ms / 5,000 ms
コード長 112 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 11,544 KB
実行使用メモリ 15,348 KB
最終ジャッジ日時 2023-09-06 01:41:48
合計ジャッジ時間 2,347 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,108 KB
testcase_01 AC 81 ms
15,284 KB
testcase_02 AC 81 ms
15,348 KB
testcase_03 AC 82 ms
15,132 KB
testcase_04 AC 82 ms
15,080 KB
testcase_05 AC 83 ms
15,248 KB
testcase_06 AC 84 ms
15,124 KB
testcase_07 AC 101 ms
15,192 KB
testcase_08 AC 211 ms
15,276 KB
testcase_09 AC 211 ms
15,060 KB
testcase_10 AC 182 ms
15,096 KB
testcase_11 AC 137 ms
15,316 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

L=gets.to_i/4
r=0
(2..Math.sqrt(L)).each{|m|(1-m%2).step(m-1,2){|n|next if m.gcd(n)>1
r+=1 if 2*m*(m+n)<=L}}
p r
0