TnT/CodeNet4Repair huggingface dataset:
Problem:
There are three positive integers A, B and C written on a blackboard. E869120 performs the following operation K times:    * Choose one integer written on the blackboard and let the chosen integer be n. Replace the chosen integer with 2n.  What is the largest possible sum of the integers written on the blackboard after K operations?

Incorrect submission (verdict: Wrong Answer):
A, B, C = map(int, input().rstrip().split())
K = int(input())
print(2*(K-1)*max(A,B,C)+A+B+C)

Fixed, accepted submission:
A, B, C = map(int, input().rstrip().split())
K = int(input())
print(2**K*max(A,B,C)+A+B+C-max(A,B,C))
Problem:
There is a directed graph G with N vertices and M edges. The vertices are numbered 1, 2, \ldots, N, and for each i (1 \leq i \leq M), the i-th directed edge goes from Vertex x_i to y_i. G **does not contain directed cycles**.  Find the length of the longest directed path in G. Here, the length of a directed path is the number of edges in it.

Incorrect submission (verdict: Wrong Answer):
import sys
from collections import defaultdict, deque


def solve():
    N, M = map(int, sys.stdin.readline().split())
    m = map(int, sys.stdin.read().split())
    G = defaultdict(list)
    in_edge = [0] * N
    for x, y in zip(m, m):
        G[y-1].append(x-1)
        in_edge[x-1] += 1

    dp = [0] * N
    q = deque(i for i, x in enumerate(in_edge) if not x)
    q_enqueue = q.append
    q_dequeue = q.popleft
    print(in_edge)
    while(q):
        x = q_dequeue()
        for j in G[x]:
            in_edge[j] -= 1
            dp_x = dp[x]
            if not in_edge[j]:
                q_enqueue(j)
                if dp[j] < dp_x + 1:
                    dp[j] = dp_x + 1
    return max(dp)


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


Fixed, accepted submission:
import sys
from collections import defaultdict, deque


def solve():
    N, M = map(int, sys.stdin.readline().split())
    m = map(int, sys.stdin.read().split())
    G = defaultdict(list)
    in_edge = [0] * N
    for x, y in zip(m, m):
        G[y-1].append(x-1)
        in_edge[x-1] += 1

    dp = [0] * N
    q = deque(i for i, x in enumerate(in_edge) if not x)
    q_enqueue = q.append
    q_dequeue = q.popleft
    while(q):
        x = q_dequeue()
        for j in G[x]:
            in_edge[j] -= 1
            if not in_edge[j]:
                q_enqueue(j)
                if dp[j] < dp[x] + 1:
                    dp[j] = dp[x] + 1
    return max(dp)


if __name__ == "__main__":
    answer = solve()
    print(answer)
Problem:
There are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these.  Only Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy the conditions listed below, from the top rank down. Participants who are not students cannot pass the Qualification contests.    * A Japanese student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B.   * An overseas student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B and the student ranks B-th or above among all overseas students.  A string S is assigned indicating attributes of all participants. If the i-th character of string S is `a`, this means the participant ranked i-th in the Qualification contests is a Japanese student; `b` means the participant ranked i-th is an overseas student; and `c` means the participant ranked i-th is neither of these.  Write a program that outputs for all the participants in descending rank either `Yes` if they passed the Qualification contests or `No` if they did not pass.

Incorrect submission (verdict: Wrong Answer):
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("NOT")


Fixed, accepted submission:
N, A, B = map(int, input().split())
AB = A + B
S = input()
ansA, ansB = 0, 0
for s in S:
    if s == 'a' and ansA + ansB < AB:
        ansA += 1
        print('Yes')
    elif s == 'b' and ansA + ansB < AB and ansB < B:
        ansB += 1
        print('Yes')
    else:
        print('No')
Problem:
An expression is given in a line. Two consequtive symbols (operand or operator) are separated by a space character.  You can assume that +, - and * are given as the operator and an operand is a positive integer less than 106

Incorrect submission (verdict: Wrong Answer):
eq=input().split(' ')

class Stack():
	def __init__(self):
		self.S=[]
		self.top=-1
		
	def initialize(self):
		self.top=-1
	
	def isEmpty(self):
		if self.top==-1:
			return('Empty')
		else:
			return('Not Empty')
	
	def push(self,x):
		self.S.append(x)
		self.top+=1
	
	def pop(self):
		a=self.S[self.top]
		del self.S[self.top]
		self.top-=1
		return(a)
		
	
	
	
