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.



Sample input:
CODEFESTIVAL


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    for i, c1 in enumerate(s):
        if c1 == 'C':
            for j, c2 in enumerate(s[i+1:]):
                if c2 == 'F':
                    print('Yes')
                    return
            else:
                print('No')
                return
    else:
        return('No')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
if ("C" in s) and ("F" in s):
    if s.index("C") < s.index("F"):
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = input()
a = ""
i, j = [s.find('C'),s.rfind('F')]

print("Yes" if i < j else "No")

Submission status: Wrong Answer

Solution code:
s = raw_input()

c = s.find('C')

s = s[::-1]

f = s.find('F')

if c < f:
    print 'YES'
else:
    print 'NO'

Submission status: Wrong Answer

Solution code:
from collections import Counter
S = raw_input().strip()
str = "No"
if 'C' in S:
  if 'F' in S:
    if S.find('C') < S.find('F'):
      str= "Yes"
print str

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    a = s.index('C')
    if a and 'F' in s[a+1:]:
        print('Yes')
    else:
        print('No')

main()

Submission status: Wrong Answer

Solution code:
s = raw_input()

i = s.index('C')
if i < 0:
    print 'No'

s = s[i:]
i = s.index('C')
if i < 0:
    print 'No'
print 'Yes'

Submission status: Wrong Answer

Solution code:

s = input()
ans = 0

if 'C' in list(s) and 'F' in list(s) and s.index('C') < s.index('F'):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
a = s.find("C")
b = s.find("F")
if 0 <= a < b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
if "C" in s and "F" in s and s.index("C") < s.index("F"):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
s = input()
print(s)
state = 0
for c in s:
    if c == 'C':
        if state == 0:
            state = 1
    if c == 'F':
        if state == 1:
            state = 2

if state == 2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

s = input()
ans = 0

if s.index('C') < s.index('F'):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=raw_input()
if "C" in s and "F" in s:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
if "C" in s and "F" in s:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
S = input()
if "CF" in S:
    print("Yes")
else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
s = input()
n = len(s)
i = 0
while i < n:
  if s[i] == "C":
    break
i += 1
while i < n:
  if s[i] == "F":
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
s = input()
f = 0
for i in range(len(s)):
  if f == 0 and s[i] == "C":
    f = 1
  if f == 1 and s[i] == "F":
    f = 2
    break
if f == 2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()
C = False

for i in range(len(s)):
    if s[i] == "C":
        C = True
    elif C and s[i] == "F":
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
import re
print("Yes" if re.search(("C.*F"),input()) else "No")

Submission status: Accepted

Solution code:
s = input()
if s.count("C")>=1 and s.count("F")>=1:
    if s.index("C")<s.index("F") or s.index("C")<len(s)-(1+s[::-1].index("F")):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
is_C = False
for i in range(len(s)):
  if s[i] == "C":
    is_C = True
  if is_C and s[i] == "F":
    print("Yes")
    exit()
  if i == len(s)-1:
    print("No")

Submission status: Accepted

Solution code:
s = input()

num = 0
flag = False
for i in range(len(s)):
    if s[i] == "C" and num == 0:
        num = 1
    elif s[i] == "F" and num == 1:
        flag = True
        break

if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
c, f = -1, -1
for i, s in enumerate(S):
    if s == 'C':
        c = i
        break
for i, s in enumerate(S[::-1]):
    if s == 'F':
        f = len(S)-i-1
        break
if c >= 0 and f >= 0 and c < f:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main():
    s = input()
    flag = True

    for i in range(len(s)):
        if flag:
            if s[i] == "C":
                flag = False
        else:
            if s[i] == "F":
                print("Yes")
                exit()
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
s=input()
n=len(s)
flg=False
flg_=False
a=0
b=0
for i in range(n):
    if s[i]=="C":
        a=i
        flg=True
        break
for i in range(n-1,-1,-1):
    if s[i]=="F":
        b=i
        flg_=True
        break
