結果

問題 No.25 有限小数
ユーザー maimai
提出日時 2016-02-02 09:39:11
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 264 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 11,964 KB
実行使用メモリ 16,152 KB
最終ジャッジ日時 2023-10-21 18:40:40
合計ジャッジ時間 3,981 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
16,108 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 83 ms
16,108 KB
testcase_04 AC 83 ms
16,108 KB
testcase_05 AC 86 ms
16,108 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 84 ms
16,108 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 84 ms
16,108 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 85 ms
16,108 KB
testcase_23 AC 84 ms
16,108 KB
testcase_24 AC 86 ms
16,108 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:21: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

n=gets.to_i
m=gets.to_i
s=1
t=1
100.times{|i|
    a=(n*t).to_f
    b=(m*s).to_f
    f=a/b
    r=(f).floor
    if f-r.to_f==0
        if r%10==0
            s*=10
            next
        else
            p r%10
            exit
        end
    end
    t*=10
}
p -1
0