結果

問題 No.1005 BOT対策
ユーザー MaboyMaboy
提出日時 2021-06-28 19:39:19
言語 Swift
(6.0.3)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 6,889 ms
コンパイル使用メモリ 169,716 KB
実行使用メモリ 17,280 KB
最終ジャッジ日時 2024-06-25 14:18:49
合計ジャッジ時間 7,218 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import Foundation
var s = String(readLine()!)
let t = String(readLine()!)
var c = 0
if t.count == 1 && s.contains(t){
    print(-1)
}else{
    var q = s
    let i = t.startIndex
    let p = t[...i] + "." + t[t.index(after: i)...]
    while q.contains(t){
        q = q.replacingOccurrences(of: t, with: p)
    }
    print(q.count - s.count)
}
0