Problem:


Score : 100 points

Problem Statement

CODE FESTIVAL 2016 is going to be held. For the occasion, Mr. Takahashi decided to make a signboard.

He intended to write CODEFESTIVAL2016 on it, but he mistakenly wrote a different string S. Fortunately, the string he wrote was the correct length.

So Mr. Takahashi decided to perform an operation that replaces a certain character with another in the minimum number of iterations, changing the string to CODEFESTIVAL2016.

Find the minimum number of iterations for the rewrite operation.

Constraints

S is 16 characters long.

S consists of uppercase and lowercase alphabet letters and numerals.

Input

Inputs are provided from Standard Input in the following form.

S

Output

Output an integer representing the minimum number of iterations needed for the rewrite operation.

Sample Input 1

C0DEFESTIVAL2O16

Sample Output 1

2

The second character 0 must be changed to O and the 14th character O changed to 0.

Sample Input 2

FESTIVAL2016CODE

Sample Output 2

16



Sample input:
C0DEFESTIVAL2O16


Sample output:
2

Submission status: Runtime Error

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

cnta=0
cntb=0

for i in range(n):
    if s[i]=="a":
        if cnta+cntb<a+b:
            print("Yes")
            cnta+=1
        else:
            print("No")
    elif s[i]=="b":
        if cntb<b and cnta+cntb<a+b:
            print("Yes")
            cntb+=1
        else:
            print("No")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
s = input()
a = 'CODEFESTIVAL2016'
b = 0
for i in range(16):
  if a[i] != b[i]:
    b += 1
print(b)

Submission status: Runtime Error

Solution code:
N, A, B = (int(x) for x in input().split())

x = input()
y = list(x)
count_a = 0
count_b = 0

for i in range(0, N):
    if (y[i] == "a"):
        if(count_a + count_b < (A + B)):
            print("Yes")
            count_a += 1
        else:
            print("No")
    
    elif(y[i] == "b"):
        if(count_a + count_b < (A + B) and count_b < B):
            print("Yes")
            count_b += 1
        else:
            print("No")
    
    elif(y[i] == "c"):
        print("No")

Submission status: Runtime Error

Solution code:
N, A, B = map(int,input().split())
S = input()

a_counter = 0
b_counter = 0

for i in range(N):
  s = S[0]
  if s == "a" and a_counter + b_counter <=A+B:
    a_counter += 1
    print("Yes")
  elif s == "b" and b_counter <= B and a_counter + b_counter <=A+B:
    b_counter += 1
    print("Yes")
  else:
    print("No")
  
  S = S[1:]

Submission status: Runtime Error

Solution code:
s="CODEFESTIVAL2016"
t=input()
ans=0
for c1,c2 in zip(s,t):
  if c1!=c2 : ns+=1
print(ans)

Submission status: Runtime Error

Solution code:
x = list(map(int, input().split()))
s = list(input())
y = len(s)


for i in (0,y - 1):
         if s[i] == "c":
             print("NO")
         elif s[i] == "b":
             if i < x[1] + x[2] and i < x[2]:
                 print("YES")
             else:
                 print("NO")
         else:
             if i < x[1] + x[2]:
                 print("YES")
             else:
                 print("NO")

Submission status: Runtime Error

Solution code:
s=input()
ans=0
if s[0]=='C':
    ans+=1
if s[1]='O':
    ans+=1
if s[2]='D':
    ans+=1
if s[3]='E':
    ans+=1
if s[4]='F':
    ans+=1
if s[5]='E':
    ans+=1
if s[6]='S':
    ans+=1
if s[7]='T':
    ans+=1
if s[8]='I':
    ans+=1
if s[9]='V':
    ans+=1
if s[10]='A':
    ans+=1
if s[11]='L':
    ans+=1
if s[12]='2':
    ans+=1
if s[13]='0':
    ans+=1
if s[14]='1':
    ans+=1
if s[15]='6':
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
ans = 'CODEFESTIVAL2016'
cnt = 0
for i in range(n):
  if s[i] != ans[i]:
    cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
s = input()
ans = 'CODEFESTIVAL2016'
cnt = 0
for i in range(n):
  if s[i] = != ans[i]:
    cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
