結果
| 問題 | No.1005 BOT対策 |
| コンテスト | |
| ユーザー |
tsuchinaga
|
| 提出日時 | 2020-10-04 23:22:19 |
| 言語 | TypeScript(Node) (7.0.2 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 804 bytes |
| 記録 | |
| コンパイル時間 | 877 ms |
| コンパイル使用メモリ | 201,928 KB |
| 実行使用メモリ | 51,516 KB |
| 最終ジャッジ日時 | 2026-10-09 23:58:02 |
| 合計ジャッジ時間 | 3,731 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 WA * 2 |
ソースコード
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
}
head++
}
}
console.log(count)
}
let path: string = "/dev/stdin"
if (process.platform == "win32") path = "./stdin.txt"
issue1005(require('fs').readFileSync(path, 'utf8'))
tsuchinaga