結果
| 問題 | 
                            No.1005 BOT対策
                             | 
                    
| コンテスト | |
| ユーザー | 
                             ui_mtc
                         | 
                    
| 提出日時 | 2020-03-30 14:03:37 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 436 bytes | 
| コンパイル時間 | 1,763 ms | 
| コンパイル使用メモリ | 166,916 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-12 00:57:11 | 
| 合計ジャッジ時間 | 2,918 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 WA * 2 | 
ソースコード
#include <bits/stdc++.h>
#define int long long 
using namespace std;
using Graph = vector<vector<int>>;
signed main(){
  string S, T;
  cin >> S >> T;
  
  int ans = 0;
  int N = (int)T.size();
  int cnt = 0;
  while( cnt < S.size() ){
    if( S.substr(cnt, N) == T ){
      if( N==1 ){
        cout << -1 << endl;
        return 0;
      }else{
        ans++;
        cnt += N-1;
      }
    }
    cnt++;
  }
  cout << ans << endl;
}
            
            
            
        
            
ui_mtc