a = 'CODEFESTIVAL2016'
b = input()
lista = list(a)
listb = list(b)
count = 0
for i in range(len(lista)):
  if lista[i]!=listb[i]:
    count++
print(count)

Submission status: Runtime Error

Solution code:
s=input()
ans="CODEFESTIVAL2016"
ans=0
for i in range(16):
	if s[i]!=ans[i]:
		ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
a='CODEFESTIVAL2016'
cnt=0
for i in range(len(s)):
    if s[i]!=a[i]:
        cnt+=1
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
K = "CODEFESTIVAL2016"
sum = 0
for i in range(len(S)):
  if S[i] != K[i]
  sum += 1
print(sum)

Submission status: Runtime Error

Solution code:
S = list(input())

C = list(CODEFESTIVAL2016)

cnt = 0
for i in range(len(C)):
    if S[i] != C[i]:
        cnt += 1
print(cnt)

Submission status: Runtime Error

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

W,H=map(int,input().split())
p=sorted(int(input()) for i in range(W))
q=sorted(int(input()) for i in range(H))
ans=sum(p)*(H+1)+sum(q)*(W+1)
for i in range(W+H):
  if p[len(p)-1]>=q[len(q)-1]:
    ans-=p[len(p)-1]*len(q)
    p.pop()
    if p==[]:
      print(ans)
      exit()
  else:
    ans-=q[len(q)-1]*len(p)
    q.pop()
    if q==[]:
      print(ans)
      exit()

Submission status: Runtime Error

Solution code:
S1=input()
S2='CODEFESTIVAL2016'

ans=0
for i in len(S1):
    if S1[i]!=S2[i]:
        ans+=1

print(ans)

Submission status: Runtime Error

Solution code:
S1=input()
S2='CODEFESTIVAL2016'

ans=0
for i in len(S):
    if S1[i]!=S2[i]:
        ans+=1

print(ans)

Submission status: Runtime Error

Solution code:
s= input()
ss ="CODEFESTIVAL2016"
t = 1
for i in range(ss):
  if s[i]!=ss[i]:
    t +=1
print(t)

Submission status: Runtime Error

Solution code:
s= input()
ss ="CODEFESTIVAL2016"
t = 1
for i in range(s):
  if s[i]==ss[i]:
    t +=1
print(t)

Submission status: Runtime Error

Solution code:
s= input()
ss =‘CODEFESTIVAL2016’
t = 1
for i in range(s):
  if s[i]==ss[i]:
    t +=1
print(t)

Submission status: Runtime Error

Solution code:
a=input()
ans="CODEFESTIVAL2016"
diff=0
for i in range(16):
  if a[i]!=ans[i]:
    diff++
print(diff)

Submission status: Runtime Error

Solution code:
s=input()
t="CODEFESTIVAL2016"
ret=0
for i range(s.len()):
  if s[i] != t[i]:
    ret+=1
print(ret)

Submission status: Runtime Error

Solution code:
S = input()
ans = "CODEFESTIVAL2016"
a = 0
for i in range(S):
  if S[i] != ans[i]:
    a += 1
print(a)

Submission status: Runtime Error

Solution code:
x, y = map(int, input().split())
print(sum(a != b for a, b in zip(input(), 'CODEFESTIVAL2016')))

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <fstream>
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string> 
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define REP(i,n) for(int i = 0; i < int(n); i++)
#define REREP(i,n) for(int i = int(n - 1); i >= 0; i--)
#define FOR(i, m, n) for(int i = int(m);i < int(n);i++)
#define REFOR(i, m, n) for(int i = int(n - 1);i >= int(m);i--)
#define ALL(obj) (obj).begin(),(obj).end()

#define VI vector<int>
#define VVI vector<vector<int>>
#define VVVI vector<vector<vector<int>>>
#define VD vector<double>
#define VVD vector<vector<double>>
#define VVVD vector<vector<vector<double>>>
#define VL vector<ll>
#define VVL vector<vector<ll>>
#define VVVL vector<vector<vector<ll>>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define VVVB vector<vector<vector<bool>>>
#define VS vector<string>
#define VVS vector<vector<string>>
#define VVVS vector<vector<vector<string>>>

