結果
| 問題 |
No.1005 BOT対策
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-23 21:30:02 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 508 bytes |
| コンパイル時間 | 2,372 ms |
| コンパイル使用メモリ | 133,888 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-06-20 00:53:12 |
| 合計ジャッジ時間 | 1,914 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <climits>
#include <map>
#include <queue>
using namespace std;
int main() {
string s,t;
cin >> s >> t;
if (t.size() == 1 && s.find(t)!=string::npos) {
cout << -1 << endl;
return 0;
}
const int n = s.size();
const int c = t.size();
int ans = 0;
for (int i=0; i<n; i++) {
if (t == s.substr(i, c)) ans++, i+=c-2;
}
cout << ans << endl;
}