結果
| 問題 | 
                            No.1005 BOT対策
                             | 
                    
| コンテスト | |
| ユーザー | 
                             forest3
                         | 
                    
| 提出日時 | 2020-03-24 12:26:46 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 354 bytes | 
| コンパイル時間 | 1,891 ms | 
| コンパイル使用メモリ | 166,992 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-12-31 14:43:22 | 
| 合計ジャッジ時間 | 2,428 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 24 WA * 3 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string S, T;
	cin >> S >> T;
	int ans = 0;
	string::size_type pos = 0;
	if( T.size() == 1 ) {
		ans = -1;
	}
	else {
		while( true  ) {
			pos = S.find( T, pos );
			if( pos == string::npos ) break;
			S.insert( pos + T.size() - 1, string( "." ) );
			ans++;
		}
	}
	cout << ans << endl;
}
            
            
            
        
            
forest3