#define PII pair<int,int>
#define PDD pair<double,double>
#define PLL pair<ll,ll>
#define VPII vector<pair<int,int>>
#define VVPII vector<vector<pair<int,int>>>
#define VVVPII vector<vector<vector<pair<int,int>>>>
#define VPLL vector<pair<ll,ll>>
#define VVPLL vector<vector<pair<ll,ll>>>
#define VVVPLL vector<vector<vector<pair<ll,ll>>>>

const ll MOD = (ll)1e9 + 7; // 998244353
const ll HINF = (ll)1e18;
const ll LINF = (ll)1e9;
const long double PI = 3.1415926535897932384626433;


void YN(bool flag) {
	cout << ((flag) ? "YES" : "NO") << endl;
}

void Yn(bool flag) {
	cout << ((flag) ? "Yes" : "No") << endl;
}

void yn(bool flag) {
	cout << ((flag) ? "yes" : "no") << endl;
}

int main() {
	string s; cin >> s;
	int ans = 0;
	if (s[0] != 'C')ans++;
	if (s[1] != 'O')ans++;
	if (s[2] != 'D')ans++;
	if (s[3] != 'E')ans++;
	if (s[4] != 'F')ans++;
	if (s[5] != 'E')ans++;
	if (s[6] != 'S')ans++;
	if (s[7] != 'T')ans++;
	if (s[8] != 'I')ans++;
	if (s[9] != 'V')ans++;
	if (s[10] != 'A')ans++;
	if (s[11] != 'L')ans++;
	if (s[12] != '2')ans++;
	if (s[13] != '0')ans++;
	if (s[14] != '1')ans++;
	if (s[15] != '6')ans++;
	cout << ans << endl;


	return 0;
}

Submission status: Runtime Error

Solution code:
s1 = 'CODEFESTIVAL2016'
print s2
ans = 0
for i in range(len(s1)):
    ans += [0, 1][s1[i] != s2[i]]
print ans

Submission status: Runtime Error

Solution code:
s=raw_input()
t='CODEFESTIVAL2016'
c=0
for i in range(16);
  if s[i] != t[i]:
    c += 1
print c

Submission status: Runtime Error

Solution code:
a = "REMEMBER TO PUT AC/WA ONLY"
b = raw_input()
r = 0
for i in xrange(len(a)):
	if a[i] != b[i]:
		r += 1
print r

Submission status: Runtime Error

Solution code:
s=input()
co="CODEFESTIVAL2016"
cou=0
for i in range(s):
  if(s[i]!=co[i]):cou+=1
print(cou)

Submission status: Runtime Error

Solution code:
import difflib;print(difflib.SequenceMatcher(None,'CODEFESTIVAL2016',input())*100//16)

Submission status: Runtime Error

Solution code:
W,H=map(int,raw_input().split())
p=[input() for i in range(W)]
q=[input() for i in range(H)]

p.sort(reverse=True)
q.sort(reverse=True)

cost=0
del_H=0
del_W=0
len_p=W
len_q=H

while len_p>0 and len_q>0:
    
    if p[0]>q[0]:
        del_W+=1
        cost+=p[0]*(del_H+1)
        del p[0]
        len_p-=1
    else:
        del_H+=1
        cost+=q[0]*(del_W+1)
        del q[0]
        len_q-=1
        

if len_p==0:
    cost+=sum(q)*(W+1)

else:
    cost+=sum(p)*(H+1)

print cost

Submission status: Runtime Error

Solution code:
NAB = map(int, raw_input().split())
N = NAB[0]
A = NAB[1]
B = NAB[2]
S = raw_input()

passed_student = 0
for n in range(0, N):
    if(A+B > passed_student):
        if(S[n] == 'a'):
            print 'Yes'
            passed_student = passed_student + 1
        elif(S[n] == 'b'):
            if(B >= n):
                print 'Yes'
                passed_student = passed_student + 1
            else: print 'No'    
        else: print 'No'
    else: print 'No'

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split())
s=input()
for i in s:
    if a+b>0:
        if i=="a":
            a-=1
            print("Yes")
            continue
        elif i=="b" and b>0:
            b-=1
            print("Yes")
            continue
    print("No")

Submission status: Runtime Error

