TnT/CodeNet4Repair huggingface dataset:
Problem:
You start with the number 0 and you want to reach the number N.  You can change the number, paying a certain amount of coins, with the following operations:    * Multiply the number by 2, paying A coins.   * Multiply the number by 3, paying B coins.   * Multiply the number by 5, paying C coins.   * Increase or decrease the number by 1, paying D coins.  You can perform these operations in arbitrary order and an arbitrary number of times.  What is the minimum number of coins you need to reach N?  **You have to solve T testcases.**

Incorrect submission (verdict: Time Limit Exceeded):
t = int(input())
  
def solve(n,a,b,c,d):
  sol = [n*d]
  if n>=2:
    if n%2 == 0:
      sol.append(a+solve(n//2,a,b,c,d))
    else:
      sol.append(a+d+solve((n+1)//2,a,b,c,d))
      sol.append(a+d+solve((n-1)//2,a,b,c,d))
  if n>=3:
    if n%3 == 0:
      sol.append(b+solve(n//3,a,b,c,d))
    else:
      bd = n%3
      sol.append(b+bd*d+solve((n-bd)//3,a,b,c,d))
      sol.append(b+(3-bd)*d+solve((n-bd+3)//3,a,b,c,d))
  if n>=5:
    if n%5 == 0:
      sol.append(c+solve(n//5,a,b,c,d))
    else:
      cd = n%5
      sol.append(c+cd*d+solve((n-cd)//5,a,b,c,d))
      sol.append(c+(5-cd)*d+solve((n-cd+5)//5,a,b,c,d))
  return min(sol)

for _ in range(t):
  n,a,b,c,d = map(int,input().split())
  print(solve(n,a,b,c,d))

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

def solve(n,a,b,c,d):
  mem = {0:0,1:d}
  def f(n):
    if n in mem:
      return mem[n]
    ret = n*d
    if n%2 == 0:
      ret = min(ret,a+f(n//2))
    else:
      ret = min(ret,a+d+f(n//2+1),a+d+f(n//2))
    
    if n%3 == 0:
      ret = min(ret,b+f(n//3))
    elif n%3 == 1:
      ret = min(ret,b+d+f(n//3))
    else:
      ret = min(ret,b+d+f(n//3+1))
    
    if n%5 == 0:
      ret = min(ret,c+f(n//5))
    elif n%5 == 1:
      ret = min(ret,c+d+f(n//5))
    elif n%5 == 2:
      ret = min(ret,c+d+d+f(n//5))
    elif n%5 == 3:
      ret = min(ret,c+d+d+f(n//5+1))
    else:
      ret = min(ret,c+d+f(n//5+1))
    mem[n] = ret
    return ret
  return f(n)
 
for _ in range(t):
  n,a,b,c,d = map(int,input().split())
  print(solve(n,a,b,c,d))
Problem:
The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these.  According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.

Incorrect submission (verdict: Wrong Answer):
n, y = map(int, input().split())
answer_a = -1
answer_b = -1
answer_c = -1


for a in range(1, n+1):
  for b in range(1, n+1):
    c = n-a-b
    if a+b+c == n and 10000*a+5000*b+1000*c == y:
      answer_a = a
      answer_b = b
      answer_c = c
print("{} {} {}".format(answer_a,answer_b,answer_c))

Fixed, accepted submission:
n, y = map(int, input().split())
answer_a = -1
answer_b = -1
answer_c = -1


for a in range(0, n+1):
  for b in range(0, n-a+1):
    c = n-a-b
    if 10000*a+5000*b+1000*c == y and c>=0:
      answer_a = a
      answer_b = b
      answer_c = c
print("{} {} {}".format(answer_a,answer_b,answer_c))
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):
print(max(map(int,input().split()))*int(input()))

Fixed, accepted submission:
p=input;a=[int(i)for i in p().split()];m=max(a);print(sum(a)-m+m*2**int(p()))
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):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	D
# CreatedDate:  2020-05-17 22:04:10 +0900
# LastModified: 2020-05-17 22:22:23 +0900
#

from collections import deque

def bfs(path_list,guide,n):
    color = [0]*(n+1)
    color[1] = 1
    Q = deque()
    Q.append(1)
    while Q:
        u = Q.popleft()
        for v in path_list[u]:
            if color[v] == 0:
                color[v]=1
                Q.append(v)
                guide[v]=u

def main():
    n,m = map(int,input().split())
    path_list = [[] for _ in range(n+1)]
    for _ in range(m):
        a,b = map(int,input().split())
#        print(a,b)
        path_list[a].append(b)
        path_list[b].append(a)

#    print(path_list)
    
    guide = [0]*(n+1)
    bfs(path_list,guide,n)
    print("Yes")
    for i in range(2,n):
        print(guide[i])


if __name__ == "__main__":
    main()


Fixed, accepted submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	D
# CreatedDate:  2020-05-17 22:04:10 +0900
# LastModified: 2020-05-17 22:24:55 +0900
#

from collections import deque

def bfs(path_list,guide,n):
    color = [0]*(n+1)
    color[1] = 1
    Q = deque()
    Q.append(1)
    while Q:
        u = Q.popleft()
        for v in path_list[u]:
            if color[v] == 0:
                color[v]=1
                Q.append(v)
                guide[v]=u

def main():
    n,m = map(int,input().split())
    path_list = [[] for _ in range(n+1)]
    for _ in range(m):
        a,b = map(int,input().split())
#        print(a,b)
        path_list[a].append(b)
        path_list[b].append(a)

#    print(path_list)
    
    guide = [0]*(n+1)
    bfs(path_list,guide,n)
    print("Yes")
    for i in range(2,n+1):
        print(guide[i])


if __name__ == "__main__":
    main()
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):
x=int(input())
dig=[]
for i in range(1,4):
  dig.append(x%(10))
  x=x//10
dig.append(x)

d,c,b,a=dig

if (a+b+c+d)==7:
  print(str(a),"+",str(b),"+",str(c),"+",str(d),"=7")
elif (a+b+c-d)==7:
  print(str(a),"+",str(b),"+",str(c),"-",str(d),"=7")
elif (a+b-c+d)==7:
  print(str(a),"+",str(b),"-",str(c),"+",str(d),"=7")
elif (a+b-c-d)==7:
  print(str(a),"+",str(b),"-",str(c),"-",str(d),"=7")
elif (a-b+c+d)==7:
  print(str(a),"-",str(b),"+",str(c),"+",str(d),"=7")
elif (a-b-c+d)==7:
  print(str(a),"-",str(b),"-",str(c),"+",str(d),"=7")
elif (a-b+c-d)==7:
  print(str(a),"-",str(b),"+",str(c),"-",str(d),"=7")
elif (a-b-c-d)==7:
  print(str(a),"-",str(b),"-",str(c),"-",str(d),"=7")

Fixed, accepted submission:
x=int(input())
dig=[]
for i in range(1,4):
  dig.append(x%(10))
  x=x//10
dig.append(x)

d,c,b,a=dig

if (a+b+c+d)==7:
  print(str(a)+"+"+str(b)+"+"+str(c)+"+"+str(d)+"=7")
elif (a+b+c-d)==7:
  print(str(a)+"+"+str(b)+"+"+str(c)+"-"+str(d)+"=7")
elif (a+b-c+d)==7:
  print(str(a)+"+"+str(b)+"-"+str(c)+"+"+str(d)+"=7")
elif (a+b-c-d)==7:
  print(str(a)+"+"+str(b)+"-"+str(c)+"-"+str(d)+"=7")
elif (a-b+c+d)==7:
  print(str(a)+"-"+str(b)+"+"+str(c)+"+"+str(d)+"=7")
elif (a-b-c+d)==7:
  print(str(a)+"-"+str(b)+"-"+str(c)+"+"+str(d)+"=7")
elif (a-b+c-d)==7:
  print(str(a)+"-"+str(b)+"+"+str(c)+"-"+str(d)+"=7")
elif (a-b-c-d)==7:
  print(str(a)+"-"+str(b)+"-"+str(c)+"-"+str(d)+"=7")
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,b,h  = [int(input()) for  i in range(3)]
print((a+b)*h/2)


Fixed, accepted submission:
a,b,h  = [int(input()) for  i in range(3)]
print(int((a+b)*h/2))
Problem:
You are given an integer sequence of length n, a_1, ..., a_n. Let us consider performing the following n operations on an empty sequence b.  The i-th operation is as follows:    1. Append a_i to the end of b.   2. Reverse the order of the elements in b.  Find the sequence b obtained after these n operations.

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

n = int(input())
aa = list(map(int, input().split()))
bb = deque()
left = True
for a in aa:
    if left:
        bb.append(a)
    else:
        bb.appendleft(a)
    left = not left

if left:
    print(list(bb))
else:
    print(list(bb).reverse())



Fixed, accepted submission:
from collections import deque

n = int(input())
aa = list(map(int, input().split()))
bb = deque()
left = True
for a in aa:
    if left:
        bb.append(a)
    else:
        bb.appendleft(a)
    left = not left

if not left:
    bb.reverse()
print(*list(bb))
Problem:
Our world is one-dimensional, and ruled by two empires called Empire A and Empire B.  The capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.  One day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.  If there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.    * X < Z \leq Y   * x_1, x_2, ..., x_N < Z   * y_1, y_2, ..., y_M \geq Z  Determine if war will break out.

Incorrect submission (verdict: Wrong Answer):
N,M,X,Y=(int(i) for i in input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
x.sort()
y.sort()

if x[-1] < (y[0]-1):
    print("No War")
else:
    print("War")

Fixed, accepted submission:
N,M,X,Y=(int(i) for i in input().split())
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
x.sort()
y.sort()
c=0
for i in range(X+1,Y+1):
    if x[-1] < i and i <= y[0]:
        c=2
if c == 0 :
    print("War")
else:
    print("No War")
Problem:
You are given three strings A, B and C. Check whether they form a _word chain_.  More formally, determine whether both of the following are true:    * The last character in A and the initial character in B are the same.   * The last character in B and the initial character in C are the same.  If both are true, print `YES`. Otherwise, print `NO`.

Incorrect submission (verdict: Wrong Answer):
from statistics import mean, median,variance,stdev
import sys
import math

x = input().split()
#y = input().split()
a= []

 #   a.append(int(x[i]))

if x[0][len(x[0])-1] == x[1][0] and x[1][len(x[1])-1] == x[2][0]:print("Yes")
else:print("No")

Fixed, accepted submission:
from statistics import mean, median,variance,stdev
import sys
import math

x = input().split()
#y = input().split()
a= []

 #   a.append(int(x[i]))

if x[0][len(x[0])-1] == x[1][0] and x[1][len(x[1])-1] == x[2][0]:print("YES")
else:print("NO")
Problem:
There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.  Determine if it is possible that there are exactly X cats among these A + B animals.

Incorrect submission (verdict: Wrong Answer):
A, B, X = map(int, input().split())
if A+B < X:
    print("NO")
elif A < X:
    print("NO")
else:
    print("YES")


Fixed, accepted submission:
A, B, X = map(int, input().split())
if A+B < X:
    print("NO")
elif A > X:
    print("NO")
else:
    print("YES")
Problem:
You are given an integer sequence of length n+1, a_1,a_2,...,a_{n+1}, which consists of the n integers 1,...,n. It is known that each of the n integers 1,...,n appears at least once in this sequence.  For each integer k=1,...,n+1, find the number of the different subsequences (not necessarily contiguous) of the given sequence with length k, modulo 10^9+7.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
M = 10**9+7
res = [-1] * (n+1)
for i in range(n+1):
    if res[a[i]] == -1:
        res[a[i]] = i
    else:
        d = a[i]
        l, r = res[d], n-i


def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7  
g1 = [1, 1]  
g2 = [1, 1]  
inverse = [0, 1]  計算用テーブル

for i in range(2, n + 2):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod//i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)


for i in range(1, n+2):
    print(cmb(n+1, i, mod)-cmb(l+r, i-1, mod))


Fixed, accepted submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
res = [-1] * (n+1)
for i in range(n+1):
    if res[a[i]] == -1:
        res[a[i]] = i
    else:
        d = a[i]
        l, r = res[d], n-i


def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range(2, n + 2):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod//i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)


for i in range(1, n+2):
    print((cmb(n+1, i, mod)-cmb(l+r, i-1, mod)) % mod)
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 = input()
S = S[::-1]
divide = ["dream", "dreamer", "erase", "eraser"]
for k in range(len(divide)):
  divide[k] = divide[k][::-1]
is_divide = False
for i in range(len(S)):
  for j in range(len(divide)):
    if S[i:len(divide[j])+1] == divide[j]:
      is_divide = True
      i += len(divide[j])

if is_divide:
  print("YES")
else:
  print("NO")

Fixed, accepted submission:
S = input()

while "eraser" in S:
  S = S.replace("eraser", "")
while "erase" in S:
  S = S.replace("erase", "")
while "dreamer" in S:
  S = S.replace("dreamer", "")
while "dream" in S:
  S = S.replace("dream", "")
  
if S == "":
  print("YES")
else:
  print("NO")
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())
#4569=n
t = 0
for i in range(1, n+1):
    ans = 0
    while i!=0:
        amari = i%10
        i = int(i/10)
        ans += amari
    if a <= ans <= b:
        t += 1
print('t=', t)


Fixed, accepted submission:
n, a, b = map(int,input().split())
ans = 0
for i in range(1,n+1):
    s = sum(map(int,list(str(i))))
    if a <= s and s <= b:
        ans += i
print(ans)
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())
if abs(x-a)<abs(x-b):
  print(a)
else:
  print(b)
  

Fixed, accepted submission:
x,a,b=map(int,input().split())
if abs(x-a)<abs(x-b):
  print("A")
else:
  print("B")
Problem:
Takahashi has a strong stomach. He never gets a stomachache from eating something whose "best-by" date is at most X days earlier. He gets a stomachache if the "best-by" date of the food is X+1 or more days earlier, though.  Other than that, he finds the food delicious if he eats it not later than the "best-by" date. Otherwise, he does not find it delicious.  Takahashi bought some food A days before the "best-by" date, and ate it B days after he bought it.  Write a program that outputs `delicious` if he found it delicious, `safe` if he did not found it delicious but did not get a stomachache either, and `dangerous` if he got a stomachache.

Incorrect submission (verdict: Wrong Answer):
x,a,b = map(int,input().split())
if a >= b:
  print("delicious")
elif b-a >= x:
  print("safe")
else:
  print("dangerous")

Fixed, accepted submission:
x,a,b = map(int,input().split())
if a >= b:
  print("delicious")
elif b-a <= x:
  print("safe")
else:
  print("dangerous")
Problem:
We ask you to select some number of positive integers, and calculate the sum of them.  It is allowed to select as many integers as you like, and as large integers as you wish. You have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer.  Your objective is to make the sum congruent to C modulo B. Determine whether this is possible.  If the objective is achievable, print `YES`. Otherwise, print `NO`.

Incorrect submission (verdict: Wrong Answer):
import math

a, b, c = map(int, input().split())

d = math.gcd(a, b)

print("Yes" if c % d == 0 else "No")


Fixed, accepted submission:
import math

a, b, c = map(int, input().split())

d = math.gcd(a, b)

print("YES" if c % d == 0 else "NO")
Problem:
Our world is one-dimensional, and ruled by two empires called Empire A and Empire B.  The capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.  One day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.  If there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.    * X < Z \leq Y   * x_1, x_2, ..., x_N < Z   * y_1, y_2, ..., y_M \geq Z  Determine if war will break out.

Incorrect submission (verdict: Wrong Answer):
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=True
for z in range(x+1,y+1):
  if all([l<z for l in a]) and all([l>=z for l in b]):
    pass
  else:
    c=False
if c==True:
  print("No War")
else:
  print("War")
    
  

Fixed, accepted submission:
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=False
for z in range(x+1,y+1):
  if all([l<z for l in a]) and all([l>=z for l in b]):
    c=True
    break
if c==True:
  print("No War")
else:
  print("War")
Problem:
Write a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.     

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

if W<(x+r):
    print(No)
elif H<(y+r):
    print(Yes)

Fixed, accepted submission:
W,H,x,y,r=map(int,input().split())

if W>=(x+r) and r<=x:
 if H>=(y+r) and r<=y:
  print('Yes')
 else:
  print('No')
else:
 print('No')
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())
a= [input() for i in range(n)]

ca=a.count('AC')
cw=a.count('WA')
ct=a.count('TLE')
cr=a.count('RE')
print('AC X',ca)
print('WA X',cw)
print('TEL X',ct)
print('RE X',cr)

Fixed, accepted submission:
n = int(input())
a= [input() for i in range(n)]

ca=a.count('AC')
cw=a.count('WA')
ct=a.count('TLE')
cr=a.count('RE')
print('AC x',ca)
print('WA x',cw)
print('TLE x',ct)
print('RE x',cr)
Problem:
You are given a string S of length 2 or 3 consisting of lowercase English letters. If the length of the string is 2, print it as is; if the length is 3, print the string after reversing it.

Incorrect submission (verdict: Wrong Answer):
s=input()
if len(s)==3:
  s=sorted(s)
print(s)

Fixed, accepted submission:
s=input()
if len(s)==3:
  s=s[2]+s[1]+s[0]
print(s)
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):
N,K=map(int,input().split())
D=list(map(int,input().split()))

while True:
  S=str(N)
  flag=True
  for x in S:
    if x in D:
      flag=False
  if flag==True:
    break;
  N+=1
print(N)

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

while True:
  S=str(N)
  flag=True
  for x in S:
    if int(x) in D:
      flag=False
  if flag==True:
    break;
  N+=1
print(N)
Problem:
Three poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right. We will call the arrangement of the poles _beautiful_ if the tops of the poles lie on the same line, that is, b-a = c-b.  Determine whether the arrangement of the poles is beautiful.

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

print('YNeos'[b-a!=c-b::2])

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

print('YNEOS'[b-a!=c-b::2])
Problem:
There are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?

Incorrect submission (verdict: Wrong Answer):
n = int(input())
print(((n)*(n+1))/2)

Fixed, accepted submission:
n = int(input())
print(((n)*(n+1))//2)
Problem:
You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer.

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

Fixed, accepted submission:
a, b = map(int, input().split())
x = -(-((a+b)/2)//1)
print(int(x))
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):
a,b = input().split()
n = int(a+b)
for i in range(n):
  b = i**2
  if i ==n:
    print('Yes')
    break
  elif i > n:
    print('No')
    break

Fixed, accepted submission:
a,b = input().split()
n = int(a+b)

for i in range(n):
  b = i**2
  if b ==n:
    print('Yes')
    break
  elif b > n:
    print('No')
    break