c=Stack()
for i in range(len(eq)):
	if eq[i].isdigit():
		c.push(eq[i])
	else:
		a=c.pop()
		b=c.pop()
		print(a,b)
		if eq[i]=='+':
			c.push(int(b)+int(a))
		elif eq[i]=='-':
			c.push(int(b)-int(a))
		else:
			c.push(int(b)*int(a))
	print(c.S)
			
print(c.pop())


Fixed, accepted submission:
eq=input().split(' ')

class Stack():
	def __init__(self):
		self.S=[]
		self.top=-1
		
	def initialize(self):
		self.top=-1
	
	def isEmpty(self):
		if self.top==-1:
			return('Empty')
		else:
			return('Not Empty')
	
	def push(self,x):
		self.S.append(x)
		self.top+=1
	
	def pop(self):
		a=self.S[self.top]
		del self.S[self.top]
		self.top-=1
		return(a)
		
	
	
	
c=Stack()
for i in range(len(eq)):
	if eq[i].isdigit():
		c.push(eq[i])
	else:
		a=c.pop()
		b=c.pop()
		if eq[i]=='+':
			c.push(int(b)+int(a))
		elif eq[i]=='-':
			c.push(int(b)-int(a))
		else:
			c.push(int(b)*int(a))
			
print(c.pop())
Problem:
There is a data which provides heights (in meter) of mountains. The data is only for ten mountains.  Write a program which prints heights of the top three mountains in descending order.

Incorrect submission (verdict: Wrong Answer):
ls = []
for i in range(0,10):
    ls.append(int(input()))
ls.sort()
print(ls[7])
print(ls[8])
print(ls[9])

Fixed, accepted submission:
ls = []
for i in range(0,10):
    ls.append(int(input()))
ls.sort()
print(ls[9])
print(ls[8])
print(ls[7])
Problem:
Write a program which reads $n$ dices constructed in the same way as [Dice I](description.jsp?id=ITP1_11_A), and determines whether they are all different. For the determination, use the same way as [Dice III](description.jsp?id=ITP1_11_C).

Incorrect submission (verdict: Wrong Answer):
class Dice():

    def __init__(self, label):
        self.label = label

    def north(self):
        self.change([2, 6, 3, 4, 1, 5])

    def west(self):
        self.change([3, 2, 6, 1, 5, 4])

    def east(self):
        self.change([4, 2, 1, 6, 5, 3])

    def south(self):
        self.change([5, 1, 3, 4, 6, 2])

    def rotate(self):
        self.change([1, 4, 2, 5, 3, 6])

    def change(self, convert):
        num = []
        for i in range(6):
            num.append(self.label[convert[i] - 1])
        self.label = num

    def is_same_dice(self, another_dice):
        for i in range(6):
            if i % 2 == 0:
                self.north()
            else:
                self.west()
            for j in range(4):
                self.rotate()
                if self.label == another_dice:
                    return True
        return False


def main():
    dices = []
    n = int(input())
    for i in range(n):
        dices.append(Dice([int(x) for x in input().split()]))

    flag = False
    for i in range(n):
        j = i + 1
        while j < n:
            if dices[i].is_same_dice(dices[j]):
                flag = True
                break
            j += 1

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


if __name__ == '__main__':
    main()

Fixed, accepted submission:
class Dice():

    def __init__(self, label):
        self.label = label

    def north(self):
        self.change([2, 6, 3, 4, 1, 5])

    def west(self):
        self.change([3, 2, 6, 1, 5, 4])

    def east(self):
        self.change([4, 2, 1, 6, 5, 3])

    def south(self):
        self.change([5, 1, 3, 4, 6, 2])

    def rotate(self):
        self.change([1, 4, 2, 5, 3, 6])

    def change(self, convert):
        num = []
        for i in range(6):
            num.append(self.label[convert[i] - 1])
        self.label = num

    def is_same_dice(self, another_dice):
        for i in range(6):
            if i % 2 == 0:
                self.north()
            else:
                self.west()
            for j in range(4):
                self.rotate()
                if self.label == another_dice:
                    return True
        return False


def main():
    dices = []
    n = int(input())
    for i in range(n):
        dices.append(Dice([int(x) for x in input().split()]))

    flag = False
    for i in range(n):
        j = i + 1
        while j < n:
            if dices[i].is_same_dice(dices[j].label):
                flag = True
                break
            j += 1

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


if __name__ == '__main__':
    main()