if flg and flg_ and a<b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()

    def judge():
        if "C" in S:
            idx = S.index("C")
            for char in S[idx:]:
                if char == "F":
                    return True
        return False

    print("Yes" if judge() else "No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    s=input()
    c,f=False,False
    for i in s:
        if c and i == "F":
            f=True
        elif i == "C":
            c=True
    print("Yes" if c and f else "No")
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s=str(input())
if 'C' in s and 'F' in s:
  if s.find('C')<s.rfind('F'):
    print('Yes')
  else:
    print('No')
else:
  print('No')
  exit()

Submission status: Accepted

Solution code:
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    S = input().rstrip('\n')
    a = S.find("C")
    b = S.rfind("F")
    if 0 <= a < b:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
a = len(S)
b = -1
for i in range(len(S)):
    if S[i] == "C":
        a = i
        break
for i in range(len(S)):
    if S[len(S)-i-1] == "F":
        b = len(S)-i-1
        break
if a < b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
ans = "No"
for i in range(len(s)):
    for j in range(len(s)):
        if i < j and s[i] == "C" and s[j] == "F":
            ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
s=input()
if 'C' in s:
	if 'F' in s[s.index('C'):]:
		print('Yes')
	else:
		print('No')
else:
	print('No')

Submission status: Accepted

Solution code:
s = input()
if 'C' in s and 'F' in s[s.index('C')+1:]:
    print('Yes')
    exit()
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
sw = 0
if "C" in s:
    a = s.index("C")
    if "F" in s:
        b = s[::-1].index("F")
        b = n-1 - b
        if a < b:
            sw = 1
            
print(["No","Yes"][sw])

Submission status: Accepted

Solution code:
s = input()
flg = False
for ss in s:
    if ss == "C":
        flg = True
    if ss == "F" and flg:
        print("Yes")
        break
else:
    print("No")

Submission status: Accepted

Solution code:
S = input ()
x = 0
for i in range (len(S)):
  if S[i] == 'C':
    x = 1
    break
if x == 1:
  for j in range (len(S)-i):
    if S[j+i] == 'F':
      x = 2
      break
if x == 2:
  print ('Yes')
else:
  print ('No')

Submission status: Accepted

Solution code:
s = list(input())

c = False
f = False
for i in range(len(s)):
  if s[i]=="C":
    c = True
  if c and s[i]=="F":
    f = True

if c and f:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rf = lambda: map(float, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
a = re.search(r'C.*F', s)
if a:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = input()
if "C" in n and "F" in n[n.index("C"):]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()

pos_c = s.find('C')
if pos_c >= 0 and s[pos_c:].find('F') >= 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

pos_c = s.find('C')
if pos_c >= 0 and s[pos_c:].find('F') > 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import collections


def main():
    s = list(input())
    if s.count("C") == 0 or s.count("F") == 0:
        print("No")
        return

    clen, flen = 0, 0
    for i in range(len(s)):
        if clen == 0:
            if s[i] == "C":
                clen = i
        if s[i] == "F":
            flen = i
    print("Yes" if flen > clen else "No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, math, re
from functools import lru_cache
from collections import defaultdict
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    s = input()
    n = len(s)

    for i in range(n):
        if s[i] == 'C':
            for j in range(i+1, n):
                if s[j] == 'F':
                    print('Yes')
                    return

    print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import re
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  s=pin()[:-1]
  if re.fullmatch(r"[A-Z]*C+[A-Z]*F+[A-Z]*", s)==None:
    print("No")
    return
  print("Yes")
  return

main()

Submission status: Accepted

Solution code:
s = input()
flg = 0
for i in range(len(s)):
    if s[i] == "C":
        for j in range(i,len(s)):
            if s[j] == "F":
                flg = 1
if flg == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
flag = 0
for i in range(len(S)):
    if S[i] == 'C':
        flag = 1
    elif S[i] == 'F' and flag:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

if 'C' in s and 'F' in s:
    c_index = s.index('C')
    f_index = s.rindex('F')
    if c_index < f_index:
        ans = 'Yes'
    else:
        ans = 'No'
else:
    ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
s = str(input())
cnt = 0
for i in range(len(s)):
    if s[i] == "C":
        cnt += 1
    if cnt >= 1 and s[i] == "F":
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
ans = 'No'
for i in range(n):
    for j in range(i+1,n):
        if s[i] == 'C' and s[j] == 'F':
            ans = 'Yes'
            break
print(ans)

Submission status: Accepted

Solution code:
s = input()
flag = False
for i in s:
  if i == "C":
    flag = True
  elif i == "F":
    if flag == True:
      print("Yes")
      break
else:
  print("No")

Submission status: Accepted

Solution code:
S=input()
F=0
for i in range(len(S)):
    if F==0:
        if S[i]=="C":
            F=1
    if F==1:
        if S[i]=="F":
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    S = input()
    idx = S.find('C')
    if idx == -1:
        print('No')
    else:
        i = S[idx:].find('F')
        if i == -1:
            print('No')
        else:
            print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()

if 'C' in s:
    A=s.index('C')
    for i in range(A,len(s)):
        if s[i]=='F':
            print('Yes')
            break
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

i = 0
for l in S:
    if l == 'C':
        i = 1
    if i == 1 and l == 'F':
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

S = list(input())
c_ok = False
for s in S:
    if s=='C':
        c_ok = True
    if s=='F' and c_ok:
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

in_c = False

for c in s:
    if not in_c:
        if 'C' == c:
            in_c = True
    else:
        if 'F' == c:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
s = input()
c = False
f = False
i = 0
while i < len(s):
    if s[i] == 'C':
        c = True
    elif s[i] == 'F' and c:
        f = True
        break
    i += 1
if f:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(input())
ans = "No"
for i in range(len(s)):
    if s[i] == "C":
        for j in range(i+1, len(s)):
            if s[j] == "F":
                ans = "Yes"
                break
print(ans)

Submission status: Accepted

Solution code:
def check():
  S = input()
  ind = S.find('C')
  if ind==-1:
    return 'No'
  ind2 = S[ind+1:].find('F')
  if ind2==-1:
    return 'No'
  return 'Yes'
print(check())

Submission status: Accepted

Solution code:
def solve():
    S = input()
    flag_c = False
    flag_f = False
    ans = ''
    for s in S:
        if s == 'C':
            flag_c = True
        if flag_c and s == 'F':
            flag_f = True
    if flag_c and flag_f:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
*S, = input()
ans = []

for s in S:
    if s == 'C':
        ans.append(s)
    if s == 'F':
        ans.append(s)

print('Yes' if 'CF' in ''.join(ans) else 'No')

Submission status: Accepted

Solution code:
S = input()
CFlag = False
FFlag = False
for T in S:
    if T=='C':
        CFlag = True
    if CFlag and T=='F':
        FFlag = True
        break
if FFlag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()
c=-1
f=-1
for i in range(len(s)):
  if s[i]=='C':
    if c==-1:
      c=i
  if s[i]=='F':
    f=max(f,i)
if c!=-1 and f>c:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
if "C" in s and "F" in s:
    for i in range(len(s)):
        if s[i]=="C":
            ind = i
            break
    flag = 0
    for j in range(ind,len(s)):
        if s[j]=="F":
            flag = 1
            break
    if flag==1:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
S = str(input())

if S.count('C') > 0:
	D = S.index('C')
	if S[D::].count('F') > 0:
		print('Yes')
	else:
		print('No')
else:
	print('No')

Submission status: Accepted

Solution code:
S = input()

c = 0
f = 0
for s in S:
    if s == "C":
        c = 1
    elif c and s == "F":
        f = 1
        break

if c and f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
cf = False
for si in s:
    if si =='C': cf = True
    if cf and si == 'F':
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
c = s.rfind('C')
f = s.rfind('F')
print('Yes') if c >= 0 and f >= 0 and (c - f) < 0 else print('No')

Submission status: Accepted

Solution code:
s =  list(input())
if ("C" in s and "F" in s):
    if(s.count("F") == 1):
        if(s.index("C") < s.index("F")):
            print("Yes")
        else:
            print("No")
    else:
        if(s.index("C") < s.index("F",1)):
            print("Yes")
        else:
            print("No")

else:
    print("No")

Submission status: Accepted

Solution code:
S=input()

nc=-1
nf=-1
for i in range(len(S)):
    if S[i]=='C':
        nc=i
        break
for i in range(len(S)):
    if S[i]=='F':
        nf=i

print('Yes' if nc < nf and nc>=0 and nf>=1 else 'No')

Submission status: Accepted

Solution code:
s = input()
isC = s.find('C')
ret = False
if(  isC != -1):
    if( s[isC+1:].find('F') != -1):
        ret = True
if ret:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
ans = 'No'
if 'C' in s:
    if 'F' in ''.join(s.split('C')[1:]):
        ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
s=input()
b=False
for i in s:
    if i=="C":
        b=True
    if b and i=="F":
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
s=input()
ans="No"
flag=False
for i in range(len(s)):
  if not flag and s[i]=="C":
    flag=True
  elif flag and s[i]=="F":
    ans="Yes"
    break
print(ans)

Submission status: Accepted

Solution code:
s = input()
flag = 0
for i in range(len(s)):
    if flag == 0 and s[i] == "C":
        flag += 1
    if flag == 1 and s[i] == "F":
        flag += 1
if flag == 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
num = 0
for x in s:
  if num == 0 and x == 'C':
    num += 1
  if num == 1 and x == 'F':
    num += 1
if num == 2:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
yes = False
for i in range(n):
    for j in range(i + 1, n):
        if s[i] == "C" and s[j] == "F":
            yes = True
if yes:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    s=input()
    a=s.find('C')
    if(a==-1):
        print('No')
    else:
        a2=s.find('F',a+1,len(s))
        if(a2==-1):
            print('No')
        else:
            print('Yes')

main()

Submission status: Accepted

Solution code:
s=input()
print("Yes" if 0<=s.find("C")<s.rfind("F") else "No")

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    s = SS()

    ans = 'No'
    if 'C' in s:
        idx_c = s.index('C')
        if 'F' in s[idx_c:]:
            ans = 'Yes'

    print(ans)

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys
s=str(input())
c=0
for i in s:
    if i=='C':
        c=1
    if i=='F' and c==1:
        print('Yes')
        sys.exit()

print('No')

Submission status: Accepted

Solution code:
s = input()
flag = False
for i in range(len(s)):
  if s[i]=='C':
    for j in range(i+1,len(s)):
      if s[j] == 'F':
        flag = True
        break
    if flag:
      break
if flag:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()

c_idx = len(s)
f_idx = -1
for i in range(len(s)):
    if s[i] == 'C':
        c_idx = min(c_idx, i)
    if s[i] == 'F':
        f_idx = max(f_idx, i)
print('Yes' if c_idx < f_idx else 'No')

Submission status: Accepted

Solution code:
s = input()
a = s.find("C")
b = s.rfind("F")

if -1 < a < b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range(n):
  if s[i]=="C":
    for j in range(i,n):
      if s[j]=="F":
        print("Yes")
        exit()
else:
  print("No")

Submission status: Accepted

Solution code:
s=str(input())
s=list(s)
temp=0
for i in range(len(s)):
  if s[i]=="C":
    temp=1
  if temp==1 and s[i]=="F":
    temp=2
if temp==2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import re
s = input()
s = re.sub('[^F^C]', '', s)
if s.count('CF') > 0: print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
s = list(input())
cf = ["C", "F"]
i = 0
for t in s:
    if t == cf[i]:
        i += 1
    if i == 2:
        break
print("Yes" if i == 2 else "No")

Submission status: Accepted

Solution code:
def main():
    S = input()
    c = False
    for s in S:
        if s == 'C':
            c = True
        if c and s == 'F':
            print('Yes')
            exit()
    print('No')
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
if S.count("C") > 0:
  k = S.index("C")
  if S[k+1:].count("F") > 0:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
s = input() + 'C'
t = s[::-1] + 'F'

# CF
# 最も左にある C 
# 最も右にある F

idx_C = s.index('C')
idx_F = len(s) - 1 - t.index('F')

if idx_C < idx_F:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import re
S = input()
print('No' if re.search(r'C.*F', S) is None else 'Yes')

Submission status: Accepted

Solution code:
s = input()
if 'C' in s:
    c = s.index("C")
    if "F" in s[c:]:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
import re;print(re.search('C.*F',input())and'Yes'or'No')

Submission status: Accepted

Solution code:
S=input()
import re
if re.search('C.*F',S):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
for i,c in enumerate(s):
	for j in range(len(s)-i):
		if s[i]+s[j+i] == 'CF':
			print('Yes')
			exit()
print('No')

Submission status: Accepted

Solution code:
s = input()

if 'C' in s and 'F' in s:
    if 'F' in s[s.index('C'):]:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
s=input();print("Yes" if "C" in s and "F" in s and s.index("C")<len(s)-s[::-1].index("F")-1 else "No")

Submission status: Accepted

Solution code:
s = list(input())

sc = -1
sf = -1

for i in range(len(s)):
    if s[i] == "C":
        sc = i
    elif s[i] == "F":
        sf = i

if (sc == -1) or (sf == -1):
    print("No")
elif sc < sf:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = list(input())

sc = -1
sf = -1

for i in range(len(s)):
    if s[i] == "C":
        sc = i
    elif s[i] == "F":
        sf = i

if (sc == -1) or (sf == -1):
    print("No")
elif sc < sf:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

s = input()
print("Yes" if re.search('C.*F', s) else "No")

Submission status: Accepted

Solution code:
s=input()
flag_c=False
flag_f=False
for i in range(len(s)):
  if s[i]=="C":
    flag_c=True
  if s[i]=="F" and flag_c:
    print("Yes")
    flag_f=True
    break
if not flag_f:
  print("No")

Submission status: Accepted

Solution code:
# li = list(map(int, input().split()))
s = input()
n = len(s)
a = n; b = -1;
for i in range(n):
	if s[i] == 'C':
		a = i
		break
for i in range(n-1, -1, -1):
	if s[i] == 'F':
		b = i
		break
if b < a:
	print('No')
else:
	print("Yes")

Submission status: Accepted

Solution code:
s = input()
check1 = False
check2 = False
for i in range(len(s)):
    if s[i] == "C":
        if not check1:
            check1 = True
    if s[i] == "F":
        if check1:
            check2 = True
if check1 and check2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import re
ans = re.match('.*C.*F.*', input())
print("Yes" if ans else "No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    s = input()
    n = len(s)
    c_ind = inf
    f_ind = -1
    for i in range(n):
        if s[i] == 'C':
            c_ind = i
            break
    for i in range(n-1, -1, -1):
        if s[i] == 'F':
            f_ind = i
            break
    print('Yes') if c_ind < f_ind else print('No')


if __name__ == "__main__":
    main()