結果
問題 | No.2738 CPC To F |
ユーザー |
|
提出日時 | 2024-04-21 02:38:16 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 521 bytes |
コンパイル時間 | 2,957 ms |
コンパイル使用メモリ | 243,788 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 01:06:50 |
合計ジャッジ時間 | 3,326 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include<bits/stdc++.h> using namespace std; int n; string s; int pt; int cp(){ if(s[pt]=='C' && s[pt+1]=='P' && s[pt+2]=='C' && s[pt+3]=='T'){ if(s[pt+4]=='F'){return 5;} if(s[pt+4]=='C' && s[pt+5]=='P' && s[pt+6]=='C'){return 7;} } return 1; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> n; cin >> s; for(int i=0;i<100;i++){s.push_back('.');} int res=0; pt=0; while(pt<n){ int d=cp(); if(d>1){res++;} pt+=d; } cout << res << "\n"; return 0; }