Problem:
Score : 100 points

Problem Statement

This contest is CODEFESTIVAL, which can be shortened to the string CF by deleting some characters.

Mr. Takahashi, full of curiosity, wondered if he could obtain CF from other strings in the same way.

You are given a string s consisting of uppercase English letters.
Determine whether the string CF can be obtained from the string s by deleting some characters.

Constraints

2 ≤ |s| ≤ 100

All characters in s are uppercase English letters (A-Z).

Input

The input is given from Standard Input in the following format:

s

Output

Print Yes if the string CF can be obtained from the string s by deleting some characters.
Otherwise print No.

Sample Input 1

CODEFESTIVAL

Sample Output 1

Yes

CF is obtained by deleting characters other than the first character C and the fifth character F.

Sample Input 2

FESTIVALCODE

Sample Output 2

No

FC can be obtained but CF cannot be obtained because you cannot change the order of the characters.

Sample Input 3

CF

Sample Output 3

Yes

It is also possible not to delete any characters.

Sample Input 4

FCF

Sample Output 4

Yes

CF is obtained by deleting the first character.

Solution in C++ (GCC 5.4.1) (judge verdict: Accepted)

#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
 int q,p,w[1000001],u[1000001],o;
 string a;
 int main()
 {
     cin>>a;//首先输入字符串
     for (int i=0;i<a.size();i++)//从0位开始循环
     {
         if (a[i]=='C') 
         {
             p++;
             u[p]=i+1;
         }//判断是否发现C这个东西，并统计其位置
         else if (a[i]=='F')
         {
            q++;
             w[q]=i+1;
         }
     }//判断是否发现F，同理 统计位置情况
     if (q>=1 && p>=1)
     {
     for (int i=1;i<=p;i++)
     {
         for (int j=1;j<=q;j++)
         {
             if (u[i]<w[j])
             {
                 o=1;
             }
         }
     }//循环，找到C是否在F的前面
     if (o==1) cout<<"Yes"<<endl;//在前面则Yes
     else cout<<"No"<<endl;//否则No   
     }
     else cout<<"No"<<endl;//不存在两个数，直接No
     //以上为全部过程，希望能理解。
 }