TnT/CodeNet4Repair huggingface dataset:
Problem:
There are N buildings along the line. The i-th building from the left is colored in color i, and its height is currently a_i meters.   Chokudai is a mayor of the city, and he loves colorful thigs. And now he wants to see at least K buildings from the left.      You can increase height of buildings, but it costs 1 yens to increase 1 meters. It means you cannot make building that height is not integer.   You cannot decrease height of buildings.   Calculate the minimum cost of satisfying Chokudai's objective.   Note: "Building i can see from the left" means there are no j exists that (height of building j) ≥ (height of building i) and j < i.

Incorrect submission (verdict: Wrong Answer):
n, k = map(int,input().split())
a = list(map(int,input().split()))

res = float("inf")
for i in range(2**n):
    if(i%2 == 0):
        continue
    useidx = [0 for _ in range(n)]
    usecnt = 0
    for j in range(n):
        if (i>>j)&1:
            useidx[j] = 1
            usecnt = usecnt+1
    if (usecnt < k):
        continue
    sm = 0
    mx = a[0]
    for j in range(1,n):
        if useidx[j]==1:
            if a[j]<=mx:
                print("a[j]="+str(a[j]))
                sm = sm + (mx+1)-a[j]
                print("max="+str(mx+1))
                mx = mx +1
        mx = max(mx, a[j])
    res = min(res,sm)
print(sm)

Fixed, accepted submission:
n, k = map(int, input().split())
a = list(map(int, input(). split()))

res = 1 << 60 
for i in range(1<<n): 
    if(i%2 == 0): continue 

    use_idx = [0 for _ in range(n)] 
    use_cnt = 0 
    for j in range(n):
        if(i & (1<<j)):
            use_idx[j] = 1 
            use_cnt += 1 

    if(use_cnt != k): continue 

    sm = 0 
    mx = a[0] 
    for j in range(1, n):

        if(use_idx[j]): 
            if(a[j] <= mx): 
                sm += mx+1 - a[j] 
                mx += 1 

        mx = max(mx, a[j]) 

    res = min(res, sm) 

print(res)
Problem:
Determine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.

Incorrect submission (verdict: Wrong Answer):
import math

n, k = map(int, input().split())
if k <= math.ceil(n/2):
    print("Yes")
else:
    print("No")

Fixed, accepted submission:
import math

n, k = map(int, input().split())
if k <= math.ceil(n/2):
    print("YES")
else:
    print("NO")
Problem:
Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.  The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)  Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?

Incorrect submission (verdict: Wrong Answer):
X=int(input())
a=100
count=0

while a<=X:
  a=int(a+(a*0.01))
  count=count+1

print(count)

Fixed, accepted submission:
X=int(input())
a=100
count=0

while a<X:
  a=int(a+(a*0.01))
  count=count+1

print(count)
Problem:
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.  Nakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.

Incorrect submission (verdict: Wrong Answer):

input_line =input()
input_line = input_line.rstrip().split(" ")

a = int(input_line[0])
b = int(input_line[1])
c = int(input_line[2])
x = int(input_line[3])
y = int(input_line[4])

list1=[]
for i in range(max(x,y)+1):
    if x-i<=0:
        cost = b*(y-i)+2*c*i
        list1.append(cost)
        i +=1
    elif y-i<=0:
        cost = a*(x-i)+2*c*i
        list1.append(cost)
        i +=1
    else:
        cost = a*(x-i)+b*(y-i)+2*c*i
        list1.append(cost)
        i +=1
    

print(min(list1))


Fixed, accepted submission:
A,B,C,X,Y=map(int,input().split())

ans=10**10
for i in range(max(X,Y)+1):
    cnt=0
    cnt+=C*2*i
    x=X-i
    y=Y-i
    cnt+=max(0,x*A)
    cnt+=max(0,y*B)
    if ans>cnt:
        ans=cnt
print(ans)
Problem:
You are given an integer N. Build an undirected graph with N vertices with indices 1 to N that satisfies the following two conditions:    * The graph is simple and connected.   * There exists an integer S such that, for every vertex, the sum of the indices of the vertices adjacent to that vertex is S.  It can be proved that at least one such graph exists under the constraints of this problem.

Incorrect submission (verdict: Wrong Answer):
from itertools import combinations as comb

N = int(input())
n = N-1 if N%2 else N
s = set()

for i in range(1, N+1):
    if N%2:
        a, b = i, N-i
    else:
        a, b = i, N-i+1
    if a<b:
        s.add((a, b))

for i in comb(range(1, N+1), 2):
    if not i in s:
        print(*i)

