TnT/CodeNet4Repair huggingface dataset:
Problem:
Let's arrange a deck of cards. There are totally 36 cards of 4 suits(S, H, C, D) and 9 values (1, 2, ... 9). For example, 'eight of heart' is represented by H8 and 'one of diamonds' is represented by D1.  Your task is to write a program which sorts a given set of cards in ascending order by their values using the Bubble Sort algorithms and the Selection Sort algorithm respectively. These algorithms should be based on the following pseudocode:                 BubbleSort(C) 1 for i = 0 to C.length-1 2     for j = C.length-1 downto i+1 3         if C[j].value < C[j-1].value 4             swap C[j] and C[j-1]                 SelectionSort(C) 1 for i = 0 to C.length-1 2     mini = i 3     for j = i to C.length-1 4         if C[j].value < C[mini].value 5             mini = j 6     swap C[i] and C[mini]   Note that, indices for array elements are based on 0-origin.  For each algorithm, report the stability of the output for the given input (instance). Here, 'stability of the output' means that: cards with the same value appear in the output in the same order as they do in the input (instance).

Incorrect submission (verdict: Wrong Answer):
def BubbleSort(C, N):
    for i in range(N):
        for j in range(N - 1, i, -1):
            if int(C[j][1]) < int(C[j - 1][1]):
                C[j], C[j - 1] = C[j - 1], C[j]
    return C

def SelectionSort(C, N):
    for i in range(N):
        minj = i
        for j in range(i, N):
            if int(C[j][1]) < int(C[minj][1]):
                minj = j
        C[i], C[minj] = C[minj], C[i]
    return C

def isStable(B, S, N):
    for i in range(N):
        if B[i] != S[i]:
            return False
    return True

N = int(input())
C = input().split()
B = BubbleSort(C, N)
S = SelectionSort(C, N)
mes = "Stable" if isStable(B, S, N) else "Not stable"
print(" ".join(list(map(str, B))))
print("Stable")
print(" ".join(list(map(str, S))))
print(mes)

Fixed, accepted submission:
def BubbleSort(C, N):
    for i in range(N):
        for j in range(N - 1, i, -1):
            if int(C[j][1]) < int(C[j - 1][1]):
                C[j], C[j - 1] = C[j - 1], C[j]
    return C

def SelectionSort(C, N):
    for i in range(N):
        minj = i
        for j in range(i, N):
            if int(C[j][1]) < int(C[minj][1]):
                minj = j
        C[i], C[minj] = C[minj], C[i]
    return C

def isStable(B, S, N):
    for i in range(N):
        if B[i] != S[i]:
            return False
    return True

N = int(input())
B = input().split()
S = B[:]
B = BubbleSort(B, N)
S = SelectionSort(S, N)
mes = "Stable" if isStable(B, S, N) else "Not stable"
print(" ".join(B))
print("Stable")
print(" ".join(S))
print(mes)
Problem:
You are given N integers; the i-th of them is A_i. Find the maximum possible sum of the absolute differences between the adjacent elements after arranging these integers in a row in any order you like.

