結果
| 問題 |
No.1005 BOT対策
|
| コンテスト | |
| ユーザー |
chacoder1
|
| 提出日時 | 2021-02-21 15:18:48 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 387 bytes |
| コンパイル時間 | 2,198 ms |
| コンパイル使用メモリ | 192,996 KB |
| 最終ジャッジ日時 | 2025-01-19 03:00:27 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 23 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
int main() {
string s,t;
cin>>s;
cin>>t;
int slen=s.size();
int tlen=t.size();
int cnt=0;
rep(i,slen-tlen+1){
if(s.substr(i,tlen)==t){
cnt++;
}
}
if(t.size()==1 && cnt>0){
cout<<-1<<endl;
return 0;
}
cout<<cnt<<endl;
return 0;
}
chacoder1