結果
問題 |
No.1005 BOT対策
|
ユーザー |
![]() |
提出日時 | 2020-03-24 12:39:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 406 bytes |
コンパイル時間 | 1,284 ms |
コンパイル使用メモリ | 163,380 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-06-20 00:51:16 |
合計ジャッジ時間 | 2,263 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int ans = 0; string::size_type pos = 0; if( T.size() == 1 ) { pos = S.find( T, pos ); if( pos != string::npos ) ans = -1; } else { while( true ) { pos = S.find( T, pos ); if( pos == string::npos ) break; S.insert( pos + T.size() - 1, string( "." ) ); ans++; } } cout << ans << endl; }