Incorrect submission (verdict: Wrong Answer):
from sys import stdin
n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(n)]
li.sort()
lis = li[:n//2]
lin = li[n//2:][::-1]
liv = []
if n%2 == 1:
    liv.append(lin[0])
    lin = lin[1:]
for i,j in zip(li,lin):
    liv.append(i)
    liv.append(j)
point = 0
for i in range(n-1):
    point += abs(liv[i+1]-liv[i])
print(point)

Fixed, accepted submission:
from sys import stdin
n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(n)]
li.sort()
if n%2 == 1:
    mid = li[n//2]
    mae = li[:n//2]
    ushiro = li[n//2+1:]
    sono1 = -mid - mae[-1]
    sono1 += sum(ushiro)*2-sum(mae[:-1])*2
    sono2 = mid + ushiro[0]
    sono2 += sum(ushiro[1:])*2-sum(mae)*2
    print(max(sono1,sono2))
else:
    mae = li[:n//2]
    ushiro = li[n//2:]
    sono3 = -mae[-1] + ushiro[0]
    sono3 += sum(ushiro[1:])*2-sum(mae[:-1])*2
    print(sono3)
Problem:
Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$.  A column vector with m elements is represented by the following equation.  \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m \\\ \end{array} \right) \\]  A $n \times m$ matrix with $m$ column vectors, each of which consists of $n$ elements, is represented by the following equation.  \\[ A = \left( \begin{array}{cccc} a_{11} & a_{12} & ... & a_{1m} \\\ a_{21} & a_{22} & ... & a_{2m} \\\ : & : & : & : \\\ a_{n1} & a_{n2} & ... & a_{nm} \\\ \end{array} \right) \\]  $i$-th element of a $m \times 1$ column vector $b$ is represented by $b_i$ ($i = 1, 2, ..., m$), and the element in $i$-th row and $j$-th column of a matrix $A$ is represented by $a_{ij}$ ($i = 1, 2, ..., n,$ $j = 1, 2, ..., m$).  The product of a $n \times m$ matrix $A$ and a $m \times 1$ column vector $b$ is a $n \times 1$ column vector $c$, and $c_i$ is obtained by the following formula:  \\[ c_i = \sum_{j=1}^m a_{ij}b_j = a_{i1}b_1 + a_{i2}b_2 + ... + a_{im}b_m \\]

Incorrect submission (verdict: Wrong Answer):
n,m = [int(i) for i in input().split()]
print(n,m)
A = [[0 for i in range(m)] for j in range(n)]
#B = [[0 for i in range(1)] for j in range(m)]
B = [0 for i in range(m)]
C = [[0 for i in range(1)] for j in range(n)]
print(A)
print(B)
print(C)
A = [[i for i in input().split()] for j in range(n)]
B = [input() for i in range(m)]
print(A)
print(B)


Fixed, accepted submission:
n,m = [int(i) for i in input().split()]

A = [[int(i) for i in input().split()] for j in range(n)]
B = [int(input()) for i in range(m)]

for i in range(n):
    c = 0
    for j in range(m):
        c += A[i][j]*B[j]
    print(c)
Problem:
You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.  For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.  Assume that initially no person lives in the building.

Incorrect submission (verdict: Wrong Answer):
room = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

n = int(input())
for i in range(n):
  b,f,r,v = map(int,input().split())
  room[b-1][f-1][r-1] += v

sep = "#"*20

for i in range(4):
  for j in range(3):
    print(" {0} {1} {2} {3} {4} {5} {6} {7} {8} {9}".format(room[i][j][0],room[i][j][1],room[i][j][2],room[i][j][3],room[i][j][4],room[i][j][5],room[i][j][6],room[i][j][7],room[i][j][8],room[i][j][9]))
  if j != 3:
    print(sep)


Fixed, accepted submission:
room = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

n = int(input())
for i in range(n):
  b,f,r,v = map(int,input().split())
  room[b-1][f-1][r-1] += v

sep = "#"*20

for i in range(4):
  for j in range(3):
    print(" {0} {1} {2} {3} {4} {5} {6} {7} {8} {9}".format(room[i][j][0],room[i][j][1],room[i][j][2],room[i][j][3],room[i][j][4],room[i][j][5],room[i][j][6],room[i][j][7],room[i][j][8],room[i][j][9]))
  if i < 3:
    print(sep)
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())
x = x-2*z
ans = x // (y+z)
print(ans)

Fixed, accepted submission:
x,y,z = map(int, input().split())
x = x-z
ans = x // (y+z)
print(ans)
Problem:
Snuke has decided to construct a string that starts with `A` and ends with `Z`, by taking out a substring of a string s (that is, a consecutive part of s).  Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with `A` and ends with `Z`.

Incorrect submission (verdict: Wrong Answer):
s = input()
a = 0
z = -1
while 1:
    if s[a] == 'A':
        break
    a+=1
while 1:
    if s[z] =='Z':
        break
    z-=1
print(s[a:z+1])

Fixed, accepted submission:
s = input()
a = 0
z = -1
while 1:
    if s[a] == 'A':
        break
    a+=1
while 1:
    if s[z] =='Z':
        break
    z-=1
print(len(s)-a+z+1)
Problem:
Snuke has decided to construct a string that starts with `A` and ends with `Z`, by taking out a substring of a string s (that is, a consecutive part of s).  Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with `A` and ends with `Z`.

Incorrect submission (verdict: Wrong Answer):
s = input()
start = 0
for i in range(len(s)):
  if s[i] == 'A' and start == 0:
    start = i
print(start)
stop = 0
for i in range(len(s), start, -1):
   if s[i -1] == 'Z' and stop == 0:
     stop = i
print(stop)
print(stop - start)

Fixed, accepted submission:
s = input()
start = 0
stop = 0
for i in range(len(s)):
  if s[i] == 'A':
    start = i
    break

for i in range(len(s) -1, start, -1):
  if s[i] == 'Z':
    stop = i
    break
print(stop - start + 1)
Problem:
Sitting in a station waiting room, Joisino is gazing at her train ticket.  The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).  In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds.  The given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.

Incorrect submission (verdict: Wrong Answer):
a, b, c, d = map(int, input())
l = [a+b+c+d, a+b+c-d, a+b-c+d, a+b-c-d, a-b+c+d, a-b+c-d, a-b-c+d, a-b-c-d]

if l.index(7) == 0:
    print(a, '+', b, '+', c, '+', d, '= 7')
elif l.index(7) == 1:
    print(a, '+', b, '+', c, '-', d, '= 7')
elif l.index(7) == 2:
    print(a, '+', b, '-', c, '+', d, '= 7')
elif l.index(7) == 3:
    print(a, '+', b, '-', c, '-', d, '= 7')
elif l.index(7) == 4:
    print(a, '-', b, '+', c, '+', d, '= 7')
elif l.index(7) == 5:
    print(a, '-', b, '+', c, '-', d, '= 7')
elif l.index(7) == 6:
    print(a, '-', b, '-', c, '+', d, '= 7')
elif l.index(7) == 7:
    print(a, '-', b, '-', c, '-', d, '= 7')

Fixed, accepted submission:
# C
# 2020/04/21  16:18-16:27
l = list(map(str, input()))

n = len(l)
for i in range(2**(n-1)):
    op = ['+']*(n-1)
    for j in range(n):
        if i >> j & 1:
            op[j] = '-'
    if eval(l[0] + op[0] + l[1] + op[1] + l[2] + op[2] + l[3]) == 7:
        print(l[0] + op[0] + l[1] + op[1] + l[2] + op[2] + l[3], '=7', sep='')
        break
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
  string = input()
  if string == 'AC':
    ac += 1
  elif string == 'WA':
    wa += 1
  elif string == 'TLE':
    tle += 1
  else:
    re += 1
print('AC X',ac)
print('WA X',ac)
print('TLE X',ac)
print('RE X',ac)

Fixed, accepted submission:
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
  string = input()
  if string == 'AC':
    ac += 1
  elif string == 'WA':
    wa += 1
  elif string == 'TLE':
    tle += 1
  else:
    re += 1
print('AC x',ac)
print('WA x',wa)
print('TLE x',tle)
print('RE x',re)
Problem:
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) otherwise.  You are given Smeke's current rating, x. Print `ABC` if Smeke will participate in ABC, and print `ARC` otherwise.

Incorrect submission (verdict: Wrong Answer):
print(["ARC","ABC"][1200<int(input())])

Fixed, accepted submission:
print(["ARC","ABC"][1200>int(input())])
Problem:
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.    An example of a trapezoid  Find the area of this trapezoid.

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

print((a+b)*c/2)




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

print(int((a+b)*c/2))
Problem:
AtCoDeer the deer is going on a trip in a two-dimensional plane. In his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.  If AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1). Note that **he cannot stay at his place**. Determine whether he can carry out his plan.

