結果
| 問題 | No.2738 CPC To F |
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2024-07-12 13:58:05 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 962 ms |
| コンパイル使用メモリ | 181,740 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2026-03-30 10:15:07 |
| 合計ジャッジ時間 | 2,003 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)
int main() {
int N;
string s;
cin >> N >> s;
int i = 0, ans = 0;
while(1) {
auto p = s.find("CPCT", i);
if(p == string::npos) break;
int j = p;
if(s.substr(j + 4, 3) == "CPC") {
ans++;
i = j + 7;
}
else if(s.substr(j + 4, 1) == "F") {
ans++;
i = j + 5;
}
else i = j + 4;
}
cout << ans << endl;
}
forest3