結果
問題 |
No.1005 BOT対策
|
ユーザー |
![]() |
提出日時 | 2020-03-07 00:56:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 484 bytes |
コンパイル時間 | 1,568 ms |
コンパイル使用メモリ | 168,524 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-14 10:58:16 |
合計ジャッジ時間 | 2,273 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 3 |
ソースコード
#define _LIBCPP_DEBUG 0 #include<bits/stdc++.h> using namespace std; typedef long long int ll; ll MOD = 1e9 + 7; int main(void) { string S,T; cin>>S>>T; if(T.size()==1){ cout<<-1<<endl; return 0; } int S_size = S.size(); int T_size = T.size(); int cnt = 0; for (int i = 0; i+T_size-1 < S_size; ++i) { if(S.substr(i,T_size)==T) { cnt++; i+=T_size-2; } } cout<<cnt<<endl; return 0; }