Solution code:
        s=list(input())
        v=list("CODEFESTIVAL2016")
        cnt=0
        for i in range(16):
            if s[i]!=v[i]:
                cnt+=1
        print(cnt)

Submission status: Runtime Error

Solution code:
    s=input()
    v="CODEFESTIVAL2016"
    cnt=0
    for i in range(16):
        if s[i]!=v[i]:
            cnt+=1
    print(cnt)

Submission status: Runtime Error

Solution code:
import os
import sys
import ipdb


def dump(x):
    print >> sys.stderr, "{0}".format(x)

S = raw_input()
correct = "CODEFESTIVAL2016"
false_count = 0
for i, s in enumerate(S):
    if s != correct[i]:
        false_count += 1

print(false_count)

Submission status: Runtime Error

Solution code:
from sys import stdin
a = 'CODEFESTIVAL2016'
l = len(a)
b = stdin.readline().strip()
ans = 0
for i in xrange(l):
 if a[l]!=b[l]:
  ans+=1
print ans

Submission status: Runtime Error

Solution code:
nums = input().split()
N = int(nums[0])
A = int(nums[1])
B = int(nums[2])
S = input()
count = 0
bcount = 0
for x in S:
	if x == 'a' and A+B > count:
		count += 1
		print("Yes")
	elif x == 'b' and A+B > count and bcount < B :
		count += 1
		bcount += 1
		print("Yes")
	else :
		print("No")

Submission status: Runtime Error

Solution code:
str = "CODEFESTIVAL2016"
s =input()
cnt = 0
for i in range(16):
  if s[i]!=str[i]:
    cnt++
print(cnt)

Submission status: Runtime Error

Solution code:
a = "CODEFESTIVAL2016"
b = raw_input()
count = 0
c = zip(a, b)
for w in c:
    for i,j in w:
        if i == j:
            continue
        else:
            count +=1
print(count)

Submission status: Runtime Error

Solution code:
w, h = map(int, raw_input().split())
p = []
q = []
for i in xrange(w):
    p.append(int(raw_input()))
for i in xrange(h):
    q.append(int(raw_input()))

wl = w
hl = h

cost = 0

p.sort()
q.sort()

p.append(10 ** 8)
q.append(10 ** 8)

pc = 0
qc = 0

while(wl + hl - pc - qc> 0):
    if p[pc] < q[qc]:
        cost += (hl - qc + 1) * p[pc]
        pc += 1
    else:
        cost += (wl - pc + 1) * q[qc]
        qc += 1

print cost

Submission status: Runtime Error

Solution code:
N=int(input())
a=[0]*N
for i in range(N):
    a[i]=int(input())
