結果
| 問題 | No.1005 BOT対策 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-28 19:38:10 |
| 言語 | Swift (6.2.3) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 359 bytes |
| 記録 | |
| コンパイル時間 | 6,479 ms |
| コンパイル使用メモリ | 173,684 KB |
| 実行使用メモリ | 17,152 KB |
| 最終ジャッジ日時 | 2024-06-25 14:17:45 |
| 合計ジャッジ時間 | 4,988 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 13 WA * 14 |
ソースコード
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)
}