結果

問題 No.1005 BOT対策
コンテスト
ユーザー Maboy
提出日時 2021-06-28 19:38:10
言語 Swift
(6.2.4)
コンパイル:
swiftc _filename_ -Ounchecked -o a.out
実行:
./a.out
結果
WA  
実行時間 -
コード長 359 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,726 ms
コンパイル使用メモリ 213,504 KB
実行使用メモリ 19,712 KB
最終ジャッジ日時 2026-03-11 22:50:23
合計ジャッジ時間 3,837 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 13 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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)
    }
    print(q.count - s.count)
}
0