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