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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
f = 0
for s in S:
  if f==0:
    if s=="C":
      f = 1
  elif f==1:
    if s=="F":
      f = 2
if f == 2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
print('Yes' if 'CF' in ''.join([_ for _ in input() if _=='C' or _=='F']) else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
num = 0
for i in range(len(S)):
    if num == 0 and S[i] == 'C':
        num += 1
    if num == 1 and S[i] == 'F':
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
def lcs(str1, str2):
    '''文字列str1, str2の最長共通部分列(Lowest Common Subsequence, LCS)を求める
    計算量O(len(str1)*len(str2))  
    '''
    dp = [[0]*(len(str2) + 1) for _ in range(len(str1) + 1)]
    for i in range(len(str1)):
        for j in range(len(str2)):
            if str1[i] == str2[j]:
                dp[i+1][j+1] = dp[i][j] + 1
            else:
                dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])

    '''復元を実行
    最長の長さを求めるなら return dp[len(str1)][len(str2)] をするとよい
    '''
    res = ''
    i, j = len(str1), len(str2)
    while i > 0 and j > 0:
        if dp[i][j] == dp[i-1][j]:
            i -= 1
        elif dp[i][j] == dp[i][j-1]:
            j -= 1
        else:
            res = str1[i-1] + res
            i -= 1
            j -= 1
    return res


s = input()
if len(lcs(s, "CF")) == 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
s=input()
for k in range(len(s)):
    if s[k]=='C':
        for l in range(k+1,len(s)):
            if s[l]=='F':
                print('Yes')
                sys.exit()
else:
    print('No')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

s = input()

# print(s)

# print(s.find('C'))
# print(s.find('F', 0))

index01 = s.find('C')
index02 = s.find('F', index01)

# print(index01)
# print(index02)

if index01 >= 0 and index02 >= 0:
    print('Yes')
else:
    print('No')

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=2
    print("Yes")
    exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
c_idx = s.find("C")
f_idx = s.rfind("F")
if c_idx != -1 and f_idx != -1 and f_idx-c_idx >0:
    print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
s = input()

c = s.find("C")
f = s.find("F", c)

if c != -1 and f != -1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
flag = 0

for i in s:
    if i == 'C':
        flag = 1
    if i == 'F' and flag == 1:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
# code-festival-2016-qualc
def main():
    S = input()
    flg = 0 <= S.find("C") < S.rfind("F")
    print("Yes" if flg else "No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = str(input())

flag =0
for i in range(len(s)):
  if s[i] == 'C':
    flag = 1
  elif flag == 1 and s[i] == 'F':
    print('Yes')
    exit()
  else:
    pass
else:
  print('No')

Submission status: Accepted

Solution code:
# h,w=map(int,input().split())
s=input()

flag=False
for i in range(len(s)):
    if s[i] == 'C':
        for j in range(i,len(s)):
            if s[j]=='F':
                flag=True
print('Yes' if flag else 'No')

Submission status: Accepted

Solution code:
s = input()

pc = s.find("C")
if -1 < pc and -1 < s.find("F", pc): 
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def solve():
    s = input()
    cpos = s.find('C')
    if cpos < 0:
        print('No')
        return
    fpos = s[cpos:].find('F')
    if fpos >= 0:
        print('Yes')
    else:
        print('No')

solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
print("YNeos"[not re.match('.*C.*F',input())::2])

Submission status: Accepted

Solution code:
s = input()
if 'C' in s:
    d = s.find('C')
    if 'F' in s[d:]:
        print('Yes')
        exit(0)
print('No')

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s)):
  if s[i] == "C":
    for j in range(i+1, len(s)):
      if s[j] == "F":
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
s = input()
c = s.find('C')
print('Yes' if s.rfind('F') > c and c != -1 else 'No')

Submission status: Accepted

Solution code:
# 正規表現を利用する。

import re
if re.match("[A-Z]*?C[A-Z]*?F[A-Z]*?", input()):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
s=input()[::-1]
ans="No"
try:
  c=s.index("C")
  f=s.index("F")
  if c>f:
    ans="Yes"
except:
  pass
print(ans)

Submission status: Accepted

Solution code:
c = 1000000007
f = 0
s = input()
for i in range(len(s)):
    if s[i] == 'C':
        c = min(c,i)
    if s[i] == 'F':
        f = max(f,i)
if c<f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
flag=0
for x in s:
    if flag==0 and x=="C":
        flag=1
    if flag==1 and x=="F":
        flag=2
if flag==2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
flg=False
for i in range(len(s)):
    if s[i]=='C':
        for j in range(i+1,len(s)):
            if s[j]=='F':
                print('Yes')
                exit()
print('No')
exit()

Submission status: Accepted

Solution code:
s = input()

