結果
| 問題 | No.1005 BOT対策 |
| コンテスト | |
| ユーザー |
yukileo9
|
| 提出日時 | 2021-07-15 08:55:32 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 513 bytes |
| 記録 | |
| コンパイル時間 | 1,009 ms |
| コンパイル使用メモリ | 180,956 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-25 16:56:43 |
| 合計ジャッジ時間 | 2,264 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void no_1005(void) {
string s, t;
cin >> s >> t;
int t_size = (int)t.size();
int tcnt = 0;
int ptr = 0;
while (true) {
string s_tmp = s.substr(ptr, t_size);
if (s_tmp == t) {
tcnt++;
ptr += t_size;
} else
ptr++;
if (ptr >= (int)s.size() - t_size + 1) break;
}
if (t.size() == 1) tcnt = -1;
cout << tcnt << endl;
}
int main(void) {
no_1005();
return 0;
}
yukileo9