結果

問題 No.152 貯金箱の消失
ユーザー finefine
提出日時 2016-01-17 23:17:37
言語 Ruby
(3.3.0)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 248 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 16,112 KB
最終ジャッジ日時 2023-10-20 00:31:55
合計ジャッジ時間 1,860 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
16,112 KB
testcase_01 AC 87 ms
16,112 KB
testcase_02 AC 86 ms
16,112 KB
testcase_03 AC 83 ms
16,112 KB
testcase_04 AC 84 ms
16,112 KB
testcase_05 AC 83 ms
16,112 KB
testcase_06 AC 84 ms
16,112 KB
testcase_07 AC 88 ms
16,112 KB
testcase_08 AC 122 ms
16,112 KB
testcase_09 AC 123 ms
16,112 KB
testcase_10 AC 114 ms
16,112 KB
testcase_11 AC 100 ms
16,112 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

l = gets.to_i
ans = 0
1.upto((Math.sqrt(l * 0.5) * 0.5).floor){|m|
    (1 + m % 2).step([(l * 0.125 / m - m).floor,m].min,2){|n|
        if n.gcd(m) != 1
            next
        else
            ans += 1
        end
        }
    }
p ans % 1000003
0