結果
| 問題 |
No.2738 CPC To F
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-21 14:20:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 732 bytes |
| コンパイル時間 | 765 ms |
| コンパイル使用メモリ | 72,572 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-13 13:04:59 |
| 合計ジャッジ時間 | 1,974 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 4 WA * 18 |
ソースコード
#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;
int nn = s.size();
for (int i = nn - 1; i >= 4; i--) {
//cout << "Yo";
if(s.substr(i - 4, 5) == "CPCTF"){
s.replace(i - 4, 5, " ");
i -= 5;
count++;
//cout << s << i << endl;
}
}
for (int i = s.size() - 1; i >= 6; i--) {
//cout << "Yo";
if(s.substr(i - 6, 7) == "CPCTCPC"){
s.replace(i - 6, 7, " ");
i -= 7;
count++;
//cout << s << endl;
}
}
cout << count;
return 0;
}