TnT/CodeNet4Repair huggingface dataset:
Problem:
素数というのは、1 よりも大きくそれ自身か 1 でしか割りきれない整数をいいます。例えば、2 は、2 と 1 でしか割り切れないので素数ですが、12 は、12 と 1 のほかに、2, 3, 4, 6 で割りきれる数なので素数ではありません。  整数 n を入力したとき、n より小さい素数のうち最も大きいものと、n より大きい素数のうち最も小さいものを出力するプログラムを作成してください。

Incorrect submission (verdict: Wrong Answer):
n = 50000
c = [1 for i in range(n)]
c[0] = 0
i = 2
while i**2 <= n:
    j = i*2
    while j <= n:
        c[j - 1] = 0
        j += i
    i += 1

while True:
    try:
        n = int(input())
        i, a, b = 0, 0, 0
        while a == 0 and b == 0:
            i += 1
            if n - i >= 0 and a == 0 and c[n - i] == 1:
                a = n - i
            if n + i < 50000 and b == 0 and c[n + i] == 1:
                b = n + i
        print(a,b)
    except:
        break



Fixed, accepted submission:
n = 50021
c = [1 for i in range(n)]
c[0] = 0
i = 2
while i**2 <= n:
    j = i*2
    while j <= n:
        c[j - 1] = 0
        j += i
    i += 1

while True:
    try:
        n = int(input())
        i, a, b = 0, 0, 0
        while a == 0 or b == 0:
            i += 1
            if n - i - 1 >= 0 and a == 0 and c[n - i - 1] == 1:
                a = n - i
            if n + i - 1 < 50021 and b == 0 and c[n + i - 1] == 1:
                b = n + i
        print(a,b)
    except:
        break
Problem:
凸 n 角形（すべての頂点の内角が 180 度未満である多角形、要するにへこんでいない多角形のこと）の頂点の座標を読んで、その面積を出力するプログラムを作成してください。頂点には辺のつながりの順序に従って頂点 1、頂点 2、頂点 3、‥‥頂点 n という名前がついています。  ただし、 n は 3 以上 20 以下とします。また、次の、三角形の 3 辺の長さ a, b, c から面積 S を求める公式を使ってもかまいません。  

Incorrect submission (verdict: Wrong Answer):
import math
f = []
while True:
    try:
        st = input().strip().split(',')
        print("st=",st)
        x,y = list(map(float,st ))
        f.append(x + y*1j)
    except EOFError:
        break

px = [p.real for p in f]
ox = (max(px) + min(px)) / 2.0

py = [p.imag for p in f]
oy = (max(py) + min(py)) / 2.0

fo = ox + oy * 1j

ss = 0.0
for i in range(len(f)):
    if i == len(f)-1:
        j = 0
    else:
        j = i + 1
    a = abs(f[i]-fo)
    b = abs(f[j]-fo)
    c = abs(f[j]-f[i])
    z = (a + b + c) / 2.0
    s = math.sqrt(z*(z-a)*(z-b)*(z-c))
    ss += s
print(ss)

Fixed, accepted submission:
def op(u,v):
    return (complex.conjugate(u)*v).imag

f = []
while True:
    try:
        st = input().strip().split(',')
        x,y = list(map(float,st ))
        f.append(x + y*1j)
    except EOFError:
        break

s = 0.0
fo = f[0]
for j in range(2,len(f)):
    i = j - 1
    s += op(f[i]-fo,f[j]-fo)/2.0
print("%.6f" % abs(s))
Problem:
AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd.

Incorrect submission (verdict: Wrong Answer):

num1,num2 = map(int,"3 4".split())

if ((num1 * num2) % 2) == 0:
    print("Odd")
else:
    print("Even")

Fixed, accepted submission:

num1,num2 = map(int,input().split())

if ((num1 * num2) % 2) == 0:
    print("Even")
else:
    print("Odd")
Problem:
Write a program which reads three integers, and prints them in ascending order.

Incorrect submission (verdict: Wrong Answer):
a,b,c=[int(x) for x in input().split()]
if a > b:
    if a > c:
        if b < c:
            print(b,c,a,sep=" ")
        else:
            print(c,b,a,sep=" ")
    elif b < c:
        print(a,b,c,sep=" ")
    else:
        print(a,c,b,sep=" ")


Fixed, accepted submission:
a,b,c=[int(x) for x in input().split()]
if a<=b<=c:
    print(a,b,c)
elif a<=c<=b:
    print(a,c,b)
