結果
| 問題 |
No.2738 CPC To F
|
| コンテスト | |
| ユーザー |
Tatsu_mr
|
| 提出日時 | 2024-09-30 10:31:27 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 2,000 ms |
| コード長 | 518 bytes |
| コンパイル時間 | 3,268 ms |
| コンパイル使用メモリ | 246,432 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-09-30 10:31:32 |
| 合計ジャッジ時間 | 3,755 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
string t = "";
int i = 0;
while (i < n) {
if (s[i] == 'C' && i + 6 < n && s.substr(i, 7) == "CPCTCPC") {
t += "CPCTF";
i += 7;
} else {
t += s[i];
i++;
}
}
int ans = 0;
for (int i = 0; i <= (int)t.size() - 5; i++) {
if (t.substr(i, 5) == "CPCTF") {
ans++;
}
}
cout << ans << endl;
}
Tatsu_mr