結果
| 問題 |
No.2738 CPC To F
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-21 15:13:12 |
| 言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 2,000 ms |
| コード長 | 602 bytes |
| コンパイル時間 | 2,328 ms |
| コンパイル使用メモリ | 162,884 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-13 14:01:40 |
| 合計ジャッジ時間 | 3,197 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;cin >> n;
string s;cin >> s;
int k=0,x=0;
while(k+4<n){
if(k+4<n){
if(s[k]=='C' && s[k+1]=='P' && s[k+2]=='C' && s[k+3]=='T'){
if(s[k+4]=='F'){
k+=5;
x++;
}else if(k+6<n && s[k+4]=='C' && s[k+5]=='P' && s[k+6]=='C'){
k+=7;
x++;
}else{
k+=4;
}
}else{
k++;
}
}
}
cout << x << "\n";
}