結果
問題 | No.1005 BOT対策 |
ユーザー |
|
提出日時 | 2022-08-02 10:07:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 386 bytes |
コンパイル時間 | 1,752 ms |
コンパイル使用メモリ | 168,132 KB |
実行使用メモリ | 13,884 KB |
最終ジャッジ日時 | 2024-07-23 03:01:39 |
合計ジャッジ時間 | 5,135 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 TLE * 1 -- * 25 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ string s, t; cin >> s >> t; int ans = 0; for(int i = 0; i + t.size() <= s.size();){ if(s.substr(i, t.size()) == t){ ans++; i += t.size() - 1; }else i++; } if(t.size() == 1 && ans >= 1){ cout << -1 << endl; return 0; } cout << ans << endl; }