結果

問題 No.152 貯金箱の消失
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-02-16 20:27:51
言語 Ruby
(3.3.0)
結果
AC  
実行時間 776 ms / 5,000 ms
コード長 85 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 11,220 KB
実行使用メモリ 15,452 KB
最終ジャッジ日時 2023-08-26 23:13:23
合計ジャッジ時間 4,841 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,144 KB
testcase_01 AC 92 ms
15,168 KB
testcase_02 AC 83 ms
15,132 KB
testcase_03 AC 85 ms
15,164 KB
testcase_04 AC 94 ms
15,276 KB
testcase_05 AC 93 ms
15,200 KB
testcase_06 AC 102 ms
15,452 KB
testcase_07 AC 193 ms
15,132 KB
testcase_08 AC 768 ms
15,288 KB
testcase_09 AC 776 ms
15,232 KB
testcase_10 AC 615 ms
15,244 KB
testcase_11 AC 389 ms
15,180 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

l=gets.to_i/8
a=0
1.upto(l){|m|a+=(m+1..[m+m,l/m].min).count{|s|s.gcd(s-m-m)==1}}
p a
0