結果
| 問題 | No.1005 BOT対策 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-09 08:43:29 |
| 言語 | Go (1.26.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 359 bytes |
| 記録 | |
| コンパイル時間 | 10,201 ms |
| コンパイル使用メモリ | 281,276 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-05-08 04:22:24 |
| 合計ジャッジ時間 | 11,508 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 23 WA * 6 |
ソースコード
package main
import (
"fmt"
)
func count(str, substr string) int {
cnt := 0
for i := 0; i < len(str)-len(substr)+1; i++ {
if str[i:i+len(substr)] == substr {
cnt++
}
}
return cnt
}
func main() {
var cnt int
var s, t string
fmt.Scan(&s, &t)
cnt = count(s, t)
if cnt >= 1 && len(t) <= 1 {
fmt.Println(-1)
} else {
fmt.Println(cnt)
}
}