Incorrect submission (verdict: Wrong Answer):
N=int(input())
S=[(0,0,0)]
for i in range(N):
  t,x,y=map(int,input().split())
  S.append((t,x,y))
flag=0
for i in range(N):
  if abs(S[i+1][1]-S[i][1])+abs(S[i+1][2]-S[i][2])>S[i+1][0]-S[i][0]:
    flag=1
    break
  elif (S[i+1][0]-S[i][0])%2==1 and (abs(S[i+1][1]-S[i][1])+abs(S[i+1][2]-S[i][2]))%2==0:
    flag=1
    break
  elif (S[i+1][0]-S[i][0])%2==0 and (abs(S[i+1][1]-S[i][1])+abs(S[i+1][2]-S[i][2]))%2==1:
    flag=1
    break

Fixed, accepted submission:
N=int(input())
S=[(0,0,0)]
for i in range(N):
  t,x,y=map(int,input().split())
  S.append((t,x,y))
flag=0
for i in range(N):
  if abs(S[i+1][1]-S[i][1])+abs(S[i+1][2]-S[i][2])>S[i+1][0]-S[i][0]:
    flag=1
    break
  elif (S[i+1][0]-S[i][0])%2==1 and (abs(S[i+1][1]-S[i][1])+abs(S[i+1][2]-S[i][2]))%2==0:
    flag=1
    break
  elif (S[i+1][0]-S[i][0])%2==0 and (abs(S[i+1][1]-S[i][1])+abs(S[i+1][2]-S[i][2]))%2==1:
    flag=1
    break

if flag==1:
  print("No")
else:
  print("Yes")
