結果
| 問題 | 
                            No.1005 BOT対策
                             | 
                    
| コンテスト | |
| ユーザー | 
                             mmn15277198
                         | 
                    
| 提出日時 | 2020-03-25 22:40:36 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 498 bytes | 
| コンパイル時間 | 763 ms | 
| コンパイル使用メモリ | 70,968 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2025-01-02 00:12:41 | 
| 合計ジャッジ時間 | 1,942 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 16 WA * 12 | 
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
int main(){
	string s,t;
	cin >> s >> t;
	
	int f=0;
	for(int i=0;i<s.size();i++){
		if(t[0]==s[i]){
			//cout << "check_1 -> " << i << endl;
			f++;
			for(int j=1;j<t.size();j++){
				i++;
				if(t[j]!=s[i]){
					f--;
					break;
				}
			}
		}
	}
	
	if(s.size()/t.size()==f && s.size()%t.size()==0){
		cout << "-1" << endl;
		return 0;
	}
	
	cout << f << endl;
	return 0;
}
            
            
            
        
            
mmn15277198