結果
| 問題 |
No.1005 BOT対策
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-04-11 09:45:54 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 576 bytes |
| コンパイル時間 | 2,085 ms |
| コンパイル使用メモリ | 192,464 KB |
| 最終ジャッジ日時 | 2025-01-09 17:16:26 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 3 |
ソースコード
#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
using lint=long long;
using ld=long double;
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
std::string s,t;std::cin>>s>>t;
lint l=s.length(),m=t.length();
if(m==1){
std::cout<<-1<<'\n';
return 0;
}
lint ans=0;
for(lint i=0;i<l;){
if(s.substr(i,m)==t){
i+=m-1;
ans++;
}else{
i++;
}
}
std::cout<<ans<<'\n';
}
ngtkana