結果
問題 |
No.1005 BOT対策
|
ユーザー |
|
提出日時 | 2024-03-27 09:51:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 430 bytes |
コンパイル時間 | 4,450 ms |
コンパイル使用メモリ | 250,652 KB |
最終ジャッジ日時 | 2025-02-20 13:59:57 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 WA * 2 RE * 3 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; using ld = long double; string S, T; int main() { cin >> S >> T; int cnt = 0; for (int i = 0; i <= S.size() - T.size(); i++) { if (S.substr(i, T.size()) == T) { cnt++; i += T.size() - 1; } } if (cnt > 0 && T.size() == 1) cout << -1 << endl; else cout << cnt << endl; return 0; }