if 'C' in s and 'F' in s:
    c = int(s.index('C'))
    f = max(int(s.index('F')), int(s.rindex('F')))
    if c <= f:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
N=input()
c=0
flag = 0
for i in N:
    if i=='C' and  c==0 :c+=1
    if i=='F' and c==1: flag=1
if flag==1:print("Yes")
else :print("No")

Submission status: Accepted

Solution code:
import re

s = input()

if re.match(r'.*C.*F', s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

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

Submission status: Accepted

Solution code:
S=input()
ans=False
c=0
for s in S:
  if c==0 and s=="C":c=1
  elif c==1 and s=="F":ans=True
print("Yes" if ans else "No")

Submission status: Accepted

Solution code:
a1 = input()
n = 0
a = [a1[i] for i in range(len(a1))]
for i in range(len(a)):
    if a[i] == 'C':
        n = 1
    if n == 1 and a[i] == 'F':
        n = 2
if n == 2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
pt_c = s.find('C')
if pt_c != -1 and s[pt_c + 1:].find('F') != -1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

c, f = False, False
for s in S:
	if s == "C":
		c = True
	if s == "F" and c:
		f = True
print(["Yes", "No"][not(all([c, f]))])

Submission status: Accepted

Solution code:
def main():
    S = input()
    try:
        c = S.index("C")
        s = S[c:].index("F")
        print("Yes")
    except:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()
mode = None
for s in S:
    if s == "C":
        mode = "C"
    elif mode == "C" and s == "F":
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
import re
s = input()
s = re.sub(r'[^CF]', '', s)
print('Yes' if re.search(r'CF', s) else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
i = 0
C = 1000
F = 0
for s in S:
    if s == 'C':
        C = min(C, i)
    elif s == 'F':
        F = max(F, i)
    i += 1
if C < F:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()
c=float('inf')
f=0
for i in range(len(s)):
    if s[i]=='C':
        c=i+1
        break

for j in range(len(s)):
    if s[-(j+1)]=='F':
        f=len(s)-j
        break
if c<f:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
c_flag = False; f_flag = False
for s in S:
    if s == 'C': c_flag = True
    elif c_flag and s == 'F': f_flag = True
print('Yes' if f_flag else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(s: str):
    sl = [i for i in list(s) if i =='C' or i == 'F']
    if(''.join(sl).count('CF') > 0):
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    solve(s)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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 re
s = input()
if re.search("C.*F", s):
    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 s[j]=="C":
            break
    if s[i]=="F" and i>j:
        ans="Yes"
print(ans)

Submission status: Accepted

Solution code:
s=input()

bool1=False

for i in range(len(s)-1):
  if s[i]=='C':
    for j in range(i+1,len(s)):
      if s[j]=='F':
        bool1=True
        
print('Yes' if bool1==True else 'No')

Submission status: Accepted

Solution code:
s=input()

bool1=False

for i in range(len(s)-1):
  if s[i]=='C':
    for j in range(i,len(s)):
      if i < j and s[j]=='F':
        bool1=True
        
print('Yes' if bool1==True else 'No')

Submission status: Accepted

Solution code:
s = input()
ans = 'No'
c = s.find('C')
if c != -1:
  f = s[c:].find('F')
  if f != -1:
    ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
S = list(input())
l = len(S)
c = 1000000000
f = 0

for i in range(l):
    if S[i] == 'C':
        c = min(c,i)
    if S[i] == 'F':
        f = max(f,i)

if c < f:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()
a=len(s)
flag=0
for i in range(len(s)):
  if s[i]=='C':
    a=i
  if s[i]=='F':
    if i>a:
      flag=1
      break
    else:
      continue 
if flag==1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
c = None
f = None

for i in range(len(s)):
    if c == None and s[i] == 'C':
        c = i
    
    if s[i] == 'F':
        f = i
        if c != None:
            break

if c == None or f == None:
    print('No')
else:
    if c > f:
        print('No')
    else:
        print('Yes')

Submission status: Accepted

Solution code:
s = input()

c = s.find('C')
f = s.rfind('F')

bl = (c != -1) and (f != -1) and (c < f)
answer = 'Yes' if bl else 'No'
print(answer)

Submission status: Accepted

Solution code:
import sys
s = input()

for i, c in enumerate(s):
  if c == 'C':
    for j in s[i:]:
      if j=='F':
      	print('Yes')
      	sys.exit()
    print('No')
    sys.exit()
print('No')

Submission status: Accepted

Solution code:
s = input()
ans = "No"
if s.count("C") > 0:
	if s[(s.index("C")):].count("F") > 0:
		ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
s = input()
if -1 < s.find('C') < s.rfind('F'):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
if 'C' in S[:-1]:
    a = S.index('C')
    if 'F' in S[a:]:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

S = input()

flag = 0
for i in range(1, len(S)): #len(S)-1までに見つからないとあふれる
  if 'C' in S[:i]:
    if 'F' in S[i:]:
      print('Yes')
      exit()
print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
A - CF
https://atcoder.jp/contests/code-festival-2016-qualc/tasks/codefestival_2016_qualC_a

"""
import sys


import re

def solve(s):
    if re.search(r'C.*F', s):
        return 'Yes'
    return 'No'


def main(args):
    s = input()
    ans = solve(s)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
A - CF
https://atcoder.jp/contests/code-festival-2016-qualc/tasks/codefestival_2016_qualC_a

"""
import sys


def solve(s):
    c_positions = [float('inf')]
    f_positions = [float('-inf')]
    for i, ch in enumerate(s):
        if ch == 'C':
            c_positions.append(i)
        elif ch == 'F':
            f_positions.append(i)
    c_positions.sort()
    f_positions.sort()
    if c_positions[0] < f_positions[-1]:
        return 'Yes'
    return 'No'


def main(args):
    s = input()
    ans = solve(s)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
n = input()

cflag = False

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

print('No')

Submission status: Accepted

Solution code:
s = 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'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/06/02
# CODE FESTIVAL 2016 qual C - A

# Input
s = input()

findflg = 0
for i in range(len(s)):
    if findflg == 0 and s[i] == "C":
        findflg = 1
    elif findflg == 1 and s[i] == "F":
        findflg = 2
        break

if findflg == 2:
    ans = "Yes"
else:
    ans = "No"

# Output
print(ans)

Submission status: Accepted

Solution code:
from sys import exit, stdin
S = list(stdin.readline().rstrip())
ci, cf = 0, 0
if 'C' in S and 'F' in S:
    for i, c in enumerate(S):
        if c == 'C':
            ci = i
        elif c == 'F':
            cf = i
    if ci < cf:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
s=input()
c=s.find('C')
if c==-1:
     print('No')
     sys.exit()
s=s[::-1]
f=s.find('F')
if f==-1:
     print('No')
     sys.exit()
f=len(s)-f-1
if f>c:
     print('Yes')
else:
     print('No')

Submission status: Accepted

Solution code:
s = input()

c = s.find("C")
f = s.rfind("F")

if (c == -1 or f == -1 or f < c) :
    print("No")
else :
    print("Yes")

Submission status: Accepted

Solution code:
s=input()
c=[]
f=[]
for num in range(len(s)):
    if s[num] == 'C':
        c.append(num)
    if s[num] == 'F':
        f.append(num)
        
if 'C' in s and 'F' in s:
	print('Yes') if min(c) < max(f) else print('No')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
S = input()
print(["Yes", "No"][re.match(".*C.*F.*", S) is None])

Submission status: Accepted

Solution code:
s = input()
try:
    if s.index('C') < len(s)-s[::-1].index('F')-1:
        print('Yes')
    else:
        print('No')
except:
    print('No')

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
#以下てんぷら
def j(q):
    if q==1: print("Yes")
    elif q == 0:print("No")
    exit(0)
rem = pow(10,9)+7
"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


#n = ip()                                     #入力整数1つ
#a,b,c,k= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#全足しに4 3sum変数使用はsum関数使用できないので注意
step = 0
for i in range(len(a)):
    if step:
        if a[i] == 'F':j(1)
    else:
        if a[i] == 'C':step+=1
j(0)

Submission status: Accepted

Solution code:
S = input()
c = S.find('C')
f = S[c:].find('F')+c
if c < 0 or f < 0:
    print('No')
    exit()
print('Yes' if f-c > 0 else 'No')

Submission status: Accepted

Solution code:
def solve():
	s = input()
	for i in range(len(s)-1):
		if s[i:i+1]=='C':
			for j in range(i+1, len(s)):
				if s[j:j+1]=='F':
					print('Yes')
					return
	print('No')
	return

solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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()
n=1000
m=0
for i in range(len(s)):
    if s[i]=="C":
        n=min(n,i)
    if s[i]=="F":
        m=max(m,i)
if n<m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
flag = False
ans = "No"
for s in S:
    if s == "C":
        flag = True
    if s == "F" and flag == True:
        ans = "Yes"
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
c = s.find('C')
f = len(s) - s[::-1].find('F') - 1
if c < f and c != -1 and f != len(s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
flag = False
flag1 = True
flag2 = False
for i in range(len(s)):
    if flag1 and s[i] == 'C':
        flag1 = False
        flag2 = True
    if flag2 and s[i] == 'F':
        flag = True
        break
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if s.count('C') == 0 or s.count('F') == 0:
    print('No')
else:
    s = s[s.find('C'):]
    if s.count('F') == 0:
        print('No')
    else:
        print('Yes')

Submission status: Accepted

Solution code:
s= input()
a=-1
b=-1
for i in range(len(s)):
  if s[i]=='C':
    a = i
  elif s[i]=='F':
    b = i
if a>=0and a<b:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys, re

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

s=input()
# 任意の0文字以上
if re.match('.*C.*F.*', s):
    Yes()
else:
    No()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
string = ''
for i in s:
    if i == 'C' or i == 'F':
        string += i
print('Yes' if 'CF' in string else 'No')

Submission status: Accepted

Solution code:
a=input()
c,f=a.find('C'),a.rfind('F')
print("Yes" if not c==-1 and not f==-1 and c<f else "No")

Submission status: Accepted

Solution code:
s = list(input())
flg = 0
cf = 0
for i in s:
    if i == 'C':
       flg = 1
    if i == 'F' and flg == 1:
        cf = 1
if cf == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()

if a.find('C')<a.rfind('F')and 'C'in a and 'F'in a:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
ans  = 0
for i in s:
    if i == 'C':
        ans = 1
    if ans == 1 and i == 'F':
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
s = list(input())
ans = ''
for i in s:
    if i in 'C':
        ans += i
    elif i in 'F':
        ans += i
print('Yes' if 'CF' in ans else 'No')

Submission status: Accepted

Solution code:
s = input()
flag = False
for i in range(len(s)):
    if s[i] == "C":
        flag = True
        break


if flag:
    flag = False
    for j in range(len(s)-1, -1, -1):
        if s[j] == "F":
            flag = True
            break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
print('Yes') if len(re.compile(r'.*C.*F.*').findall(input()))>=1 else print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = ""
res = "No"
for s in S:
  if(ans == ""):
    if(s == "C"):
      ans += s
  if(ans == "C"):
    if(s == "F"):
      ans += s
  if(ans == "CF"):
    res = "Yes"
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

x = ""
for ch in s:
    if x == "" and ch == "C":
        x = "C"
    elif x == "C" and ch == "F":
        x = "CF"
ans = x == "CF"

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

Submission status: Accepted

Solution code:
S = input()

res = 'No'
flag = False
for i in range(len(S)):
    if S[i] == 'C':
        flag = True
    if  flag == True and S[i] == 'F':
        res = 'Yes'
        break
        
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
a=b=''
for i in s:
  if a=='':
    if i=='C':
      a=i
  else:
    if i=='F':
      b=i
      break
if a=='C' and b=='F':
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
a = input()
s = 0
t = 0
for i in a:
  if i == "C":
    s=1
  if i == "F" and s==1:
    t = 1
if t == 1:
  print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
ss = input()

iC = ss.find('C')
iF = ss.rfind('F')
#print(iC, iF)

if iC != -1 and iF != -1 and iC < iF:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())
try:
    k = s.index("C")
    try:
        s.index("F",k,len(s))
        print("Yes")
    except:
        print("No")
except:
    print("No")

Submission status: Accepted

Solution code:
a=input()
c=False
f=False
for i in range(len(a)):
    if c==True:
        if a[i]=='F':
            f=True
    else:
        if a[i]=='C':
            c=True
if c==True and f==True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
ans = 'No'
if 'C' in s and 'F' in s:
 tmp1 = s.find('C')
 tmp2 = s.rfind('F')
 if tmp2 > tmp1:
  ans ='Yes'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h=input()
c=0
d=0
for i in range(len(h)):
    if h[i]=="C":
        c=1
    if c==1 and h[i]=="F":
        d=1
print("No" if d!=1 else"Yes")

Submission status: Accepted

Solution code:
s=input();pd=0
for i in range(0,len(s)):
    if s[i]=='C':
        pd=1
    if s[i]=='F'and pd==1:
        print('Yes')
        pd=2
        break
if pd!=2:
    print('No')

Submission status: Accepted

Solution code:
s = input()
a = s.find('C')

if a == -1:
    print("No")
else:
    if s[a:].find('F') == -1:
        print("No")
    else: print("Yes")

Submission status: Accepted

Solution code:
S = input()
fc = False
ff = False
for s in S:
  if s == "C":
    fc = True
  if s == "F" and fc == True:
    ff = True

print("Yes" if fc == True and ff == True else "No")

Submission status: Accepted

Solution code:
string=str(input())
swich1=0
swich2=0
final_swich=0
for i in range(len(string)):
    if string[i]=='C':
        swich1=1
    elif swich1==1 and string[i]=='F':
        swich2=1
        print("Yes")
        final_swich=1
        break
if final_swich==0:
    print("No")

Submission status: Accepted

Solution code:
s = input()
a = s.find('C')
if a == -1:
    print("No")
else:
    if s[a:].find('F') == -1:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#AT2084
s = input()
if -1 < s.find("C") <= s.find("F",s.find("C")):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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