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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, 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, insort, insort_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
from decimal import *

s = input()

for i in range(len(s)):
	if s[i] == "C" and 1 <= s[i+1:].count("F") :
		print("Yes")
		break
else:
	print("No")

Submission status: Accepted

Solution code:
import re
s = input()
m = re.compile('[A-Z]*C[A-Z]*F[A-Z]*')
if m.fullmatch(s):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
c=101
f=0
for i in range(len(s)):
    if s[i]=="C":
        c=min(c,i)
    elif s[i]=="F":
        f=max(f,i)

if s.count("C")>=1 and s.count("F")>=1 and f-c>0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def resolve():
    S = input()
    c = 0
    f = 0
    C = []
    F = []
    for i in range(len(S)):
        if S[i] == "C":
            c = 1
            C.append(i)
        elif S[i] == "F":
            f = 1
            F.append(i)
    print("Yes" if c == 1 and f == 1 and min(C) < max(F) else "No")
resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    S = list(input())
    flag = False
    for s in S:
        if s == 'C':
            flag = True
        else:
            pass
        if flag and s == 'F':
            print('Yes')
            break
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
i = 0
while i < len(s):
    if s[i] == 'C':
        j = i + 1
        while j < len(s):
            if s[j] == 'F':
                print('Yes')
                exit(0)
            j = j + 1
    i = i + 1

print('No')

Submission status: Accepted

Solution code:
s = input()
c = 0
f = 0
for i in range(len(s)):
    if s[i] == 'C':
        c += 1
    elif s[i] == 'F' and c > 0:
        f += 1

if f > 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = list(input())
x = 0

for c in s:
    if c == "C":
        x = 1
    elif c == "F" and x == 1:
        print("Yes")
        exit()

print("No")

Submission status: Accepted

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
id = -1
if 'C' in S:
  id = S.index('C')
  if 'F' in S[id:]:
    print("Yes")
  else:
    print("No")
else:
  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":
        print("Yes")
        exit()
else:
  print(ans)

Submission status: Accepted

Solution code:
s = input()
f = []
c = []
for i in range(len(s)):
    if s[i] == "F":
        f.append(i)
    elif s[i] == "C":
        c.append(i)
if f and c and (max(f)-min(c) > 0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
s = input()
reg = '[A-Z]*C[A-Z]*F[A-Z]*'
res = re.fullmatch(reg, s)
if res:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


s = S()
ans = ''
if 'C' in s:
    ans += 'C'
    if 'F' in s[s.find('C'):]:
        ans += 'F'
if ans == 'CF':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


s = S()
ans = ''
if 'C' in s:
    ans += 'C'
    if 'F' in s[s.index('C'):]:
        ans += 'F'
if ans == 'CF':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()
if s[:-1].count("C")>=1:
    x=s.index("C")
    if s[x:].count("F")>=1:
        print("Yes")
    else:
        print("No")
else:
    print("No")
    exit()

Submission status: Accepted

Solution code:
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580

def solve():
    str = (input().rstrip())
    FC = INF
    LF = 0
    for x in range(len(str)):
        if(str[x] == 'C'):
            FC = min(FC,x+1)
        if(str[x] =='F'):
            LF = max(LF,x+1)
    
    if(FC*LF > 0 and LF > FC):
        print("Yes")
    else:
        print("No")


    print("")
if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)

f = 0
for i in range(n):
    if s[i] == 'C' and f == 0:
        f += 1
    if s[i] == 'F' and f == 1:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

# A - CF
s = input()
n = s.find('C')

if n > -1:
	if 'F' in s[n:]:
		print('Yes')
		exit()

print('No')

Submission status: Accepted

Solution code:
s = input()
idx = 0
flg = False
for i in range(len(s)):
  if s[i] == 'C':
    idx += 1
  elif s[i] == 'F' and idx > 0:
    flg = True
    break
if flg:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()
a = 0
for s in S:
    if a == 0 and s == 'C':
        a += 1
    if a == 1 and s == 'F':
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
c=False
f=False
s=input()
for i in s:
    if i=="C":
        c=True
    if i=="F" and c==True:
        f=True

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

Submission status: Accepted

Solution code:
val = input()
count = 0
for i in range(len(val)):
    if val[i] == "C":
        for n in range(i+1, len(val)):
            if val[n] == "F" and count == 0:
                print("Yes")
                count += 1
if count == 0:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    s = input().rstrip()
    N = len(s)

    i_C = -1
    for i in range(N):
        if s[i] == "C":
            i_C = i
            break
    i_F = -1
    for i in reversed(range(N)):
        if s[i] == "F":
            i_F = i
            break

    if i_C == -1 or i_F == -1:
        ans = "No"
    elif i_C < i_F:
        ans = "Yes"
    else:
        ans = "No"
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
flag = "off"
for i in s:
    if i == "C":
        flag = "on"
    if flag == "on" and i == "F":
        print("Yes")
        exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import sys
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
        s=list(input())
        ls=len(s)
        for i in range(ls-1):
            for j in range(i+1,ls):
                if s[i]=='C' and s[j]=='F':
                    return 'Yes'
        return 'No'
    print(main())
    
resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input()) #sys.stdin.readlineは最後が改行

def my_index(l, x, default=-1):
    if x in l:
        return l.index(x)
    else:
        return default

while True:
    cc = my_index(s,'C')
    ff = my_index(s,'F')
    if cc == -1 or ff ==-1:
        print('No')
        exit()
    if cc < ff:
        print('Yes')
        exit()
    else:
        s.pop(ff)

Submission status: Accepted

Solution code:
s = input()
c = s.find("C")
if c == -1:
    print("No")
    exit()
f = s.find("F", c+1)
if f == -1:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
import re
s = input()
t = []
for ch in s:
    if ch == 'C' or ch == 'F':
        t.append(ch)
t = "".join(t)
if "CF" in t:
    print("Yes")
else:
    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:
import sys
def input(): return sys.stdin.readline().strip()
def resolve():
    s=input()
    if 'C' in s:
        if 'F' in s[s.index('C'):]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
resolve()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    s=input()
    num=0
    for i in s:
        #'C'がまだ見つかっていない状態：num=0
        #'C'が見つかって'F'がまだ見つかっていない状態:num=1
        #'C'が見つかってから'F'が見つかった状態:num=2
        #num==0のときに'C'が見つかったらnumを１にする
        #num==１のときに'F'が見つかったらnumを２にする
        if i=='C' and num==0:
            num+=1
        if i=='F' and num==1:
            num+=1
    if num==2:
        print('Yes')
    else:
        print('No')
resolve()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
       s=input()
       for i in range(len(s)):
           for j in range(i+1,len(s)):
               if s[i]=='C' and s[j]=='F':
                   return 'Yes'
       return 'No'
    print(main())
resolve()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    s=input()
    a=s.find('C')
    b=s.rfind('F')
    if a==-1 or b==-1:
        print('No')
    else:
        if a<b:
            print('Yes')
        else:
            print('No')
resolve()

Submission status: Accepted

Solution code:
s = input()

a = s.find("C")
b = s.rfind("F")
if a == -1 or b == -1:
	print ("No")
else:
	if a < b:
		print ("Yes")
	else:
		print ("No")

Submission status: Accepted

Solution code:
s = input()
sc = ''
c = 0

for i in range(len(s)):
  if 'C' == s[i]:
    sc = s[i+1:]
    for j in range(len(sc)):
      if 'F' == sc[j]:
        c += 1

if c > 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
a=input()
ans=int()
for i in range(len(a)):
    if 'C' in a[i]:
        b=a[i+1:]
        for j in range(len(b)):
            if 'F' in b[j]:
                ans+=1
