結果
| 問題 |
No.1005 BOT対策
|
| コンテスト | |
| ユーザー |
ajiruajiru
|
| 提出日時 | 2020-03-18 20:00:39 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 328 bytes |
| コンパイル時間 | 478 ms |
| コンパイル使用メモリ | 64,508 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-06-20 00:51:06 |
| 合計ジャッジ時間 | 1,553 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main(void) {
string s, t;
cin >> s >> t;
int pos = 0, ans = 0;
while (s.find(t, pos) != string::npos) {
++ans;
pos = s.find(t, pos);
pos += t.size();
if (t.size() > 1) --pos;
}
if (t.size() == 1 && ans > 0) ans = -1;
cout << ans << endl;
return 0;
}
ajiruajiru