Problem:
Snuke lives at position x on a number line. On this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.  Snuke decided to get food delivery from the closer of stores A and B. Find out which store is closer to Snuke's residence.  Here, the distance between two points s and t on a number line is represented by |s-t|.

Incorrect submission (verdict: Wrong Answer):
x,a,b = map(int,input().split())
print(min(abs(x-a),abs(x-b)))

Fixed, accepted submission:
x,a,b = map(int,input().split())
if abs(x-a)<abs(x-b):
    print("A")
else:
    print("B")
Problem:
_n_ _q_   _name 1 time1_   _name 2 time2_   ...   _name n timen_    In the first line the number of processes _n_ and the quantum _q_ are given separated by a single space.  In the following _n_ lines, names and times for the _n_ processes are given. _name i_ and _time i_ are separated by a single space.

Incorrect submission (verdict: Wrong Answer):
n, q = [int(i) for i in input().split()]
que = []
ans_count = 0 
time = 0 

for i in range(n):
    que.append([i for i in input().split()])

while(ans_count!=n):
    pop_process = que.pop(0)
    pop_process[1] = int(pop_process[1])
    
    if pop_process[1] < q:
        time += pop_process[1]
        print('{0} {1}'.format(pop_process[0], time))
        ans_count += 1
    else:
        time += q
        pop_process[1] -= q
        que.append(pop_process)


Fixed, accepted submission:
n, q = [int(i) for i in input().split()]
que = []
ans_count = 0 
time = 0 

for i in range(n):
    que.append([i for i in input().split()])

while(ans_count!=n):
    pop_process = que.pop(0)
    pop_process[1] = int(pop_process[1])
    
    if pop_process[1] <= q:
        time += pop_process[1]
        print('{0} {1}'.format(pop_process[0], time))
        ans_count += 1
    else:
        time += q
        pop_process[1] -= q
        que.append(pop_process)
Problem:
There are N positive integers written on a blackboard: A_1, ..., A_N.  Snuke can perform the following operation when all integers on the blackboard are even:    * Replace each integer X on the blackboard by X divided by 2.  Find the maximum possible number of operations that Snuke can perform.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
c=0
for i in range(N):
    if A[i]%2 == 1:
        break
    else:
        c+=1
print(c)

Fixed, accepted submission:
N = int(input())
A = list(map(int, input().split()))
c=0
odd_exist = True
for j in range(200):
    for i in range(N):
        if A[i]%2 == 0:
            A[i] = int(A[i]/2)
        else:
            odd_exist = False
            break
    if odd_exist:
        c+=1
print(c)
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a=n%1000
print(a)

Fixed, accepted submission:
n=int(input())
ans = (n+999)//1000  * 1000 - n
print(ans)
Problem:
There are N people standing in a row from west to east. Each person is facing east or west. The directions of the people is given as a string S of length N. The i-th person from the west is facing east if S_i = `E`, and west if S_i = `W`.  You will appoint one of the N people as the leader, then command the rest of them to face in the direction of the leader. Here, we do not care which direction the leader is facing.  The people in the row hate to change their directions, so you would like to select the leader so that the number of people who have to change their directions is minimized. Find the minimum number of people who have to change their directions.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
S = input()
s1 = S[1:]
b = []
b.append(s1.count('E'))
j = 1
while j < N:
  b.append(0)
  b[j] = b[j-1]
  if S[j] == 'E':
    b[j] += -1
  if S[j-1] == 'W':
    b[j] += 1
  j += 1
print(b)

Fixed, accepted submission:
N = int(input())
S = input()
s1 = S[1:]
b = []
b.append(s1.count('E'))
j = 1
while j < N:
  b.append(0)
  b[j] = b[j-1]
  if S[j] == 'E':
    b[j] += -1
  if S[j-1] == 'W':
    b[j] += 1
  j += 1
print(min(b))
Problem:
Write a program which calculates the area and perimeter of a given rectangle.

Incorrect submission (verdict: Wrong Answer):

nums = input().split(' ')
h1 = int(nums[0])
h2 = int(nums[1])
print( h1*h2 ),
print( 2*(h1+h2) )

Fixed, accepted submission:
nums = input().split(' ')
h1 = int(nums[0])
h2 = int(nums[1])
print( h1*h2,  2*(h1+h2) )
Problem:
Print all the integers that satisfies the following in ascending order:    * Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.

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

(a, b, k) = [int(i) for i in input().rstrip().split(" ")]

for i in [i for i in range(a, min(a+k, b+1))] or [i for i in range(max(b-k + 1, a), b + 1)]:
    print(i)