minimum=1
count=0
for i in  a:
   if(minimum<i):
       if i%minimum:
           count+= i//minimum
       else :
           count+= (i//minimum-1)
   else:
       minimum=max(minimum,i+1)
print(count)

Submission status: Runtime Error

Solution code:
l = input().split()
s = input()
 
n = int(l[0])
a = int(l[1])
b = int(l[2])
 
count = 0
countt = 0
for i in s:
    if i == 'a':
        if count < a+b:
            count = count + 1
            print('Yes')
        else:
            print('No')
    if i == 'b':
        if (count < a+b) and (countt < b):
            count = count + 1
            countt = countt + 1
            print('Yes')
        else:
            print('No')
    if i == 'c':
        print('No')

Submission status: Runtime Error

Solution code:
n,a,b=map(int,raw_input().split())
ab=a+b
s=list(raw_input())
p=0
r=[]
ro=0
for i in range(n):
    if s[i]=="a" and p<ab:
        r.append("Yes")
        p+=1
    elif s[i]=="b" and p<ab and ro<b:
        ro+=1
        p+=1
        r.append("Yes")
    elif s[i]=="c":
        r.append("No")
    else:
        r.append("No")
for i in range(n):
    print(r[i])

Submission status: Runtime Error

Solution code:
neighbor = lambda c, w, h: filter(
    lambda b: 0 <= b[0] <= w and 0 <= b[1] <= h,
    [
        (c[0]-1, c[1]),
        (c[0]+1, c[1]),
        (c[0], c[1]-1),
        (c[0], c[1]+1)
    ]
)

t = raw_input()
W, H = map(int, t.split(' '))
p, q = [], []
for i in xrange(W):
    p.append(int(raw_input()))
for j in xrange(H):
    q.append(int(raw_input()))

has = [[False for i in xrange(H+1)] for j in xrange(W+1)]
has[0][0] = True
Next = [(1, 0), (0, 1)]

cost = 0
for i in xrange(W*H+W+H):
    Min = 100000005
    choose = None
    Next.sort(key=lambda a: min(p[a[0]-1] if a[0] > 0 else 100000005, q[a[1]-1] if a[1] > 0 else 100000005))
    choose = Next[-1]
    Min = min(p[choose[0]-1] if choose[0] > 0 else 100000005, q[choose[1]-1] if choose[1] > 0 else 100000005)
    # for each in Next:
    #     if each[0] > 0:
    #         if p[each[0]-1] < Min:
    #             choose = each
    #             Min = p[each[0]-1]
    #     if each[1] > 0:
    #         if q[each[1]-1] < Min:
    #             choose = each
    #             Min = q[each[1]-1]
    has[choose[0]][choose[1]] = True
    Next = Next[:-1]
    cost += Min
    for every in neighbor(choose, W, H):
        # print every
        if not has[every[0]][every[1]] and every not in Next:
            Next.append(every)
print cost

Submission status: Runtime Error

Solution code:
# def makelist(n, m):
# 	return [[0 for i in range(m)] for j in range(n)]

# n = int(input())
# a, b = map(int, input().split())
# s = input()


rei = "CODEFESTIVAL2016"
s = input()

ans = 0
for i in range(s):
	if rei[i] != s[i]:
		ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
args = list(map(lambda x: int(x), raw_input().split()))
N = args[0]
A = args[1]
B = args[2]
s = input()

a = 0
b = 0
for i in range(0, len(s)):
    if s[i] == 'a':
        if a + b < A + B:
            a = a + 1
            print('Yes')
        else:
            print('No')
    elif s[i] == 'b':
        if a + b < A + B and b < B:
            b = b + 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
S = input()
passed = []

for i in range(N):
  if S[i] == 'c':
    print('No')
  elif S[i] == 'a':
    if len(passed) <= A+B:
      print('Yes')
      passed.append('a')
    else: print('No')
  else:
    if len(passed) <= A+B and passed.count('b') <= B:
      print('Yes')
      passed.append('b')
    else: print('No')

Submission status: Runtime Error

Solution code:
dst = 'CODEFESTIVAL2016'
src = raw_input()
print sum(1 for i in range(len(dst))) if dst[i] != src[i] )

Submission status: Runtime Error

Solution code:
correct_str = "CODEFESTIVAL2016"
wrong_str = raw_input()
count = 0
for i in range(16):
  if wrong_str[i] != correct_str[i]:
    count count += 1

print str(count)

Submission status: Runtime Error

Solution code:
 # -*- coding: utf-8 -*-
correct = 'CODEFESTIVAL2016'
wrong = str(raw_input())
sum = 0
for index in xrange(0, len(wrong)):
    if correct[i] != wrong[i]:
        sum += 1
print sum

Submission status: Runtime Error

Solution code:
s = raw_input()

c = "CODEFESTIVAL2016"

ans  = 0
for i in range(len(c)):
    if s[i] != c[[i]:
                 ans += 1
print ans

Submission status: Runtime Error

Solution code:
S = raw_input()
answer = 0
model = "CODEFESTIVAL2016"
for x range(15):
    if S[x] != model[x]:
        answer += 1
print answer

Submission status: Runtime Error

Solution code:
s = raw_input()
orig = 'CODEFESTIVAL2016'

result = 0
for i in len(s):
  if orig[i] != s:
    result += 1

print result

Submission status: Runtime Error

Solution code:
# get a string
s = raw_input()

n = 0
for i, c in enumerate('CODEFESTIVAL2016'):
    if s[i] != c:
        n++
print n

Submission status: Runtime Error

Solution code:
S = raw_input()
T = "CODEFESTIVAL2016"
ans = 0
for i in xrange(S):
    if S[i] != T[i]: ans += 1
print ans