Problem:
There is an empty array. The following N operations will be performed to insert integers into the array. In the i-th operation (1≤i≤N), b_i copies of an integer a_i are inserted into the array. Find the K-th smallest integer in the array after the N operations. For example, the 4-th smallest integer in the array \\{1,2,2,3,3,3\\} is 3.

Incorrect submission (verdict: Wrong Answer):
n,k=map(int,input().split())
lists=[0]*n
for i in range(n):
    lists[i]=tuple(map(int,input().split()))
lists=sorted(lists,key=lambda x: x[0])
print(lists)
count=0
num=0
for j in range(n):
    if count<k:
        count+=lists[j][1]*lists[j][0]
    else:
        num+=lists[j][0]
        break
print(num)

Fixed, accepted submission:
n,k=map(int,input().split())
lists=[0]*n
for i in range(n):
    lists[i]=tuple(map(int,input().split()))
lists=sorted(lists,key=lambda x: x[0])

count=0
num=0
for j in range(n):
    if count<k:
        count=count+lists[j][1]
        num=lists[j][0]

    else:
        break
print(num)
Problem:
You have an integer variable x. Initially, x=0.  Some person gave you a string S of length N, and using the string you performed the following operation N times. In the i-th operation, you incremented the value of x by 1 if S_i=`I`, and decremented the value of x by 1 if S_i=`D`.  Find the maximum value taken by x during the operations (including before the first operation, and after the last operation).

Incorrect submission (verdict: Wrong Answer):
s=input()
a=[0]
for i in range(len(s)):
  if s[i] =='I':
    a.append(a[i]+1)
  else:
    a.append(a[i]-1)
print(max(a))
    

Fixed, accepted submission:
n=int(input())
s=input()
x=[0]
for i in range(n):
    if s[i]=='I':
        x.append(x[i]+1)
    else:
        x.append(x[i]-1)
print(max(x))
Problem:
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.   Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.   Here, both the x\- and y-coordinates before and after each movement must be integers.   He will first visit the point (tx,ty) where sx < tx and sy < ty, then go back to the point (sx,sy), then visit the point (tx,ty) again, and lastly go back to the point (sx,sy).   Here, during the whole travel, he is not allowed to pass through the same point more than once, except the points (sx,sy) and (tx,ty).   Under this condition, find a shortest path for him.

Incorrect submission (verdict: Wrong Answer):
sx, sy, tx, ty = map(int, input().split())
xtmp = abs(sx - tx)
ytmp = abs(sy - ty)
ans = 'R' * xtmp
ans += 'U' * ytmp
tmp1 = ans
tmp1 = tmp1[-1: -len(ans) - 1: -1]
tmp2 = 'LU' + ans + 'RD'
tmp3 = 'RD' + tmp1 + 'LU'
print(ans + tmp1 + tmp2 + tmp3)

Fixed, accepted submission:
sx, sy, tx, ty = map(int, input().split())
xtmp = abs(sx - tx)
ytmp = abs(sy - ty)
ans = 'U' * ytmp
ans += 'R' * xtmp
tmp1 = ans
tmp1 = tmp1.replace('R', 'L')
tmp1 = tmp1.replace('U', 'D')
tmp2 = 'LU' + ans + 'RD'
tmp3 = 'RD' + tmp1 + 'LU'
print(ans + tmp1 + tmp2 + tmp3)
Problem:
You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:    * Wield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.   * Throw one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.  The monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?

Incorrect submission (verdict: Wrong Answer):
import sys
n,h=map(int,input().split())
damage=[]
attack=0
count=0
flag=True
for i in range(n):
    a,b=map(int,input().split())
    damage.append([i,a,b])
throw=sorted(damage,key=lambda x:x[2],reverse=True)
swung=sorted(damage,key=lambda x:x[1],reverse=True)
swungmax=swung[0][1]
kirifuda=swung[0][2]
for i in range(n):
    if attack+kirifuda>=h:
        count+=1
        print(count)
        sys.exit()
    else:
        if throw[i][2]>swungmax:
            attack+=throw[i][2]
            count+=1
            if attack>=h:
                print(count)
                sys.exit()
while flag==True:
    if attack+kirifuda>=h:
        count+=1
        print(count)
        flag=False
    else:
        attack+=swungmax
        count+=1


Fixed, accepted submission:
import math
n,h=map(int,input().split())
A=[]
B=[]
for i in range(n):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
A.sort(reverse=True)
B.sort(reverse=True)
amax=A[0]
while B[-1]<amax:
    B.pop()
