Problem:


Score : 100 points

Problem Statement

Rng is going to a festival.

The name of the festival is given to you as a string S, which ends with FESTIVAL, from input. Answer the question: "Rng is going to a festival of what?" Output the answer.

Here, assume that the name of "a festival of s" is a string obtained by appending FESTIVAL to the end of s.
For example, CODEFESTIVAL is a festival of CODE.

Constraints

9 \leq |S| \leq 50

S consists of uppercase English letters.

S ends with FESTIVAL.

Input

Input is given from Standard Input in the following format:

S

Output

Print the answer to the question: "Rng is going to a festival of what?"

Sample Input 1

CODEFESTIVAL

Sample Output 1

CODE

This is the same as the example in the statement.

Sample Input 2

CODEFESTIVALFESTIVAL

Sample Output 2

CODEFESTIVAL

This string is obtained by appending FESTIVAL to the end of CODEFESTIVAL, so it is a festival of CODEFESTIVAL.

Sample Input 3

YAKINIKUFESTIVAL

Sample Output 3

YAKINIKU



Sample input:
CODEFESTIVAL


Sample output:
CODE

Submission status: Runtime Error

Solution code:
from collections import defaultdict, deque

N, M = map(int, input().split())

dic = defaultdict(set)
for _ in range(M):
    A, B = map(int, input().split())
    dic[A].add(B)
    dic[B].add(A)


colors = [0]*(N+1)

def dfs():
    que = deque([(1, 1)])

    while len(que):
        v, color = que.popleft()
        colors[v] = color
        for to in list(dic[v]):
            if (color == colors[to]):
                return False
            if (colors[to] == 0):
                que.append((to, -color))
                
    return True


flag = dfs()
b = colors.count(1)

print(b*(N-b) - M if (flag) else N*(N-1)//2 - M)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)

N,M=[int(a) for a in input().split()]
AB=[[int(a) for a in input().split()] for _ in range(M)]
edges = [[] for _ in range(N)]
for a, b in AB:
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)

colors = [0]*N
def dfs(curr, c):
    colors[curr] = c
    for node in edges[curr]:
        if colors[node] == colors[curr]:
            return False
        if colors[node]== 0 and not dfs(node, -c):
            return False
    return True

