結果

問題 No.791 うし数列
ユーザー nononaganononaga
提出日時 2020-09-08 21:20:16
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 123 bytes
コンパイル時間 475 ms
コンパイル使用メモリ 11,296 KB
実行使用メモリ 15,284 KB
最終ジャッジ日時 2023-08-20 07:41:20
合計ジャッジ時間 2,485 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,168 KB
testcase_01 AC 80 ms
15,124 KB
testcase_02 WA -
testcase_03 AC 78 ms
15,260 KB
testcase_04 AC 81 ms
15,148 KB
testcase_05 AC 81 ms
15,148 KB
testcase_06 AC 79 ms
15,140 KB
testcase_07 AC 79 ms
15,084 KB
testcase_08 AC 78 ms
15,128 KB
testcase_09 AC 79 ms
15,284 KB
testcase_10 AC 80 ms
15,076 KB
testcase_11 AC 79 ms
15,224 KB
testcase_12 AC 81 ms
15,036 KB
testcase_13 AC 80 ms
15,112 KB
testcase_14 AC 80 ms
15,168 KB
testcase_15 AC 79 ms
15,028 KB
testcase_16 AC 77 ms
15,228 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:7: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

n=gets.chomp
if n == "1" 
    puts 0
elsif n[0] == "1" && n.index(/[^3]/,1) == nil
    puts n.size - 1
else
    puts -1
end
0