TnT/CodeNet4Repair huggingface dataset:
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 = list(map(int,input().split()))

a.sort(reverse=True)

print(sum(a[0::2])-sum(a[1::2]))

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

if n % 500 <= a:
    print("Yes")
else:
    print("No")
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):
input = list(map(str,input().split()))
num = ''.join(input)

if(int(num) % 4 == 0):
    print('YES')
else:
    print('NO')

Fixed, accepted submission:
pay  = int(input())
coin = int(input())

mod = pay % 500
if mod <= coin:
    print('Yes')
else:
    print('No')
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):
# ABC095C

a, b, c, x, y = map(int, input().split())
if a > c or b > c:
    t = min(x, y)
    print("(1)", (x - t)*a + (y - t)*b + t*2*c)
else:
    print("(2)", a*x + b*y)


Fixed, accepted submission:
import numpy as np
def f(a, b, c, x, y):
    Min = np.inf
    for use_c in range(max(x, y) * 2 + 1):
        price = use_c * c + max(0, x - use_c // 2) * a + max(0, y - use_c // 2) * b
        if price < Min:
            Min = price
    print(Min)

a, b, c, x, y = map(int, input().split())
f(a, b, c, x, y)
Problem:
You are given three words s_1, s_2 and s_3, each composed of lowercase English letters, with spaces in between. Print the acronym formed from the uppercased initial letters of the words.

Incorrect submission (verdict: Wrong Answer):
s1, s2, s3 = input().split()
ans = s1[0] + s2[0] + s3[0]
print(ans)

Fixed, accepted submission:
s1, s2, s3 = input().split()
ans = str.upper(s1[0] + s2[0] + s3[0])
print(ans)
Problem:
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
A.sort()
X = A[-1]
X2 = X // 2
dd = A[-1]
for i in range(N - 1):
    d = abs(X2 - A[i])
    if d < dd:
        Y = A[i]
print(X, Y)

Fixed, accepted submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
X = A[-1]
X2 = (X + 1) // 2
dd = A[-1]
for i in range(N - 1):
    d = abs(X2 - A[i])
    if d < dd:
        dd = d
        Y = A[i]
print(X, Y)
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):
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0

for num_a in range(1, a + 1):
  for num_b in range(1, b + 1):
    for num_c in range(1, c + 1):
      if 500 * num_a + 100 * num_b + 50 * num_c == x:
        ans += 1

print(ans)

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

ans = 0

for num_a in range(0, a + 1):
  for num_b in range(0, b + 1):
    for num_c in range(0, c + 1):
      if 500 * num_a + 100 * num_b + 50 * num_c == x:
        ans += 1