Fixed, accepted submission:
from itertools import combinations as comb

N = int(input())
n = N-N%2
s = {(i, n+1-i) for i in range(1, N+1) if i<n+1-i}

l = [i for i in comb(range(1, N+1), 2) if not i in s]
print(len(l))
for i in l:
    print(*i)
Problem:
M-kun is a student in Aoki High School, where a year is divided into N terms.   There is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:    * For the first through (K-1)-th terms: not given.   * For each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.  M-kun scored A_i in the exam at the end of the i-th term.   For each i such that K+1 \leq i \leq N, determine whether his grade for the i-th term is **strictly** greater than the grade for the (i-1)-th term.

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

results = list()
for first, second in zip(A[0:N - K], A[K:N]):
    print(first, second)
    if second > first:
        results.append(True)
    else:
        results.append(False)

for res in results:
    if res:
        print('Yes')
    else:
        print('No')


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

results = list()
for first, second in zip(A[0:N - K], A[K:N]):
    if second > first:
        results.append(True)
    else:
        results.append(False)

for res in results:
    if res:
        print('Yes')
    else:
        print('No')
Problem:
It is November 18 now in Japan. By the way, 11 and 18 are adjacent Lucas numbers.  You are given an integer N. Find the N-th Lucas number.  Here, the i-th Lucas number L_i is defined as follows:    * L_0=2   * L_1=1   * L_i=L_{i-1}+L_{i-2} (i≥2)

Incorrect submission (verdict: Wrong Answer):
# coding: utf-8
N=int(input())
lst=[2,1]
for i in range(N):
    lst.append(lst[i]+lst[i+1])
    print(lst[i+2])
print(lst[N])


Fixed, accepted submission:
# coding: utf-8
N=int(input())
lst=[2,1]
for i in range(N):
    lst.append(lst[i]+lst[i+1])
print(lst[N])
Problem:
You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total?  Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.

Incorrect submission (verdict: Wrong Answer):
# -*- coding: utf-8 -*-
 
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0

for i in range(1, A + 1):
  for j in range(1, B + 1):
    for k in range(1, C + 1):
      if 500 * i + 100 * j + 50 * k == X:
        count += 1
print(count)

Fixed, accepted submission:
# -*- coding: utf-8 -*-
 
A = int(input())
B = int(input())
C = int(input())
X = int(input())
 
count = 0
 
for i in range(A + 1):
  for j in range(B + 1):
    for k in range(C + 1):
      if 500 * i + 100 * j + 50 * k == X:
        count += 1
print(count)
Problem:
Write a program which reads an integer _n_ and draws a Koch curve based on recursive calles of depth _n_.  The Koch curve is well known as a kind of   You should start (0, 0), (100, 0) as the first segment.

Incorrect submission (verdict: Wrong Answer):
import math as mt

