結果

問題 No.1005 BOT対策
ユーザー MaboyMaboy
提出日時 2021-06-28 19:39:19
言語 Swift
(5.10.0)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 2,091 ms
コンパイル使用メモリ 153,952 KB
実行使用メモリ 14,640 KB
最終ジャッジ日時 2023-09-07 20:35:16
合計ジャッジ時間 3,455 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
14,364 KB
testcase_01 AC 6 ms
14,008 KB
testcase_02 AC 6 ms
14,320 KB
testcase_03 AC 6 ms
13,748 KB
testcase_04 AC 6 ms
14,140 KB
testcase_05 AC 6 ms
14,640 KB
testcase_06 AC 6 ms
14,008 KB
testcase_07 AC 6 ms
13,648 KB
testcase_08 AC 6 ms
13,960 KB
testcase_09 AC 6 ms
14,036 KB
testcase_10 AC 6 ms
14,212 KB
testcase_11 AC 7 ms
14,312 KB
testcase_12 AC 6 ms
14,264 KB
testcase_13 AC 6 ms
13,744 KB
testcase_14 AC 7 ms
14,192 KB
testcase_15 AC 7 ms
13,944 KB
testcase_16 AC 6 ms
13,688 KB
testcase_17 AC 6 ms
13,948 KB
testcase_18 AC 6 ms
13,712 KB
testcase_19 AC 6 ms
14,040 KB
testcase_20 AC 6 ms
13,844 KB
testcase_21 AC 6 ms
13,384 KB
testcase_22 AC 6 ms
13,440 KB
testcase_23 AC 6 ms
13,320 KB
testcase_24 AC 6 ms
14,196 KB
testcase_25 AC 6 ms
14,620 KB
testcase_26 AC 6 ms
14,616 KB
testcase_27 AC 6 ms
13,604 KB
testcase_28 AC 8 ms
14,240 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

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