結果
| 問題 | No.1005 BOT対策 |
| コンテスト | |
| ユーザー |
mohutarou_AC
|
| 提出日時 | 2020-03-06 21:37:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 394 bytes |
| 記録 | |
| コンパイル時間 | 531 ms |
| コンパイル使用メモリ | 63,872 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 10:27:47 |
| 合計ジャッジ時間 | 1,438 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 8 |
ソースコード
#include<iostream>
#include<string>
using namespace std;
int main(){
string s,t;
cin>>s>>t;
int n=s.size(),m=t.size();
int ans=0;
for(int i=0;i<n;i++){
bool ok=1;
if(i+m-1>=n)
ok=0;
else
for(int j=0;j<m;j++)ok&=(t[j]==s[i+j]);
if(ok){
ans++;
i+=m-1;
}
}
cout<<ans<<endl;
}
mohutarou_AC