print(ans)
Problem:
You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:    * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`.

Incorrect submission (verdict: Wrong Answer):
S = list(input())
tmp = ''
L = len(S)
S.append('0')
S.append('0')
ans = 0
for i in range(L):
    tmp += str(S[i])
    if tmp=='dream':
        if tmp+str(S[i+1])+str(S[i+2])=='dreamer':
            ans += len(tmp)+2
            tmp = ''
            i+=2
        else:
            ans += len(tmp)
            tmp = ''
    if tmp == 'erase':
        if tmp+str(S[i+1])=='eraser':
            ans += len(tmp)+1
            tmp  = ''
            i+=1
if ans == len(S):
    print('YES')
else:
    print('NO')

Fixed, accepted submission:
S = list(input())
tmp = ''
L = len(S)
S = S[-1:-L-1:-1]
Kouho = ['maerd','remaerd','esare','resare']
ans = 0
for i in range(L):
    
    tmp += str(S[i])
    if tmp in Kouho:
        ans += len(tmp)
        tmp = ''
if ans == L:
    print('YES')
else:
    print('NO')
Problem:
You are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits "1974".

Incorrect submission (verdict: Wrong Answer):
n1, n2, n3, n4 = input().split()
if {n1, n2, n3, n4} == {1, 9, 7, 4}:
  print("YES")
else:
  print("NO")

Fixed, accepted submission:
n1, n2, n3, n4 = map(int, input().split())
if {n1, n2, n3, n4} == {1, 9, 7, 4}:
  print("YES")
else:
  print("NO")
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())
h = int(input())
result = (a + b) * h / 2
print(result)


Fixed, accepted submission:
a = int(input())
b = int(input())
h = int(input())
result = int((a + b) * h / 2)
print(result)
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):
form = input()
form = form.split()
form.sort()

if form == [5,5,7]:
  print("YES")
else:
  print("NO")

Fixed, accepted submission:
s = input()
s = s.split()
s.sort()

if s == ["5","5","7"]:
  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
ans = 0
while x >= a:
    ans += 1
    a = int(a * 1.01)
print(ans)


Fixed, accepted submission:
x = int(input())
a = 100
ans = 0
while x > a:
    ans += 1
    a = int(a * 1.01)
print(ans)
Problem:
There is a cave.  The cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside.  It is dark in the cave, so we have decided to place a signpost in each room except Room 1. The signpost in each room will point to one of the rooms directly connected to that room with a passage.  Since it is dangerous in the cave, our objective is to satisfy the condition below for each room except Room 1.    * If you start in that room and repeatedly move to the room indicated by the signpost in the room you are in, you will reach Room 1 after traversing the minimum number of passages possible.  Determine whether there is a way to place signposts satisfying our objective, and print one such way if it exists.

Incorrect submission (verdict: Wrong Answer):
n,m = map(int,input().split())
C = [[0 for j in range(2)] for i in range(m)]
for i in range(m):
    C[i] = list(map(int,input().split()))
    if C[i][0] > C[i][1]:
        C[i][0], C[i][1] = C[i][1],C[i][0]
sortF = lambda val : val[0]
C.sort(key=sortF)
a =  [0]*n
b = [0]*n
for i in range(m):
    if C[i][0] == 1:
        a[C[i][1]-1] = C[i][0]
        b[C[i][1]-1] += 1
    elif a[C[i][1]-1] != 0:
        a[C[i][0]-1] = C[i][1]
        b[C[i][0]-1] = b[C[i][1]-1] + 1
    elif a[C[i][0]-1] != 0:
        a[C[i][1]-1] = C[i][0]
        b[C[i][1]-1] = b[C[i][0]-1] + 1
for i in range(m):
    if a[C[i][1]-1] != 0:
        if b[C[i][1]-1] != 0 and b[C[i][1]-1] + 1 < b[C[i][0]-1]:  
            a[C[i][0]-1] = C[i][1]
            b[C[i][0]-1] = b[C[i][1]-1] + 1
    elif a[C[i][0]-1] != 0:
        if b[C[i][0]-1] != 0 and b[C[i][1]-1] + 1 < b[C[i][1]-1]:  
            a[C[i][1]-1] = C[i][0]
            b[C[i][1]-1] = b[C[i][0]-1] + 1
print("Yes")
for i in range(n-1):
    print(a[i+1])

Fixed, accepted submission:
n,m = map(int,input().split())
V = [None] + [[] for _ in range(n)]
for i in range(m):
    a, b= map(int,input().split())
    V[a].append(b)
    V[b].append(a)

from collections import deque
q = deque()
reach = [None] + [0] + [-1]*(n-1)
goal  = [None] + [0]*n
for L in V[1]:
    q.append(L)
    reach[L] = reach[1] + 1
    goal[L] = 1
while q:
    p = q.popleft()
    for L in V[p]:
        if reach[L] == -1:
            q.append(L)
            reach[L] = reach[p] + 1
            goal[L] = p
print("Yes")
for i in range(len(goal)-2):
    print(goal[i+2])
Problem:
We have a grid with H rows and W columns, where all the squares are initially white.  You will perform some number of painting operations on the grid. In one operation, you can do one of the following two actions:    * Choose one row, then paint all the squares in that row black.   * Choose one column, then paint all the squares in that column black.  At least how many operations do you need in order to have N or more black squares in the grid? It is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.

Incorrect submission (verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
print(int(n / max(h,w)))

Fixed, accepted submission:
h = int(input())
w = int(input())
n = int(input())
m = max(h, w)
if n % m:
  print(n // m + 1)
else:
  print(n // m)
Problem:
Write a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:                 for i = 1 to A.length-1     key = A[i]     /* insert A[i] into the sorted sequence A[0,...,j-1] */     j = i - 1     while j >= 0 and A[j] > key         A[j+1] = A[j]         j--     A[j+1] = key   Note that, indices for array elements are based on 0-origin.  To illustrate the algorithms, your program should trace intermediate result for each step.

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

print(A)

def insertionSort(A,N):
    for i in range(1,N):
        v = A[i]
        j = i -1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print(A)
        
insertionSort(A,N)


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

def insertionSort(A,N):
    for i in range(1,N):
        v = A[i]
        j = i -1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v

        outputNum(A)

def outputNum(A):
    tmp = map(str,A)
    text = " ".join(tmp)
    print(text)

outputNum(A)
insertionSort(A,N)
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):
n = map(int,input().split())
print(sum(n))

Fixed, accepted submission:
n = map(int,list(input()))
print(sum(n))
Problem:
Iroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.  She is shopping, and now paying at the cashier. Her total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).  However, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.  Find the amount of money that she will hand to the cashier.

Incorrect submission (verdict: Wrong Answer):
price, hate = input().split()
no_num = set([x for x in input().split()])
ok_num = sorted(list({'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - no_num))
print(ok_num)

result = []
for i in price:
    print(i)
    for j in ok_num:
        if i <= j:
            result.append(j)
            break

print(''.join(result))


Fixed, accepted submission:
kingaku, n = input().split()
no_num = input().split()
ok_num = [str(i) for i in range(10) if not str(i) in no_num]
result = []
 
for i in kingaku:
    for j in ok_num:
        if i == j:
            result.append(j)
            break
        elif i < j:
            result.append(j)
            print("".join(result).ljust(len(kingaku), ok_num[0]))
            exit()
            break
    else:
        n = 1 if ok_num[0] == '0' else 0
        print(ok_num[n].ljust(len(kingaku)+1, ok_num[0]))
        exit()
 
print(''.join(result))
Problem:
There are N cities. There are also K roads and L railways, extending between the cities. The i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_i-th cities. No two roads connect the same pair of cities. Similarly, no two railways connect the same pair of cities.  We will say city A and B are _connected by roads_ if city B is reachable from city A by traversing some number of roads. Here, any city is considered to be connected to itself by roads. We will also define _connectivity by railways_ similarly.  For each city, find the number of the cities connected to that city by both roads and railways.

Incorrect submission (verdict: Wrong Answer):
N, K, L = map(int, input().split())
city = [{"path":{i},"train":{i}} for i in range(N)]
for i in range(K):
    p, q = map(int, input().split())
    city[p-1]["path"].add(q-1)
    city[q-1]["path"].add(p-1)
for i in range(L):
    r, s = map(int, input().split())
    city[r-1]["train"].add(s-1)
    city[s-1]["train"].add(r-1)
for i in range(N):
    for x in city[i]["path"]:
        city[i]["path"] = city[i]["path"] | city[x]["path"]
    for y in city[i]["train"]:
        city[i]["train"] = city[i]["train"] | city[y]["train"]
for i in range(N):
    print(len(city[i]["path"]&city[i]["train"]), end=" ")


Fixed, accepted submission:
N, K, L = map(int, input().split())
#Parent List(PL)
road = [i for i in range(N)]
rail = [i for i in range(N)]

def fp(x,P): #findParent
    if x == P[x]:
        return x
    else:
        P[x] = fp(P[x],P)
        return P[x]

for i in range(K+L):
    PL = (lambda x:road if x < K else rail)(i)
    p, q = map(lambda x:int(x)-1, input().split())
    p, q = fp(p,PL), fp(q,PL)
    PL[p] = PL[q] = min(p,q)

from collections import defaultdict as dd
Wconnected = dd(lambda:0)
for i in range(N):
    Wconnected[fp(i,road),fp(i,rail)] += 1
print(*[Wconnected[fp(i,road),fp(i,rail)] for i in range(N)])
Problem:
There are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively. Print `Yes` if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print `No` otherwise.

Incorrect submission (verdict: Wrong Answer):
A,B,C = map(int,input().split())
if A<C & C<B:
	print("yes")
else:
	print("No")

Fixed, accepted submission:
A,B,C = map(int,input().split())
if A>C & C>B:
	print("Yes")
if B>C & C>A:
   	print("Yes")
if C>A & A>B:
	print("No")
if B>A & A>C:
	print("No")
if A>B & B>C:
	print("No")
if C>B & B>A:
	print("No")
Problem:
There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies.  Snuke can perform the following operation any number of times:    * Choose a box containing at least one candy, and eat one of the candies in the chosen box.  His objective is as follows:    * Any two neighboring boxes contain at most x candies in total.  Find the minimum number of operations required to achieve the objective.

Incorrect submission (verdict: Wrong Answer):
def main():
    N, x = map(int, input().split())
    A = list(map(int, input().split()))
    ans = 0
    if A[0] > x:
        diff = A[0] - x
        A[0] = x
        ans += diff
    if A[-1] > x:
        diff = A[-1] - x
        A[-1] = x
        ans += diff
    B = [a for a in A]
    ans1 = 0
    for i in range(N-1):
        s = A[i] + A[i + 1]
        if s <= x:
            continue
        diff = s - x
        if diff > A[i + 1]:
            A[i] -= diff - A[i + 1]
            A[i + 1] = 0
        else:
            A[i + 1] -= diff
        ans1 += diff

    ans2 = 0
    for i in range(N - 1):
        index = N - 1 - i
        s = B[index] + B[index - 1]
        if s <= x:
            continue
        diff = s - x
        print(index, s, diff)
        if diff > B[index - 1]:
            B[index] -= diff - B[index - 1]
            B[index - 1] = 0
        else:
            B[index - 1] -= diff
        ans2 += diff
    ans += min(ans1, ans2)

    print(ans)

if __name__ == '__main__':
    main()


Fixed, accepted submission:
def main():
    N, x = map(int, input().split())
    A = list(map(int, input().split()))
    ans = 0
    if A[0] > x:
        diff = A[0] - x
        A[0] = x
        ans += diff
    if A[-1] > x:
        diff = A[-1] - x
        A[-1] = x
        ans += diff
    B = [a for a in A]
    ans1 = 0
    for i in range(N-1):
        s = A[i] + A[i + 1]
        if s <= x:
            continue
        diff = s - x
        if diff > A[i + 1]:
            A[i] -= diff - A[i + 1]
            A[i + 1] = 0
        else:
            A[i + 1] -= diff
        ans1 += diff

    ans2 = 0
    for i in range(N - 1):
        index = N - 1 - i
        s = B[index] + B[index - 1]
        if s <= x:
            continue
        diff = s - x
        if diff > B[index - 1]:
            B[index] -= diff - B[index - 1]
            B[index - 1] = 0
        else:
            B[index - 1] -= diff
        ans2 += diff
    ans += min(ans1, ans2)

    print(ans)

if __name__ == '__main__':
    main()
Problem:
You are given a sequence of positive integers of length N, a = (a_1, a_2, ..., a_N). Your objective is to remove some of the elements in a so that a will be a **good sequence**.  Here, an sequence b is a **good sequence** when the following condition holds true:    * For each element x in b, the value x occurs exactly x times in b.  For example, (3, 3, 3), (4, 2, 4, 1, 4, 2, 4) and () (an empty sequence) are good sequences, while (3, 3, 3, 3) and (2, 4, 1, 4, 2) are not.  Find the minimum number of elements that needs to be removed so that a will be a good sequence.

Incorrect submission (verdict: Wrong Answer):
n = input()
str = input()
nums = str.split()
num_dict = {}
for num in nums:
    if num in num_dict:
        num_dict[num] += 1
    else:
        num_dict[num] = 1
result = 0
for k, v in num_dict.items():
    if int(k) > v:
        result += v
    elif int(k) < v:
        result += int(k)

print(result)


Fixed, accepted submission:
n = input()
str = input()
nums = str.split()
num_dict = {}
for num in nums:
    if num in num_dict:
        num_dict[num] += 1
    else:
        num_dict[num] = 1
result = 0
for k, v in num_dict.items():
    if int(k) > v:
        result += v
    elif int(k) < v:
        result += (v - int(k))

print(result)
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):


import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


def num(n):
    cnt = 0
    while n:
        if n % 2 == 0:
            cnt += 1
            n /= 2
        else:
            break
    return cnt


N, *A = map(int, read().decode('utf8').split())

ans = 0
for i in A:
    ans += num(i)
print(ans)


Fixed, accepted submission:


import sys

# import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
A = np.array(readline().split(), dtype=np.int64)

ans=0
while np.all(A%2==0):
    A//=2
    ans+=1
print(ans)
Problem:
Write a program which finds the greatest common divisor of two natural numbers _a_ and _b_

Incorrect submission (verdict: Wrong Answer):
x,y = list(map(int,input().split()))

###??????x >= y
if y>x:x,y = y,x

while x % y !=0:
    y = x%y
    if y > x:x,y = y,x
print(y)

Fixed, accepted submission:
x,y = list(map(int,input().split()))

###??????x >= y
if y>x:x,y = y,x

while x % y !=0:
    x = x%y
    if y>x:x,y = y,x
print(y)
Problem:
Write a program which reads two integers a, b and an operator op, and then prints the value of a op b.  The operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.

Incorrect submission (verdict: Wrong Answer):
a = 1
b = 1
op = ''
i = 0
while op!='?':
	a,op,b = [i for i in input().split()]
	a = int(a)
	b = int(b)
	if op!='?':
		if op=='+':
			print(a+b)
		elif op=='-':
			print(a-b)
		elif op=='*':
			print(a*b)
		elif op=='/':
			print(a/b)

Fixed, accepted submission:
a = 1
b = 1
op = ''
i = 0
while op!='?':
	a,op,b = [i for i in input().split()]
	a = int(a)
	b = int(b)
	if op!='?':
		if op=='+':
			print(a+b)
		elif op=='-':
			print(a-b)
		elif op=='*':
			print(a*b)
		elif op=='/':
			print(a//b)
Problem:
You are given a string S of length N. Among its subsequences, count the ones such that all characters are different, modulo 10^9+7. Two subsequences are considered different if their characters come from different positions in the string, even if they are the same as strings.  Here, a subsequence of a string is a concatenation of **one or more** characters from the string without changing the order.

Incorrect submission (verdict: Wrong Answer):
from collections import Counter
n = int(input())
s = input()
mod = 10**9 + 7
ans = 1
scnt = Counter(s)
# print(scnt)
for cnt in scnt.values():
    print(cnt)
    ans *= (cnt+1) % mod

print(ans-1)

Fixed, accepted submission:
from collections import Counter
n = int(input())
s = input()
mod = 10**9 + 7
ans = 1
scnt = Counter(s)
for cnt in scnt.values():
    ans = ans*(cnt+1) % mod

print(ans-1)
Problem:
AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number.

Incorrect submission (verdict: Wrong Answer):
import math

a, b = [int(n) for n in input().split()]
res = math.sqrt(a * b)
if res % 1 == 0:
    print('YES')
else:
    print('NO')

Fixed, accepted submission:
import math

a, b = [int(n) for n in input().split()]
res = math.sqrt(int(str(a)+str(b)))
if res % 1 == 0:
    print('Yes')
else:
    print('No')