def kock(n, p1, p2):
    if n == 0:
        return
    s =[(2 * p1[0] + p2[0]) / 3 , (2 * p1[1] + p2[1]) / 3]
    t = [(p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3]
    u = [(t[0]-s[0])*mt.cos(mt.radians(60))
        -(t[1]-s[1])*mt.sin(mt.radians(60)) + s[0],
         (t[0]-s[0])*mt.sin(mt.radians(60))
         +(t[1]-s[1])*mt.cos(mt.radians(60)) + s[1]]

    kock(n-1, p1, s)
    print("{0:.8f} {1:.8f}".format(s[1],s[0]))
    kock(n-1, s, u)
    print("{0:.8f} {1:.8f}".format(u[1],u[0]))
    kock(n-1, u, t)
    print("{0:.8f} {1:.8f}".format(t[1],t[0]))
    kock(n-1, t, p2)


if __name__ == '__main__':
    n = 2
    p1 = (0,0)
    p2 = (0,100)
    print("{0:.8f} {1:.8f}".format(p1[0],p1[1]))
    kock(n, p1, p2)
    print("{0:.8f} {1:.8f}".format(p2[0],p2[1]))

Fixed, accepted submission:
import math as mt

def kock(n, p1, p2):
    if n == 0:
        return
    s =[(2 * p1[0] + p2[0]) / 3 , (2 * p1[1] + p2[1]) / 3]
    t = [(p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3]
    u = [(t[0]-s[0])*mt.cos(mt.radians(60))
        -(t[1]-s[1])*mt.sin(mt.radians(60)) + s[0],
         (t[0]-s[0])*mt.sin(mt.radians(60))
         +(t[1]-s[1])*mt.cos(mt.radians(60)) + s[1]]

    kock(n-1, p1, s)
    print("{0:.8f} {1:.8f}".format(s[0],s[1]))
    kock(n-1, s, u)
    print("{0:.8f} {1:.8f}".format(u[0],u[1]))
    kock(n-1, u, t)
    print("{0:.8f} {1:.8f}".format(t[0],t[1]))
    kock(n-1, t, p2)


if __name__ == '__main__':
    n = int(input())
    p1 = (0,0)
    p2 = (100,0)
    print("{0:.8f} {1:.8f}".format(p1[0],p1[1]))
    kock(n, p1, p2)
    print("{0:.8f} {1:.8f}".format(p2[0],p2[1]))
Problem:
Snuke is making sugar water in a beaker. Initially, the beaker is empty. Snuke can perform the following four types of operations any number of times. He may choose not to perform some types of operations.    * Operation 1: Pour 100A grams of water into the beaker.   * Operation 2: Pour 100B grams of water into the beaker.   * Operation 3: Put C grams of sugar into the beaker.   * Operation 4: Put D grams of sugar into the beaker.  In our experimental environment, E grams of sugar can dissolve into 100 grams of water.  Snuke will make sugar water with the highest possible density.  The beaker can contain at most F grams of substances (water and sugar combined), and there must not be any undissolved sugar in the beaker. Find the mass of the sugar water Snuke will make, and the mass of sugar dissolved in it. If there is more than one candidate, any of them will be accepted.  We remind you that the sugar water that contains a grams of water and b grams of sugar is \frac{100b}{a + b} percent. Also, in this problem, pure water that does not contain any sugar is regarded as 0 percent density sugar water.

Incorrect submission (verdict: Wrong Answer):
a,b,c,d,e,f = map(int, input().split(' '))

w = 0
s = 0
ratio = 0

for i in range((f // (b*100))+1):
    for j in range(((f-(i*b*100))//a)+1):
        if i == 0 and j == 0:
            continue
        smax = min(f-(j*a+i*b)*100,(j*a+i*b)*e)
        sm = 0
        for k in range((smax//d)+1):
            sm = max(sm, k*d+c*((smax-(k*d))//c))

            ratio = sm/((j*a+i*b)*100+sm)
            w = (j*a+i*b)*100
            s = sm



print("%i %i" %(w+s,s))


Fixed, accepted submission:
a,b,c,d,e,f = map(int, input().split(' '))

w = 0
s = 0
ratio = 0

for i in range((f // (b*100))+1):
    for j in range(((f-(i*b*100))//(a*100))+1):
        if i == 0 and j == 0:
            continue
        smax = min(f-(j*a+i*b)*100,(j*a+i*b)*e)
        sm = 0
        for k in range((smax//d)+1):
            sm = max(sm, k*d+c*((smax-(k*d))//c))
        if ratio <= sm/((j*a+i*b)*100+sm):
            ratio = sm/((j*a+i*b)*100+sm)
            w = (j*a+i*b)*100
            s = sm


print("%i %i" %(w+s,s))
Problem:
E869120 has A 1-yen coins and infinitely many 500-yen coins.   Determine if he can pay exactly N yen using only these coins.

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

for i in range(A):
    if (N-i)%500==0:
        print("Yes")
    else:
        print("No")

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

x=N%500
if x<=A:
    print("Yes")
else:
    print("No")
Problem:
Snuke has one biscuit and zero Japanese yen (the currency) in his pocket. He will perform the following operations exactly K times in total, in the order he likes:    * Hit his pocket, which magically increases the number of biscuits by one.   * Exchange A biscuits to 1 yen.   * Exchange 1 yen to B biscuits.  Find the maximum possible number of biscuits in Snuke's pocket after K operations.

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

if(B-A <= 2):
    print(K+1)
else:
    m = max(0, K-(A-1)//2)*(B-A)+(K+1)-2*max(0, K-(A-1)//2)
    print(m)

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

if(B-A <= 2):
    print(K+1)
else:
    m = max(0, (K-(A-1))//2)*(B-A)+(K+1)-2*max(0, (K-(A-1))//2)
    print(m)
Problem:
Tak has N cards. On the i-th (1 \leq i \leq N) card is written an integer x_i. He is selecting one or more cards from these N cards, so that the average of the integers written on the selected cards is exactly A. In how many ways can he make his selection?

Incorrect submission (verdict: Wrong Answer):
import numpy as np
 
n, a = map(int, input().split())
x = np.array(list(map(int, input().split())))
 
dp = {0:1}
for y in x-a:
    for k, v in dp.copy().items():
        print("before",dp)
        dp[y+k] = dp.get(y+k, 0) + v
        print("after",dp)
 
print(dp[0]-1)


Fixed, accepted submission:
import numpy as np
 
n, a = map(int, input().split())
x = np.array(list(map(int, input().split())))
 
dp = {0:1}
for y in x-a:
    for k, v in dp.copy().items():
        dp[y+k] = dp.get(y+k, 0) + v 
print(dp[0]-1)
Problem:
Given is a rooted tree with N vertices numbered 1 to N. The root is Vertex 1, and the i-th edge (1 \leq i \leq N - 1) connects Vertex a_i and b_i.  Each of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.  Now, the following Q operations will be performed:    * Operation j (1 \leq j \leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.  Find the value of the counter on each vertex after all operations.

Incorrect submission (verdict: Wrong Answer):
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 16 21:29:27 2019

@author: lamducanhndgv

"""

class Node:
    def __init__(self):
        self.value = 0
        self.next = []
    
    def __add__(self, value):
        self.value += value
        return self
    
    def add_next(self, node):
        self.next.append(node)

def solution(t):
    q = []
    q.append((0, 0))
    while q:
        addValue, tNode = q.pop(0)
        t[tNode] += addValue 
        for i in t[tNode].next:
            q.append((t[tNode].value, i))
            
        

if __name__ == "__main__":
    
    N, Q = list(map(int, input().split()))
    tree = [Node() for i in range(N)]
    for _ in range(N - 1):
        a, b = list(map(int, input().split()))
        tree[a - 1].add_next(b - 1)
    
    for _ in range(Q):
        p, x = list(map(int, input().split()))
        tree[p - 1].value += x
    
    solution(tree)
    
    print(*(i.value for i in tree), end = "")

Fixed, accepted submission:
import collections

n,q=map(int,input().split())
cnt=[0]*(n+1)
g=[[] for _ in range(n+1)]
for _ in range(n-1): 
 a,b=map(int,input().split())
 g[a].append(b)
 g[b].append(a)
for _ in range(q): 
 v,val=map(int,input().split())
 cnt[v]+=val
q=collections.deque()
q.append(1) 
checked=[0]*(n+1) 
while q:
 v=q.pop()
 checked[v]=1 
 for u in g[v]:
   if checked[u]==1: 
     continue
   cnt[u]+=cnt[v]
   q.append(u) 
print(*cnt[1:])
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())
for i in range(w):
  print('#', end='')
print()
for i in range(h):
  print('#', end='')
  print(input(), end='')
  print('#')
for i in range(w):
  print('#', end='')


Fixed, accepted submission:
h,w = map(int, input().split())
for i in range(w+2):
  print('#', end='')
print()
for i in range(h):
  print('#', end='')
  print(input(), end='')
  print('#')
for i in range(w+2):
  print('#', end='')
print()
Problem:
There are N integers, A_1, A_2, ..., A_N, written on a blackboard.  We will repeat the following operation N-1 times so that we have only one integer on the blackboard.    * Choose two integers x and y on the blackboard and erase these two integers. Then, write a new integer x-y.  Find the maximum possible value of the final integer on the blackboard and a sequence of operations that maximizes the final integer.

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

if N==2:
  print(A[-1] - A[0])
  print(A[-1], A[0])

elif A[0]<0 and A[-1]<0:
  tmpA = A.copy()
  print(-sum(A[:-2]) + (A[-1]-A[-2]))

  for i in range(N-1):
    if i==0:
      print(A[-1], A[-2])
      tmp = A[-1] - A[-2]
    elif i==N-2:
      print(tmp, A[-i-1])
    else:
      print(tmp, A[-i-1])
      tmp = tmp - A[i-1]

elif A[0]>0 and A[-1]>0:
  tmpA = A.copy()
  print(sum(A[2:]) + (A[1] - A[0]))

  for i in range(N-1):
    if i==0:
      print(A[0], A[1])
      tmp = A[0] - A[1]
    elif i==N-2:
      print(A[i+1], tmp)
    else:
      print(tmp, A[i+1])
      tmp = tmp - A[i+1]

else:
  tmpA = A.copy()
  len_of_Apos = len([a for a in A if a>=0])
  len_of_Aneg = len([a for a in A if a<0])
  zero_in = 0 in A
  minv = min(len_of_Aneg, len_of_Apos)
  print(sum([abs(a) for a in A]))

Fixed, accepted submission:
def c(N, A):
    A.sort()
    maximum = A.pop()
    minimum = A.pop(0)
    operation = []
    for a in A:
        if a >= 0:
            operation.append('{} {}'.format(minimum, a))
            minimum -= a
        else:
            operation.append('{} {}'.format(maximum, a))
            maximum -= a
    operation.append('{} {}'.format(maximum, minimum))
    return str(maximum - minimum) + '\n' + '\n'.join(operation)

N = int(input())
A = list(map(int, input().split()))
print(c(N, A))
Problem:
You are given a string S of length 3 consisting of `a`, `b` and `c`. Determine if S can be obtained by permuting `abc`.

Incorrect submission (verdict: Wrong Answer):
str_i = input()

if str_i.count('a') == 1 and str_i.count('b') == 1 and str_i.count('c') == 1:
    print('YES')
else:
    print('No')


Fixed, accepted submission:
str_i = input()

if str_i.count('a') == 1 and str_i.count('b') == 1 and str_i.count('c') == 1:
    print('Yes')
else:
    print('No')
Problem:
Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i.  Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble.

Incorrect submission (verdict: Wrong Answer):
sentence = input().split()
count = 0
for i in range(len(sentence)):
  if sentence[i] == 1:
    count+=1

print(count)


Fixed, accepted submission:
s = input()
ans = 0
for i in range(len(s)):
    if s[i] == "1":
        ans += 1
print(ans)
Problem:
Takahashi received _otoshidama_ (New Year's money gifts) from N of his relatives.  You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either `JPY` or `BTC`, and x_i and u_i represent the content of the otoshidama from the i-th relative.  For example, if x_1 = `10000` and u_1 = `JPY`, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = `0.10000000` and u_2 = `BTC`, the otoshidama from the second relative is 0.1 bitcoins.  If we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?

Incorrect submission (verdict: Wrong Answer):
n=int(input())
ans=0
for i in range(n):
  x,u=input().split()
  x=float(x)
  if u=="JPY":
    ans+=x
  else:
    ans+=3800*x
print(int(ans))

Fixed, accepted submission:
n=int(input())
ans=0
for i in range(n):
  x,u=input().split()
  x=float(x)
  if u=="JPY":
    ans+=x
  else:
    ans+=380000*x
print(ans)
Problem:
You are given an H × W grid.   The squares in the grid are described by H strings, S_1,...,S_H.   The j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \leq i \leq H,1 \leq j \leq W).   `.` stands for an empty square, and `#` stands for a square containing a bomb.  Dolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.   (Below, we will simply say "adjacent" for this meaning. For each square, there are at most eight adjacent squares.)   He decides to replace each `.` in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.  Print the strings after the process.

Incorrect submission (verdict: Wrong Answer):
import sys

if sys.platform =='ios':
	sys.stdin=open('input.txt')

h, w = [int(x) for x in input().split()]
board = [input() for _ in range(h)]

mines=['' for _ in range(h)]

print(board)

for row in range(h):
	for col in range(w):
		if board[row][col] != '#':
			counts = 0
			dx = [x for x in range(-1, 2) if (col+x>=0 and col+x<w)]
			dy = [y for y in range(-1, 2) if (row+y>=0 and row+y<h)]
			#print('row:{}, col:{}, dx:{}, dy:{}'.format(row,col,dx,dy))
			for x in dx:
				for y in dy:
					#print('row+y:{}, col+x:{}'.format(row+y, col+x))
					if board[row+y][col+x] == '#':
						counts += 1
			mines[row] += str(counts)
		else:
			mines[row] += '#'
for mine in mines:
	print(mine)

Fixed, accepted submission:
h, w = [int(x) for x in input().split()]
board = [input() for _ in range(h)]

mines=['' for _ in range(h)]

#print(board)

for row in range(h):
    for col in range(w):
        if board[row][col] != '#':
            counts = 0
            dx = [x for x in range(-1, 2) if (col+x>=0 and col+x<w)]
            dy = [y for y in range(-1, 2) if (row+y>=0 and row+y<h)]
            #print('row:{}, col:{}, dx:{}, dy:{}'.format(row,col,dx,dy))
            for x in dx:
                for y in dy:
                    #print('row+y:{}, col+x:{}'.format(row+y, col+x))
                    if board[row+y][col+x] == '#':
                        counts += 1
            mines[row] += str(counts)
        else:
            mines[row] += '#'
for mine in mines:
    print(mine)
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):
data = input().split()


def main(data):
    five_num = data.count(5)
    seven_num = data.count(7)
    if five_num == 2 and seven_num == 1:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main(data)

Fixed, accepted submission:
data = input().split()


def main(data):
    five_num = data.count("5")
    seven_num = data.count("7")
    if five_num == 2 and seven_num == 1:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main(data)