結果
問題 | No.1005 BOT対策 |
ユーザー | forest3 |
提出日時 | 2020-03-24 12:39:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 406 bytes |
コンパイル時間 | 1,178 ms |
コンパイル使用メモリ | 162,888 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-01 20:10:11 |
合計ジャッジ時間 | 2,222 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#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; }