Fixed, accepted submission:
# coding: utf-8

(a,b,k) = map(int, input().rstrip().split(" "))

ans = []

for i in range(a, min(b+1,a+k)):
    ans.append(i)

for i in range(max(a, b-k+1), b+1):
    ans.append(i)

for i in sorted(set(ans)):
    print(i)
Problem:
Snuke has decided to construct a string that starts with `A` and ends with `Z`, by taking out a substring of a string s (that is, a consecutive part of s).  Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with `A` and ends with `Z`.

Incorrect submission (verdict: Wrong Answer):
s = input()
l = len(s)
for i in range(l):
    if s[i] == 'A':
        a = i
        break
for i in range(l - 1, -1, -1):
    if s[i] == 'Z':
        z = i
        break
print(z - a)

Fixed, accepted submission:
s = input()
l = len(s)
for i in range(l):
    if s[i] == 'A':
        a = i
        break
for i in range(l - 1, -1, -1):
    if s[i] == 'Z':
        z = i
        break
print(z - a + 1)
Problem:
Write a program which reads an integer and prints sum of its digits.

Incorrect submission (verdict: Wrong Answer):
number = input()
number2 = []
for i in range(len(number)):
    number2.append(number[i])

number2 = map(int, number2)
answer = sum(number2)

print(answer)

Fixed, accepted submission:
while True:
    number = input()
    if number == "0":
        break
    else:
        number2 = []
        for i in range(len(number)):
            number2.append(number[i])

        number2 = map(int, number2)
        answer = sum(number2)

        print(answer)
Problem:
Takahashi loves numbers divisible by 2.  You are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.  Here, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.  For example,    * 6 can be divided by 2 once: 6 -> 3.   * 8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.   * 3 can be divided by 2 zero times.

Incorrect submission (verdict: Wrong Answer):
N = int(input())

target = 1
for i in range(1, N+1):
    print('i=', i)
    if 2 ** i <= N:
        target = 2 ** i

print(target)

Fixed, accepted submission:
N = int(input())

target = 1
for i in range(1, N+1):
    if 2 ** i <= N:
        target = 2 ** i

print(target)
Problem:
You are given a image with a height of H pixels and a width of W pixels. Each pixel is represented by a lowercase English letter. The pixel at the i-th row from the top and j-th column from the left is a_{ij}.  Put a box around this image and output the result. The box should consist of `#` and have a thickness of 1.

Incorrect submission (verdict: Wrong Answer):
H,W = map(int,input().split())
A = [input().split() for i in range(H)]


X = "#"*W

#print(H,W,A)


for i in range(H):
	A[i][0] = "#" + A[i][0] +"#"

print(X)
for i in range(H):
	print(A[i][0])
print(X)


Fixed, accepted submission:
H,W = map(int,input().split())
A = [input().split() for i in range(H)]


X = "#"*(W+2)

#print(H,W,A)


for i in range(H):
	A[i][0] = "#" + A[i][0] +"#"

print(X)
for i in range(H):
	print(A[i][0])
print(X)
Problem:
Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.

Incorrect submission (verdict: Wrong Answer):
a=''.join(sorted(map(str,input().split())))
print('Yes' if a=='557' else 'No')

Fixed, accepted submission:
a=''.join(sorted(map(str,input().split())))
print('YES' if a=='557' else 'NO')
Problem:
Snuke has a favorite restaurant.  The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer.  So far, Snuke has ordered N meals at the restaurant. Let the amount of money Snuke has paid to the restaurant be x yen, and let the amount of money the restaurant has paid back to Snuke be y yen. Find x-y.

Incorrect submission (verdict: Wrong Answer):
N = int(input())

x = 800*N
y = 200+(N//15)
print(x-y)

Fixed, accepted submission:
N = int(input())

x = 800*N
y = 200*(N//15)
print(x-y)
Problem:
M-kun is a competitor in AtCoder, whose highest rating is X.   In this site, a competitor is given a _kyu_ (class) according to his/her highest rating. For ratings from 400 through 1999, the following kyus are given:    * From 400 through 599: 8-kyu   * From 600 through 799: 7-kyu   * From 800 through 999: 6-kyu   * From 1000 through 1199: 5-kyu   * From 1200 through 1399: 4-kyu   * From 1400 through 1599: 3-kyu   * From 1600 through 1799: 2-kyu   * From 1800 through 1999: 1-kyu  What kyu does M-kun have?

Incorrect submission (verdict: Wrong Answer):
print(9 - int(input())//200)

Fixed, accepted submission:
print(10 - int(input())//200)