結果
問題 |
No.1005 BOT対策
|
ユーザー |
|
提出日時 | 2020-03-14 19:32:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 605 bytes |
コンパイル時間 | 1,533 ms |
コンパイル使用メモリ | 161,768 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-06-20 00:50:54 |
合計ジャッジ時間 | 2,107 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
//1005 bot taisaku #include <bits/stdc++.h> #define rep(i ,n) for(int i=0;i<(int)(n);++i) using namespace std; typedef long long int int64; typedef unsigned long long uint64; int main(){ string s , t; cin >> s >> t; bool bot = false; int counter = 0; if(t.size() == 1 ){ rep(i ,s.size()){ if(t[0] == s[i]) { bot = true; break; } } } else { int pos = 0 ; int i; while((i = s.find(t,pos))!=string::npos){ ++counter; pos = t.size()-1+i; } } cout << ( bot ? -1 : counter ) << endl; }