結果
| 問題 | No.1005 BOT対策 |
| コンテスト | |
| ユーザー |
ui_mtc
|
| 提出日時 | 2020-03-30 14:05:22 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 239µs | |
| コード長 | 435 bytes |
| 記録 | |
| コンパイル時間 | 830 ms |
| コンパイル使用メモリ | 183,844 KB |
| 実行使用メモリ | 9,408 KB |
| 最終ジャッジ日時 | 2026-07-12 08:22:58 |
| 合計ジャッジ時間 | 2,412 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
#define int long long
using namespace std;
using Graph = vector<vector<int>>;
signed main(){
string S, T;
cin >> S >> T;
int ans = 0;
int N = (int)T.size();
int cnt = 0;
while( cnt < S.size() ){
if( S.substr(cnt, N) == T ){
if( N==1 ){
cout << -1 << endl;
return 0;
}else{
ans++;
cnt += N-1;
}
}else cnt++;
}
cout << ans << endl;
}
ui_mtc