print('Yes' if ans>0 else '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:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    s = input()
    flg = False
    for i in s:
        if i == "C":
            flg = True

        if flg and i == "F":
            print("Yes")
            break
    else:
        print("No")


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
if 'C' in S and 'F' in S:
    l=S.index('C')
    r=-1
    for i in reversed(range(len(S))):
        if S[i]=='F':
            r=i
            break
    if r==-1 or l>=r:
        print('No')
    else:
        print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    s = input().rstrip()
    res = 0
    for i in s:
        if i=='C' and res==0:
            res += 1
        if i=='F' and res==1:
            res += 1
    if res==2:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import re

s = input()
p = re.compile('C.*F')
m = re.search(p, s)
print('Yes' if m is not None else 'No')

Submission status: Accepted

Solution code:
s = input()
C = False

ans = 'No'
for i in s:
    if i == 'C':
        C = True

    if i == 'F' and C:
        ans = 'Yes'
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

C = []
F = []
for i, s in enumerate(S):
    if s == "C":
        C.append(i)
    elif s == "F":
        F.append(i)

if len(C) > 0 and len(F):
    if min(C) < max(F):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(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:
S = [x for x in input()]
flg=False
for i in range(len(S)-1):
    for j in range(i+1, len(S)):
        if S[i]=='C' and S[j]=='F':
            flg=True
            break
ans='Yes' if flg else 'No'
print(ans)

Submission status: Accepted

Solution code:
s = input()

ans = False
found_c = False
for l in s:
    if found_c:
        if l == 'F':
            ans = True
            break
    else:
        if l == 'C':
            found_c = True
print('Yes' if ans else 'No')

Submission status: Accepted

Solution code:
s = input()
f = 0
for c in s:
    if f == 0 and c == 'C':
        f = 1
    elif f == 1 and c == 'F':
        f = 2
        break
if f == 2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

iC = s.find('C')
if iC < 0:
    print("No")
    exit()

iF = s[iC:].find("F")
if iF < 0:
    print("No")
    exit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

s = list(input())
cm = []
fM = []
for i, j in enumerate(s):
    if j == "C":
        cm.append(i)
    if j == "F":
        fM.append(i)
if "C" not in s or "F" not in s:
    print("No")
    sys.exit()
if max(fM) - min(cm) > 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):#aはbの累乗数か
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
############################################
s=input()
if "C" in s and "F" in s:
    Yn(s.index("C")<len(s)-1-s[::-1].index("F"))
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    s =input()


    if "C" in s and "F" in s and "F" in  s[s.index("C"):] :
        print("Yes")
    else:
        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()
if 'C' in s:
    n = s.index('C')
    if 'F' in s[n:]:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
def main():
    word = input()
    index = [word.find("C"), 0]
    if index[0] >= 0:
        index[1] = word.find("F", index[0])
    print("Yes" if index[0] >= 0 and index[1] >= 0 else "No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    s = S()
    ans = [0, 0]
    for i in s:
        ans[0] |= i == "C"
        ans[1] |= i == "F" and ans[0]
    print("Yes" if ans[1] else "No")
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

a = []

for i in s:
    if i == "C" or i == "F":
        a.append(i)
a = "".join(a)
if a.count("CF") > 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = 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()
if "C" in s and "F" in s and s.find("C")<len(s)-1-s[::-1].find("F"):
    print("Yes")

else: print("No")

Submission status: Accepted

Solution code:
S = input()
flag = False
for s in S:
    if s == "C":
        flag = True

    if flag:
        if s == "F":
            print("Yes")
            break
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(input())

if ("C" in l) & ("F" in l):
  if min([i for i, x in enumerate(l) if x == 'C']) < max([i for i, x in enumerate(l) if x == 'F']):
  	print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
c  = 0
s = input()
for i,si in enumerate(s):
  if si == "C":
    c = 1
  elif si == "F" and c:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
s = input()
res = ""
for letter in s:
    if res == "" and letter =="C":
        res += letter
    elif res =="C" and letter == "F":
        res +=letter
        break
    else:
        continue
if res == "CF":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
res = ""
for letter in s:
    if res == "" and letter =="C":
        res += letter
    elif res =="C" and letter == "F":
        res +=letter
        break
    else:
        continue
if res == "CF":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# Problem A - CF

# input process
S = input()

# initialization
is_ok_1 = False
is_ok_2 = False

# str count process
for s in S:
    if s=="C":
        is_ok_1 = True

    if is_ok_1 and s=="F":
        is_ok_2 = True

# output process
if is_ok_2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
flag = 0
ans = "No"

for i in range(len(s)):
    if s[i] == "C":
        flag = 1

    if flag == 1 and s[i] == "F":
        ans = "Yes"
        break

print(ans)

Submission status: Accepted

Solution code:
s = input()
cf = ""
for e in s:
    if e in ["C", "F"]:
        cf += e

if cf.count("CF"):
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    s = input().rstrip()
    a, b = len(s), -1
    for i in range(len(s)):
        if s[i] == "C":
            a = i
            break
    for i in reversed(range(len(s))):
        if s[i] == "F":
            b = i
            break
    if a < b:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
S = input()


if S.count("C") != 0 and S.count("F") != 0:
    pass
else:
    print("No")
    sys.exit()

ans = 0
for i in range(len(S)):
    if S[i] == "C":
        if S[i:len(S)].count("F") != 0:
            print("Yes")
            sys.exit()

print("No")

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	s = input()
	if s.count('C') == 0 or s.count('F')==0:
		return 'No'
	ii=s.index('C')
	k=s[ii+1:]
	if k.count('F')>0:
		return 'Yes'
	return 'No'
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
S = input()

c = []
f = []

for i, si in enumerate(S):
    if si == 'C':
        c.append(i)
    elif si == 'F':
        f.append(i)

if len(c) == 0 or len(f) == 0:
    print('No')
elif min(c) < max(f):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

cpos = -1
# fpos = 0
ans = False

for i, si in enumerate(S):
    if si == 'C':
        cpos = i
        break

if cpos >= 0:
    fpos = -1
    for i, si in enumerate(S):
        if si == 'F':
            fpos  = i
    if fpos > cpos:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

C = False
# F = False
ans = False
for si in S:
    if si == 'C':
        C = True
    if C and si == 'F':
        ans = True

if ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()
if 'C' in s:
  i=s.index('C')
  print('NYoe s'['F' in s[i+1:]::2])
else:
  print('No')

Submission status: Accepted

Solution code:
s=list(input())
cflag=0
fflag=0

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