結果

問題 No.791 うし数列
ユーザー nononaga
提出日時 2020-09-08 21:20:16
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 123 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-11-30 08:32:35
合計ジャッジ時間 2,328 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
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