結果
| 問題 | No.1005 BOT対策 |
| コンテスト | |
| ユーザー |
tsuchinaga
|
| 提出日時 | 2020-10-04 23:24:11 |
| 言語 | TypeScript (7.0.2 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 37 ms / 2,000 ms |
| + 269µs | |
| コード長 | 797 bytes |
| 記録 | |
| コンパイル時間 | 3,306 ms |
| コンパイル使用メモリ | 195,924 KB |
| 実行使用メモリ | 51,264 KB |
| 最終ジャッジ日時 | 2026-10-12 11:17:46 |
| 合計ジャッジ時間 | 5,455 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 |
ソースコード
function issue1005(input: string) {
let inputs = input.trim().split("\n")
let s: string = inputs[0]
let t: string = inputs[1]
// 先頭からマッチするところを探して、マッチしたらマッチした最後の文字の前に.を入れ、マッチした文字の最後の文字から確認を再開する
let count = 0
if (t.length == 1 && s.includes(t)) count = -1
else {
let head = 0
while (head <= s.length - t.length) {
if (s.substr(head, t.length) == t) {
count++
head += t.length - 1
} else head++
}
}
console.log(count)
}
let path: string = "/dev/stdin"
if (process.platform == "win32") path = "./stdin.txt"
issue1005(require('fs').readFileSync(path, 'utf8'))
tsuchinaga