結果

問題 No.671 1000000007
ユーザー jiro8719jiro8719
提出日時 2018-06-19 11:24:57
言語 Ruby
(3.3.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 181 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 11,496 KB
実行使用メモリ 15,280 KB
最終ジャッジ日時 2023-09-13 07:04:24
合計ジャッジ時間 2,348 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,200 KB
testcase_01 AC 79 ms
15,252 KB
testcase_02 AC 80 ms
15,164 KB
testcase_03 AC 81 ms
15,252 KB
testcase_04 AC 82 ms
15,088 KB
testcase_05 AC 85 ms
15,080 KB
testcase_06 AC 79 ms
15,280 KB
testcase_07 AC 82 ms
15,188 KB
testcase_08 AC 82 ms
15,164 KB
testcase_09 AC 87 ms
15,264 KB
testcase_10 AC 91 ms
15,156 KB
testcase_11 AC 85 ms
15,172 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

default = 8
input = gets.chomp
count = 0
i = 0
loop do
    break if input[i] == nil
    count += 1 if input[i] == "0"
    i += 1
end

puts (default - count).abs# your code goes here
0