結果

問題 No.1005 BOT対策
ユーザー 東前頭十一枚目
提出日時 2020-03-06 22:10:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 386 bytes
コンパイル時間 1,504 ms
コンパイル使用メモリ 166,008 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-10-14 10:41:15
合計ジャッジ時間 5,014 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 TLE * 1 -- * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
	string s, t; cin >> s >> t;
	int sn = s.size();
	int tn = t.size();
	int ans = 0;
	for(int i = 0; i < sn; ++i) {
		if(i + tn > sn) break;
		bool same = true;
		for(int j = 0; j < tn; ++j) {
			if(s[i + j] != t[j]) {
				same = false;
			}
		}
		if(same) {
			++ans;
			i += tn - 2;
		}
	}
	cout << ans << '\n';
	return 0;
}

0