S=0
if sum(B)>=h:
    for i in range(n):
        S+=B[i]
        if S>=h:
            print(i+1)
            break
else:
    h-=sum(B)
    print(math.ceil(h/amax)+len(B))
Problem:
We have a board with H horizontal rows and W vertical columns of squares. There is a bishop at the top-left square on this board. How many squares can this bishop reach by zero or more movements?  Here the bishop can only move diagonally. More formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:    * r_1 + c_1 = r_2 + c_2   * r_1 - c_1 = r_2 - c_2  For example, in the following figure, the bishop can move to any of the red squares in one move:  

Incorrect submission (verdict: Wrong Answer):
h,w = map(int, input().split())
S=h*w
if S%2==0:
    print(S/2)
else:
    print(S//2+1)

Fixed, accepted submission:
h,w = map(int, input().split())
S=h*w
if h==1 or w==1:
    print(1)
elif S%2==0:
    print(S//2)
else:
    print(S//2+1)
Problem:
In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi:    * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person.  Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.

Incorrect submission (verdict: Wrong Answer):
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007

def solve():
    A,B,K = map(int, input().split())
    turn = 0
    while K > 0:
        if turn == 0:
            if A%2 == 1:
                A -= 1
            B += A/2
            A /= 2
            turn ^= 1
        else :
            if B%2 == 1:
                B -=1
            A += B/2
            B /= 2
        K -= 1


    print(A," ",B)
            


        

if __name__ == '__main__':
    solve()


Fixed, accepted submission:
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007

def solve():
    A,B,K = map(int, input().split())
    turn = 0
    while K > 0:
        if turn == 0:
            if A%2 == 1:
                A -= 1
            B += A/2
            A /= 2
            turn ^= 1
        else :
            if B%2 == 1:
                B -=1
            A += B/2
            B /= 2
            turn ^= 1
        K -= 1

    A = (int)(A)
    B = (int)(B)
    print(A,B)
            


        

if __name__ == '__main__':
    solve()
Problem:
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.  The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day:    * A: Swim in the sea. Gain a_i points of happiness.   * B: Catch bugs in the mountains. Gain b_i points of happiness.   * C: Do homework at home. Gain c_i points of happiness.  As Taro gets bored easily, he cannot do the same activities for two or more consecutive days.  Find the maximum possible total points of happiness that Taro gains.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a, b, c = 0, 0, 0

for i in range(n):
  x, y, z = map(int, input().split())
  a, b, c = a+max(y,z), b+max(x,z), c+max(x,y)
print(max(a,b,c))

Fixed, accepted submission:
n = int(input())
a, b, c = 0, 0, 0

for i in range(n):
  x, y, z = map(int, input().split())
  a, b, c = x+max(b,c), y+max(a,c), z+max(a,b)
print(max(a,b,c))
Problem:
Snuke is giving cookies to his three goats.  He has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).  Your task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.

Incorrect submission (verdict: Wrong Answer):
a, b = map(int, input().split())
print('Impossible' if a % 3 or b % 3 or a + b % 3 else 'Possible')

Fixed, accepted submission:
a, b = map(int, input().split())
print('Impossible' if a % 3 and b % 3 and (a + b) % 3 else 'Possible')
Problem:
Write a program which reads a word W and a text T, and prints the number of word W which appears in text T  T consists of string Ti separated by space characters and newlines. Count the number of Ti which equals to W. The word and text are case insensitive.

Incorrect submission (verdict: Wrong Answer):
W = str(input()).lower() 
T = str(input()).lower() *2

print(T.count(W))


Fixed, accepted submission:
W = str(input()).lower() 

table = []
count = 0

while True:
    
    T = str(input())
    if T == "END_OF_TEXT":
        break
    else:
        T = T.lower().split()
    
    for j in range(len(T)):
        table.append(T[j])
    
    
for i in table:
    if i == W:
        count += 1
    
print(count)
Problem:
Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up.   Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1.   Here, both the x\- and y-coordinates before and after each movement must be integers.   He will first visit the point (tx,ty) where sx < tx and sy < ty, then go back to the point (sx,sy), then visit the point (tx,ty) again, and lastly go back to the point (sx,sy).   Here, during the whole travel, he is not allowed to pass through the same point more than once, except the points (sx,sy) and (tx,ty).   Under this condition, find a shortest path for him.

Incorrect submission (verdict: Wrong Answer):
sx, sy, tx, ty = map(int,input().split())
x,y=tx-sx,ty-sy
trail='U'*x + 'R'*y
trail+='D'*y + 'L'*x
trail+='L'+'U'*(x+1)+'R'*(y+1)+'D'
trail+='R'+'D'*(y+1)+'L'*(x+1)+'U'
print(trail)

Fixed, accepted submission:
sx, sy, tx, ty = map(int,input().split())
x,y=tx-sx,ty-sy
trail='U'*y + 'R'*x
trail+='D'*y + 'L'*x
trail+='L'+'U'*(y+1)+'R'*(x+1)+'D'
trail+='R'+'D'*(y+1)+'L'*(x+1)+'U'
print(trail)
Problem:
ある部屋ではICカードを用いて鍵を開け閉めする電子錠システムを用いている。 このシステムは以下のように動作する。  各ユーザーが持つICカードを扉にかざすと、そのICカードのIDがシステムに渡される。 システムはIDが登録されている時、施錠されているなら開錠し、そうでないのなら施錠し、それぞれメッセージが出力される。 IDが登録されていない場合は、登録されていないというメッセージを出力し、開錠及び施錠はおこなわれない。  さて、現在システムにはN個のID(U1, U2, ……, UN)が登録されており、施錠されている。 M回ICカードが扉にかざされ、そのIDはそれぞれ順番にT1, T2, ……, TMであるとする。 この時のシステムがどのようなメッセージを出力するか求めよ。

Incorrect submission (verdict: Wrong Answer):
k=[input() for _ in range(int(input()))]
a=1
for _ in range(int(input())):
    b=input()
    if b in k:print(('Opend' if a>0 else 'Closed')+' by '+b);a=~a
    else:print('Unknown '+b)

Fixed, accepted submission:
k=[input() for _ in range(int(input()))]
a=1
for _ in range(int(input())):
    b=input()
    if b in k:print(['Closed','Opened'][a>0]+' by '+b);a=~a
    else:print('Unknown '+b)
Problem:
Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).

Incorrect submission (verdict: Wrong Answer):
N, A, B = map(int, input().split())

sm = 0

for i in range(1, N+1):
    digit = str(i)
    sm_t = 0
    for d in digit:
        sm_t += int(d)
    
    if sm_t >= A:
        if sm_t <= B:
            sm += sm_t

print(sm)

Fixed, accepted submission:
N, A, B = map(int, input().split())

sm = 0

for i in range(1, N+1):
    digit = str(i)
    sm_t = 0
    for d in digit:
        sm_t += int(d)
    
    if sm_t >= A and sm_t <= B:
        sm += i

print(sm)
Problem:
We have a long seat of width X centimeters. There are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length Y centimeters.  We would like to seat as many people as possible, but they are all very shy, and there must be a gap of length at least Z centimeters between two people, and between the end of the seat and a person.  At most how many people can sit on the seat?

Incorrect submission (verdict: Wrong Answer):
x,y,z=map(int,input().split())
ans=x//(y+z)
print(ans if ans*(y+z) < x-z else ans-1)

Fixed, accepted submission:
x,y,z=map(int,input().split())
ans=x//(y+z)
print(ans if ans*(y+z)+z <= x else ans-1)
Problem:
Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the `0` key, the `1` key and the backspace key.  To begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:    * The `0` key: a letter `0` will be inserted to the right of the string.   * The `1` key: a letter `1` will be inserted to the right of the string.   * The backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.  Sig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter `0` stands for the `0` key, the letter `1` stands for the `1` key and the letter `B` stands for the backspace key. What string is displayed in the editor now?

Incorrect submission (verdict: Wrong Answer):
# -*- coding: utf-8 -*-

S = input()
T = ''
for i in range(len(S)):
	if S[i] == '0':
		T += '0'
	elif S[i] =='1':
		T += '1	'
	else:
		T = T[:-1]
print(T)

Fixed, accepted submission:
# -*- coding: utf-8 -*-

S = input()
T = ''
for i in range(len(S)):
	if S[i] == '0':
		T += '0'
	elif S[i] == '1':
		T += '1'
	elif S[i] == 'B':
		T = T[:-1]
print(T)
Problem:
It is September 9 in Japan now.  You are given a two-digit integer N. Answer the question: Is 9 contained in the decimal notation of N?

Incorrect submission (verdict: Wrong Answer):
x = input()
if x[0] == 9 or x[1] == 9:
  print("Yes")
else:
  print("No")

Fixed, accepted submission:
x = input()
if x[0] == "9" or x[1] == "9":
  print("Yes")
else:
  print("No")