結果
問題 |
No.2738 CPC To F
|
ユーザー |
![]() |
提出日時 | 2025-05-06 11:45:12 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 585 bytes |
コンパイル時間 | 3,561 ms |
コンパイル使用メモリ | 275,244 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-05-06 11:45:17 |
合計ジャッジ時間 | 4,681 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N >> S; int ans = 0; for (int i = 0; i < N - 3;) { if (S.substr(i, 4) == "CPCT") { if (S[i + 4] == 'F') { ans++; i += 5; continue; } if (S.substr(i + 4, 3) == "CPC") { ans++; i += 7; continue; } } i++; } cout << ans; } // CPCTF // CPCTCPC // CPCTCPCTCPC // CPCTFCPCTF