if not dfs(0, 1):
    print((N*(N-1))//2 - M)
else:
    WH = [c==1 for c in colors]
    nw = sum(WH)
    print(nw*(N-nw)-sum([WH[a-1]^WH[b-1] for a, b in AB]))

Submission status: Runtime Error

Solution code:
s=input()
print(s[:-8]

Submission status: Runtime Error

Solution code:
s = input()
print(s[:(len(s)-8)]

Submission status: Runtime Error

Solution code:
s = input()
print(s[:len(s)-8]

Submission status: Runtime Error

Solution code:
s=input()
print(s-"FESTIVAL")

Submission status: Runtime Error

Solution code:
import sys
from collections import Counter
candnum=int(input())
candiff=list(map(int,input().split()))
pronum=int(input())
candiff=Counter(candiff)
prodiff=list(map(int,input().split()))
prodiff=Counter(candiff)

for k,v in prodiff.items():
    if k in candiff:
        if candiff[k]<v:
            print("NO")
            sys.exit()
    else:
        print("NO")
        sys.exit()
print("YES")

Submission status: Runtime Error

Solution code:
import sys
from collections import Counter
candnum=int(input())
candiff=list(map(int,input().split()))
pronum=int(input())
candiff=Counter(candiff)
prodiff=list(map(int,input().split()))
prodiff=Counter(candiff)
#if pronum>candnum:
#    print("NO")
#    sys.exit()
for k,v in prodiff.items():
    if k in candiff:
        if candiff[k]<v:
            print("NO")
            sys.exit()
    else:
        print("NO")
        sys.exit()
print("YES")

Submission status: Runtime Error

Solution code:
z=input
print(z[:-8])

Submission status: Runtime Error

Solution code:
z=input().split()
return z[:-8]

Submission status: Runtime Error

Solution code:
prunt(input()[:-8])

Submission status: Runtime Error

Solution code:
prunt(input[:-8])

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
res = []
count = 0
if s[0] == '1':one = 1
else:one = 0
temp = []
tar = 0

for i in range(1,n-1):
    if s[i-1:i+2] == '101':   # 碰到了101
        tar = 1
        temp.append(one)
        one = 0               # 任务重新计数
    else:
        if s[i] == '0' and tar == 1:    # 在任务中碰到了连续0，结束任务
            temp.append(one)
            res.append(temp.copy())
            temp = []
            tar = 0
        if s[i] == '1':one += 1
        else: one = 0


if s[-1] == '1':one+=1
if tar == 1:
    temp.append(one)
    res.append(temp.copy())

for x in res:
    temp = 0
    m = len(x)
    f = []
    if m == 2:temp = max(x[0],x[1])
    if m == 3:temp = max(x[0],x[1],x[2])
    if m == 4:temp = max(x[0]+x[2],x[3]+max(x[0],x[1]))
    if m >= 5:
        f.append([x[0],x[1]])
        f.append([x[1],max(x[2],x[0])])
        f.append(x[0]+x[2],x[3]+f[0])
        for i in range(3,m-1):
            f.append(x[i] + max(f[i-2][0],f[i-3][0]))
            f.append(x[i+1] + max(f[i-2][0],f[i-2][1]))
        temp = max(f[-1][0],f[-1][1],f[-2][0])

    count += temp


print(count)

Submission status: Runtime Error

Solution code:
S = input()
print(S - "FESTIVAL")

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())

L = [[0] for _ in range(a)] + [[1] for _ in range(b)] + [[2] for _ in range(c)]
while len(L) > 1:
  L[0] += L.pop()
  L.sort()
print(''.join(('a','b','c')[i] for i in L[0]))

Submission status: Runtime Error

Solution code:
foo={}
bar={}
n=int(raw_input())
for x in map(int,raw_input().split()):
    if x not in foo:
        foo[x]=0
    foo[x]+=1
n=int(raw_input())
for x in map(int,raw_input().split()):
    if x not in bar:
        bar[x]=0
    bar[x]+=1
for i in foo:
    if i not in bar:
        continue
    if foo[i]<bar[i]:
        print "NO"
        exit(0)
print "YES"

Submission status: Runtime Error

Solution code:
foo=[0]*(300000)
bar=[0]*(300000)
n=int(raw_input())
for x in map(int,raw_input().split()):
    foo[x]+=1
n=int(raw_input())
for x in map(int,raw_input().split()):
    bar[x]+=1
for i in range(200001):
    if foo[i]<bar[i]:
        print "NO"
        exit(0)
print "YES"

Submission status: Runtime Error

Solution code:

def main():
    N = int(input())
    D = [int(n) for n in input().split()]
    M = int(input())
    T = [int(n) for n in input().split()]
    d_dict = {}
    t_dict = {}
    for i in D:
        d_dict[i] = d_dict.get(i, 0) + 1
    for i in T:
        t_dict[i] = t_dict.get(i, 0) + 1

    ok = True
    for k in t_dict.keys():
        if d_dict.get(k, 0) < t_dict[k]:
            ok = False
            break

    if ok:
        print('YES')
    else:
        print('NO')


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
print input.rstrip('FESTIVAL')

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
edges=[[] for i in range(N)]
for i in range(M):
  a,b = map(int,input().split())
  edges[a-1]+=[b-1]
  edges[b-1]+=[a-1]
#print(edges)
ans=0
#奇数へいろを検出する0から(N//2)*2+1ステップ進んだ時, 0に戻れたらアウト
m=(N//2)*2+1
plist=[[] for i in range(m+1)]
plist[0]=[0]
for i in range(m):#iはステップ数
  for label in plist[i]:
    plist[i+1]+=edges[label]
  plist[i+1]=list(set(plist[i+1]))
print(plist,plist[m])
if 0 in plist[m]:
  print((N*(N-1))//2-M)#奇数要素の閉路があった場合は全ての頂点を結べる. 
else:
  if N%2==0:
    n=N//2
    print(n,n*(n-1)-M)
  else:
    n1=N//2
    n2=N//2+1
    print(n1,n2)
    print((n1*(n1-1))//2+(n2*(n2-1))//2-M)

Submission status: Runtime Error

Solution code:
s=input()
print(s[i]-s[-7])

Submission status: Runtime Error

Solution code:
s = input()
return s[:-8]

Submission status: Runtime Error

Solution code:
s = input()
return s[:-4]

Submission status: Runtime Error

Solution code:
YAKINIKUFESTIVAL