elif b<=a<=c:
    print(b,a,c)
elif b<=c<=a:
    print(b,c,a)
elif c<=a<=b:
    print(c,a,b)
elif c<=b<=a:
    print(c,b,a)
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());

s = [input() for i in range(n)]

ac = wa = tle = re = 0

for s_kind in s:
    if s_kind == "AC":
        ac += 1
    elif s_kind == "WA":
        wa += 1
    elif s_kind == "TLE":
        tle += 1
    elif s_kind == "RE":
        re += 1
    
print(ac)
print(wa)
print(tle)
print(re)

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

s = [input() for i in range(n)]

ac = wa = tle = re = 0

for s_kind in s:
    if s_kind == "AC":
        ac += 1
    elif s_kind == "WA":
        wa += 1
    elif s_kind == "TLE":
        tle += 1
    elif s_kind == "RE":
        re += 1
    
print("AC x",ac)
print("WA x",wa)
print("TLE x",tle)
print("RE x",re)
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: Wrong Answer):
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)


memo = {}

def solve():
    N,A,B,C,D = map(int,input().split())
    return process(N,N,A,B,C,D)


def process(M,N,A,B,C,D):
    if M == 1:
        return D
    elif M == 0:
        return 0
    elif M < 0:
        return D * N
    global memo
    if M in memo:
        return memo[M]
    res = process((M-M%2)//2,N,A,B,C,D) + A + (M%2) * D
    res = min(res,process((M+M%2)//2,N,A,B,C,D) + A + (M%2) * D)
    res = min(res,process((M-M%3)//3,N,A,B,C,D) + B + (M%3) * D)
    res = min(res,process((M+3-M%3)//3,N,A,B,C,D) + B + (3-M%3) * D)
    res = min(res,process((M-M%5)//5,N,A,B,C,D) + C + (M%5) * D)
    res = min(res,process((M+5-M%5)//5,N,A,B,C,D) + C + (5-M%5) * D)
    memo[M] = res
    return res


def main():
    T = int(input())

    for i in range(T):
        global memo
        memo = {}
        res = solve()
        print(res)



main()


Fixed, accepted submission:
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)


memo = {}

def solve():
    N,A,B,C,D = map(int,input().split())
    global memo
    memo = {0:0,1:D}
    return process(N,N,A,B,C,D)


def process(M,N,A,B,C,D):
    # if M < 0:
    #     return D * N + 1
    global memo
    if M in memo:
        return memo[M]
    res = process((M-M%2)//2,N,A,B,C,D) + A + (M%2) * D
    res = min(res,process((M+M%2)//2,N,A,B,C,D) + A + (M%2) * D)
    res = min(res,process((M-M%3)//3,N,A,B,C,D) + B + (M%3) * D)
    res = min(res,process((M+3-M%3)//3,N,A,B,C,D) + B + (3-M%3) * D)
    res = min(res,process((M-M%5)//5,N,A,B,C,D) + C + (M%5) * D)
    res = min(res,process((M+5-M%5)//5,N,A,B,C,D) + C + (5-M%5) * D)
    res = min(res,M*D)
    memo[M] = res
    return res


def main():
    T = int(input())

    for i in range(T):
        res = solve()
        print(res)



main()
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())
ans = 1
for i in range(1,n+1):
    ans = (ans*i)%1000000007
print(ans)

Fixed, accepted submission:
N = int(input())
div, mod = divmod(N, 15)
x = N * 800
y = div * 200

print(x - y)
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):
n=int(input())
a=[int(input())for _ in range(n)]
a.sort()
b=a[:0--n//2]
c=a[0--n//2:]
a=[]
for i in range(n//2):a+=[b[i],c[i]]
if n%2:a+=[b[-1]]
x=0
for i in range(n-1):x+=abs(a[i+1]-a[i])
print(x)

Fixed, accepted submission:
n=int(input())
a=[int(input())for _ in range(n)]
if n==2:print(abs(a[0]-a[1]));exit()
f=[-1]
for i in range(1,n-1-(n%2==0)):
  if i%2:f.append(2)
  else:f.append(-2)
if n%2:f+=[-1]
else:f+=[-2,1]
b=[]
c=[]
for i in f:
  b.append(i)
  c.append(-i)
b.sort()
c.sort()
sb=sc=0
a.sort()
for i in range(n):
  sb+=a[i]*b[i]
  sc+=a[i]*c[i]
print(max(sb,sc))