結果
| 問題 | No.1005 BOT対策 |
| コンテスト | |
| ユーザー |
@abcde
|
| 提出日時 | 2020-03-13 21:58:47 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 219µs | |
| コード長 | 817 bytes |
| 記録 | |
| コンパイル時間 | 892 ms |
| コンパイル使用メモリ | 184,360 KB |
| 実行使用メモリ | 9,412 KB |
| 最終ジャッジ日時 | 2026-07-12 08:20:46 |
| 合計ジャッジ時間 | 2,328 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
// ※※※ 解答不能 ※※※.
// https://yukicoder.me/submissions/436625
#include <bits/stdc++.h>
using namespace std;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
int main(){
char c1[1010], c2[1010];
scanf("%s %s", c1, c2);
string S(c1), T(c2);
if(string(S).find(T) == -1){
puts("0");
}else{
if(T.size() == 1){
puts("-1");
}else{
int ans = 0;
int L = T.size();
rep(i, S.size() + 1 - L){
if(S.substr(i, L) == T){
ans++;
i += L - 2;
}
}
printf("%d\n", ans);
}
}
return 0;
}
@abcde