結果
| 問題 |
No.2738 CPC To F
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-21 14:14:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 662 bytes |
| コンパイル時間 | 705 ms |
| コンパイル使用メモリ | 72,476 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-13 12:57:44 |
| 合計ジャッジ時間 | 4,522 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 1 |
| other | RE * 22 |
ソースコード
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int n; string s;
cin >> n >> s;
int count = 0;
for (int i = s.size() - 1; i >= 0; i--) {
if(s.substr(i - 4, 5) == "CPCTF"){
s.replace(i - 4, 5, " ");
i -= 5;
count++;
//cout << s << endl;
}
}
for (int i = s.size() - 1; i >= 0; i--) {
if(s.substr(i - 6, 7) == "CPCTCPC"){
s.replace(i - 6, 7, " ");
i -= 7;
count++;
//cout << s << endl;
}
}
cout << count;
return 0;
}