結果

問題 No.791 うし数列
ユーザー keib
提出日時 2019-03-05 13:35:30
言語 Swift
(6.0.3)
結果
WA  
実行時間 -
コード長 212 bytes
コンパイル時間 13,410 ms
コンパイル使用メモリ 167,048 KB
実行使用メモリ 15,872 KB
最終ジャッジ日時 2024-11-30 13:40:09
合計ジャッジ時間 4,461 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import Foundation 

let s = readLine()!
if s.prefix(1) != "1" {
    print(-1)
    exit(0)    
}

if s.suffix(s.count - 1).first(where: { $0 != "3" }) != nil {
    print(-1)
    exit(0)    
} 

print(s.count - 1)
0