Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03440 (python)

Fixed submission:
from heapq import *

class UnionFind:
    def __init__(self, n):
        '木の初期化をする'
        self.p = [-1] * n
        self.rank = [1]*n
    def find(self, x):
        'x の親を返す'
        if self.p[x] == -1:
            return x
        else:
            self.p[x] = self.find(self.p[x])
            return self.p[x]

    def unite(self, x, y):
        'rankの低い親を高い方のの親にする'
        if not self.same(x,y):
            x = self.find(x)
            y = self.find(y)
            if self.rank[x] > self.rank[y]:
                x,y = y,x
            elif self.rank[x] == self.rank[y]:
                self.rank[y] += 1
            self.p[x] = y
            return True
        else:
            return False

    def same(self, x, y):
        return self.find(x) == self.find(y)

n,m = map(int,input().split())
a = list(map(int,input().split()))
uf = UnionFind(n)
ans = 0
for i in range(m):
    x,y = map(int,input().split())
    uf.unite(x, y)
if n < 2*(n-m-1):
    print('Impossible')
    exit(0)
if m == n-1:
    print(0)
    exit(0)
tree = {}
pq = []
heapify(pq)
for i in range(n):
    p = uf.find(i)
    if not p in tree.keys():
        ans += a[i]
        tree[p] = a[i]
    else:
        if tree[p] <= a[i]:
            heappush(pq, a[i])
        else:
            ans += a[i] - tree[p]
            heappush(pq, tree[p])
            tree[p] = a[i]
l = len(tree)

for _ in range(2*(n-m-1) - l):
    ans += heappop(pq)
print(ans)

Buggy submission (verdict: Runtime Error):
from heapq import *

class UnionFind:
    def __init__(self, n):
        '木の初期化をする'
        self.p = [-1] * n
        self.rank = [1]*n
    def find(self, x):
        'x の親を返す'
        if self.p[x] == -1:
            return x
        else:
            self.p[x] = self.find(self.p[x])
            return self.p[x]

    def unite(self, x, y):
        'rankの低い親を高い方のの親にする'
        if not self.same(x,y):
            x = self.find(x)
            y = self.find(y)
            if self.rank[x] > self.rank[y]:
                x,y = y,x
            elif self.rank[x] == self.rank[y]:
                self.rank[y] += 1
            self.p[x] = y
            return True
        else:
            return False

    def same(self, x, y):
        return self.find(x) == self.find(y)

n,m = map(int,input().split())
a = list(map(int,input().split()))
uf = UnionFind(n)
ans = 0
for i in range(m):
    x,y = map(int,input().split())
    uf.unite(x, y)
if n < 2*(n-m-1):
    print('Impossible')
    exit(0)
if m == n-1:
    print(0)
    exit(0)
tree = {}
pq = []
heapify(pq)
for i in range(n):
    p = uf.find(i)
    if not p in tree.keys():
        ans += a[i]
        tree[p] = a[i]
    else:
        if tree[p] <= a[i]:
            heappush(pq, a[i])
        else:
            ans += a[i] - tree[p]
            tree[p] = a[i]
            heappush(pq, tree[p])
l = len(tree)

for _ in range(2*(n-m-1) - l):
    ans += heappush(pq)
print(ans)
Problem p03456 (python)

Fixed submission:
ab = int(''.join(input().split()))
if (ab**0.5).is_integer():
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
ab = int(''.join(input().split()))
if ab**0.5.is_intejer():
  print('Yes')
else:
  print('No')
Problem p03573 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a == b:
  print(c)
elif b == c:
  print(a)
else:
  print(b)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input())
if a == b:
  print(c)
elif b == c:
  print(a)
else:
  print(b)
Problem p03575 (python)

Fixed submission:
from collections import deque
n,m = map(int,input().split())
path = [[] for _ in range(n)]
ab = [[] for _ in range(m)]
for i in range(m):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  ab[i] = (a,b)
  path[a].append(b)
  path[b].append(a)
def dfs(a,b):
  que = deque()
  reach = [False]*n
  reach[0] = True
  que.append(0)
  while que:
    p = que.pop()
    for i in path[p]:
      if (p,i)!=(a,b)!=(i,p) and not reach[i]:
        que.append(i)
        reach[i] = True
  return reach != [True] * n
ans = 0
for a,b in ab:
  ans += dfs(a,b)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
n,m = map(int,input().split())
path = [[] for _ in range(n)]
ab = [[] for _ in range(m)]
for i in ragne(m):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  ab[i] = (a,b)
  path[a].append(b)
  path[b].append(a)
def dfs(a,b):
  que = deque()
  reach = [False]*n
  reach[0] = True
  que.append(0)
  while que:
    p = que.pop()
    for i in path[p]:
      if (p,i)!=(a,b)!=(i,p) and not reach[i]:
        p.append(i)
        reach[i] = True
  return reach != [True] * n
ans = 0
for a,b in ab:
  ans += dfs(a,b)
print(ans)
Problem p03660 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline

n = int(input())
path = [[] for _ in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    path[a].append(b)
    path[b].append(a)
parent = [-1]*n
size = [1]*n
d = [0]*n
def dfs(now):
    for nxt in path[now]:
        if nxt != parent[now]:
            parent[nxt] = now
            d[nxt] = d[now] + 1
            size[now] += dfs(nxt)
    return size[now]
dfs(0)
cnt = 0
now = n-1
for i in range((d[n-1]+1)//2 - 1):
    now = parent[now]
if size[now] >= n - size[now]:
    print('Snuke')
else:
    print('Fennec')

Buggy submission (verdict: Runtime Error):
n = int(input())
path = [[] for _ in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    path[a].append(b)
    path[b].append(a)
parent = [-1]*n
size = [1]*n
d = [0]*n
def dfs(now):
    for nxt in path[now]:
        if nxt != parent[now]:
            parent[nxt] = now
            d[nxt] = d[now] + 1
            size[now] += dfs(nxt)
    return size[now]
dfs(0)
cnt = 0
now = n-1
for i in range((d[n-1]+1)//2 - 1):
    now = parent[now]
if size[now] >= n - size[now]:
    print('Snuke')
else:
    print('Fennec')
Problem p03703 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline

class BIT:
    def __init__(self,n,default = 0):
        self.s = [default]*(n+1)
        self.n = n
    
    def add(self,val,idx):
        while idx < self.n+1:
            self.s[idx] = self.s[idx] + val
            idx += idx&(-idx)
        return
    
    def get(self,idx):
        res = 0
        while idx > 0:
            res = res + self.s[idx]
            idx -= idx&(-idx)
        return res


n,k = map(int,input().split())
ans = 0
s = [0]*(n+1)
array = {0}
for i in range(n):
    s[i+1] = s[i] + int(input()) - k
    array.add(s[i+1])
array = sorted(array)
d = {x:i for i,x in enumerate(array)}
bit = BIT(len(array))
for t in s:
    ans += bit.get(d[t]+1)
    bit.add(1,d[t]+1)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline

class BIT:
    def __init__(self,n,default = 0):
        self.s = [default]*(n+1)
    
    def add(self,val,idx):
        while idx < n+1:
            self.s[idx] = self.s[idx] + val
            idx += idx&(-idx)
        return
    
    def get(self,idx):
        res = 0
        while idx > 0:
            res = res + self.s[idx]
            idx -= idx&(-idx)
        return res


n,k = map(int,input().split())
ans = 0
s = [0]*(n+1)
array = {0}
for i in range(n):
    s[i+1] = s[i] + int(input()) - k
    array.add(s[i+1])
array = sorted(array)
d = {x:i for i,x in enumerate(array)}
bit = BIT(len(array))
for t in s:
    ans += bit.get(d[t]+1)
    bit.add(1,d[t]+1)
print(ans)
Problem p03722 (python)

Fixed submission:
class BellmanFord:
    def __init__(self,v,start):
        self.inf = float('inf')
        self.dist = [self.inf]*v
        self.dist[start] = 0
        self.edge = []
        self.v = v
    
    def add(self,f,t,cost):
        self.edge.append((f,t,cost))
    
    def build(self):
        for _ in range(self.v - 1):
            for f,t,cost in self.edge:
                if self.dist[t] > self.dist[f] + cost:
                    self.dist[t] = self.dist[f] + cost
        self.ans = self.dist[n-1]
        for f,t,cost in self.edge:
            if self.dist[t] > self.dist[f] + cost:
                self.dist[t] = self.dist[f] + cost
        return self.ans == self.dist[n-1]

n,m = map(int,input().split())

bf = BellmanFord(n,0)

for i in range(m):
    a,b,c = map(int,input().split())
    bf.add(a - 1,b - 1,- c)

if bf.build():
    print(- bf.ans)
else:
    print('inf')

Buggy submission (verdict: Runtime Error):
class BellmanFord:
    def __init__(self,v,start):
        self.inf = float('inf')
        self.dist = [self.inf]*v
        self.dist[start] = 0
        self.edge = []
        self.v = v
    
    def add(self,f,t,cost):
        self.edge.append((f,t,cost))
    
    def build(self,gorl):
        for _ in range(self.v - 1):
            for f,t,cost in self.edge:
                if self.dist[t] > self.dist[f] + cost:
                    self.dist[t] = self.dist[f] + cost
        self.ans = self.dist[gorl]
        for f,t,cost in self.edge:
            if self.dist[t] > self.dist[f] + cost:
                self.dist[t] = self.dist[f] + cost
        return self.ans if self.ans == self.dist[gorl] else '-inf'

n,m = map(int,input().split())

bf = BellmanFord(n,0)

for i in range(m):
    a,b,c = map(int,input().split())
    bf.add(a - 1,b - 1,- c)

ans = bf.build()
if ans == '-inf':
    print('inf')
else:
    print(- ans)
Problem p03759 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a+c == b+b:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a+c = b+b:
  print('YES')
else:
  print('NO')
Problem p03777 (python)

Fixed submission:
a,b = input().split()
if (a == 'H') ^ (b == 'H'):
  print('D')
else:
  print('H')

Buggy submission (verdict: Runtime Error):
a,b = input().split()
if a == 'H' ^ b == 'H':
  print('H')
else:
  print('D')
Problem p03909 (python)

Fixed submission:
h,w = map(int,input().split())
for i in range(h):
  s = input().split()
  if 'snuke' in s:
    ans = ord('A') + s.index('snuke')
    print(chr(ans) + str(i+1))

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
for i in range(h):
  s = input().split()
  if 'snuke' in s:
    ans = ord('A') + s.index('snuke')
    print(ans + str(i+1))
    break
Problem p03912 (python)

Fixed submission:
n,m = map(int,input().split())
X = list(map(int,input().split()))
mod = [[0,0] for _ in range(m)]
d = {}
for x in X:
    if x not in d.keys():d[x] = 0
    d[x] += 1
for k,v in d.items():
    mod[k%m][0] += v//2
    mod[k%m][1] += v%2
ans = 0
for i in range(m//2+1):
    if i == 0 or i == m-i:
        ans += mod[i][1]//2 + mod[i][0]
    else:
        if mod[i][1] < mod[m-i][1]:
            ans += min(mod[m-i][1], mod[i][0]*2 + mod[i][1])
            ans += mod[m-i][0]
            ans += max(0,(mod[i][0]*2 + mod[i][1] - mod[m-i][1]))//2
        elif mod[i][1] == mod[m-i][1]:
            ans += mod[i][0] + mod[m-i][0] + mod[i][1]
        else:
            ans += min(mod[i][1], mod[m-i][0]*2 + mod[m-i][1])
            ans += mod[i][0]
            ans += max(0,(mod[m-i][0]*2 + mod[m-i][1] - mod[i][1]))//2
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
X = list(map(int,input().split()))
mod = [[0,0] for _ in range(n)]
d = {}
for x in X:
    if x not in d.keys():d[x] = 0
    d[x] += 1
for k,v in d.items():
    mod[k%m][0] += v//2
    mod[k%m][1] += v%2
ans = 0
for i in range(m//2+1):
    if i == 0 or i == m-i:
        ans += mod[i][1]//2 + mod[i][0]
    else:
        if mod[i][1] < mod[m-i][1]:
            ans += min(mod[m-i][1], mod[i][0]*2 + mod[i][1])
            ans += mod[m-i][0]
            ans += max(0,(mod[i][0]*2 + mod[i][1] - mod[m-i][1]))//2
        elif mod[i][1] == mod[m-i][1]:
            ans += mod[i][0] + mod[m-i][0] + mod[i][1]
        else:
            ans += min(mod[i][1], mod[m-i][0]*2 + mod[m-i][1])
            ans += mod[i][0]
            ans += max(0,(mod[m-i][0]*2 + mod[m-i][1] - mod[i][1]))//2
print(ans)
Problem p03952 (python)

Fixed submission:
n,x = map(int,input().split())

if n == 2:
    if x == 2:
        print('Yes')
        print('\n'.join(['1','2','3']))
    else:
        print('No')
else:
    if x == 1 or x == 2*n - 1:
        print('No')
    else:
        print('Yes')
        if x == 2:
            ans = list(range(3,2*n-2))
            ans = ans[:n-3] + [2*n - 1,1,2,2*n - 2] + ans[n-3:]
        else:
            ans = list(range(2*n - 1))
            ans = ans[3:x] + ans[x+1:2*n - 1]
            ans = ans[:n-3] + [1,2*n - 1,x,2] + ans[n-3:]
        print('\n'.join(str(i) for i in ans))

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())

if n == 2:
    if x == 2:
        print('Yes')
        print('\n'.join([1,2,3]))
    else:
        print('No')
else:
    if x == 1 or x == 2*n - 1:
        print('No')
    else:
        print('Yes')
        if x == 2:
            ans = list(range(3,2*n-2))
            ans = ans[:n-3] + [2*n - 1,1,2,2*n - 2] + ans[n-3:]
        else:
            ans = list(range(2*n - 1))
            ans = ans[3:x] + ans[x+1:2*n - 1]
            ans = ans[:n-3] + [1,2*n - 1,x,2] + ans[n-3:]
        print('\n'.join(str(i) for i in ans))
Problem p04035 (python)

Fixed submission:
n,l = map(int,input().split())
a = list(map(int,input().split()))
x = -1
for i in range(n-1):
  if a[i]+a[i+1] >= l:
    x = i
    break
if x == -1:
  print('Impossible')
else:
  print('Possible')
  for i in range(x):
    print(i+1)
  for i in range(n-2,x,-1):
    print(i+1)
  print(x+1)

Buggy submission (verdict: Runtime Error):
n,l = map(int,input().split())
A = list(map(int,input().split()))
x = -1
for i in range(n-1):
  if a[i]+a[i+1] >= l:
    x = i
    break
if x == -1:
  print('Impossible')
else:
  print('Possible')
  for i in range(x-1):
    print(i+1)
  for i in range(n-1,x,-1):
    print(i)
  print(x)
Problem p04045 (python)

Fixed submission:
n,k = map(int,input().split())
d = list(input().split())
ans = n
while True:
    flag = False
    for i in d:
        if flag :break
        if i in str(ans):
            ans += 1
            flag = True
    if flag:continue
    break
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = list(input().split())
ans = n
while True:
    flag = False
    for i in d:
        if flag :break
        if i in str(ans):
            x = len(str(n)) - str(n).index(i) - 1
            ans += 10**x
            flag = True
    if flag:continue
    print(ans)
    break

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = list(input().split())
ans = n
while True:
    flag = False
    for i in d:
        if flag :break
        if i in str(ans):
            x = len(str(n)) - str(n).index(i) - 1
            ans += 10**x
            flag = True
    if flag:continue
    print(ans)
    exit(0)
Problem p02609 (python)

Fixed submission:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
###############################################################################\
def power(a,p,m):
    if m==0:
        return 0
    res=1
    while(p>0):
        if p&1:
            res=(res*a)%m
        a=(a*a)%m
        p//=2
    return res%m
n=int(input())
s=input()
A=list(int(i) for i in s)
R=[]
for i in range(n-1,-1,-1):
    R.append(A[i])
one=0
for e in A:
    if e==1:
        one+=1
max=one+1
min=one-1
ansmax=0
ansmin=0
#print(one)
for i in range(n):
    ansmax=(ansmax+power(2,i,max)*(R[i]))%max
    if min!=0:
        ansmin=(ansmin+power(2,i,min)*R[i])%min
def popcount(z):
    ans=0
    while(z!=0):
        if z%2==1:
            ans+=1
        z//=2
    return ans
#print(ansmax,ansmin)
B=[]
for i in range(n):
    if R[i]==1:
        if min!=0:
            r=(ansmin-power(2,i,min))%min
            count=1
            while(r!=0):
                count+=1
                r=r%popcount(r)
        else:
            count=0
        B.append(count)
    else:
        r=(ansmax+power(2,i,max))%max
        count=1
        while(r!=0):
            count+=1
            r=r%popcount(r)
        B.append(count)
B.reverse()
for ele in B:
    print(ele)

Buggy submission (verdict: Runtime Error):
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
###############################################################################\
def power(a,p,m):
    res=1
    while(p>0):
        if p&1:
            res=(res*a)%m
        a=(a*a)%m
        p//=2
    return res%m
n=int(input())
s=input()
A=list(int(i) for i in s)
R=[]
for i in range(n-1,-1,-1):
    R.append(A[i])
one=0
for e in A:
    if e==1:
        one+=1
max=one+1
min=one-1
ansmax=0
ansmin=0
#print(one)
for i in range(n):
    ansmax=(ansmax+power(2,i,max)*(R[i]))%max
    ansmin=(ansmin+power(2,i,min)*R[i])%min
def popcount(z):
    ans=0
    while(z!=0):
        if z%2==1:
            ans+=1
        z//=2
    return ans
#print(ansmax,ansmin)
B=[]
for i in range(n):
    if R[i]==1:
        r=(ansmin-power(2,i,min))%min
        count=1
        while(r!=0):
            count+=1
            r=r%popcount(r)
        B.append(count)
        #print(count)
    else:
        r=(ansmax+power(2,i,max))%max
        count=1
        while(r!=0):
            count+=1
            r=r%popcount(r)
        B.append(count)
B.reverse()
for ele in B:
    print(ele)
Problem p02700 (python)

Fixed submission:
INT_MAX=10**11+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#=======================================================================
h1,s1,h2,s2=INPUT()
while(h1>0 and h2>0):
    h2-=s1
    if h2<=0:
        print("Yes")
        break
    h1-=s2
    if h1<=0:
        print("No")
        break

Buggy submission (verdict: Runtime Error):
INT_MAX=10**11+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#=======================================================================
h1,s1,h2,s2=INPUT()
while(h1>0 and h2>0):
    h2-=s1
    if h2<=0:
        print("Yes")
        break
    h1-=s2
    if h1<=0:
        print("No")
        break
Problem p02702 (python)

Fixed submission:
INT_MAX=10**11+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#=======================================================================
s=input()
digits=list(int(i) for i in s)
n=len(s)
powermod=[0]*2019
powermod[0]=1
pow10=1
num=0
ans=0
for digit in reversed(digits):
    num+=digit*pow10
    rem=num%2019
    ans+=powermod[rem]
    pow10*=10
    powermod[rem]+=1
    num=rem
    pow10%=2019
print(ans)

Buggy submission (verdict: Runtime Error):
INT_MAX=10**11+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
#=======================================================================
# Python 3 implementation of the approach

# Function to return the count of sub-strings
# of str that are divisible by k
def countSubStr(str, l, k):
	count = 0

	for i in range(l):
		n = 0

		# Take all sub-strings starting from i
		for j in range(i, l, 1):
			n = n * 10 + (ord(str[j]) - ord('0'))

			# If current sub-string is divisible by k
			if (n % k == 0):
				count += 1
            n=n%2019



	# Return the required count

	return count

# Driver code
if __name__ == '__main__':
	str = input()
	l = len(str)
	k = 2019
	print(countSubStr(str, l, k))

# This code is contributed by
# Sanjit_Prasad
Problem p02885 (python)

Fixed submission:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
import math
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math as M
MOD=10**9+7
import sys
#####################################
a,b=INPUT()
if a>=2*b:
    print(a-2*b)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
import math
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math as M
MOD=10**9+7
import sys
#####################################
a,b=INPUT()
if a>=2*b:
    print(a-2b)
else:
    print(0)
Problem p03125 (python)

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

if (B % A == 0):
    print(A+B)
else:
    print(B-A)

Buggy submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main() {
    int A, B;
    cin >> A >> B;
    if (B % A == 0) cout << (A+B) << endl;
    else cout << (B-A) << endl;
}

Buggy submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main() {
    int A, B;
    cin >> A >> B;
    if (B % A == 0) cout << A+B << endl;
    else cout << B-A << endl;
}
Problem p03399 (python)

Fixed submission:
def main():
    A, B, C, D = [int(input()) for _ in range(4)]
    print(min(A, B) + min(C, D))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    A, B, C, D = map(int, input().split())
    print(min(A, B) + min(C, D))


if __name__ == "__main__":
    main()
Problem p03597 (python)

Fixed submission:
n,a=[int(input()) for _ in range(2)];print(n**2-a)

Buggy submission (verdict: Runtime Error):
n,a=map(int, input().split());print(n**2-a)
Problem p03609 (python)

Fixed submission:
x,t=map(int,input().split());print(max(x-t,0))

Buggy submission (verdict: Runtime Error):
print(int(input())-int(input()))
Problem p03694 (python)

Fixed submission:
N = int(input())
a = map(int, input().split())
a = sorted(a)
print(a[-1]-a[0])

Buggy submission (verdict: Runtime Error):
N = int(input())
a = sorted([int(input()) for _ in range(N)])
print(a[-1]-a[0N = int(input())
a = map(int, input().split())
a = sorted(a)
print(a[-1]-a[0])

Buggy submission (verdict: Runtime Error):
N = int(input())
a = sorted([int(input()) for _ in range(N)])
print(a[-1]-a[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted([int(input()) for _ in range(N)])
print(a[-1]-a[0])
Problem p03738 (python)

Fixed submission:
a, b = [int(input()) for _ in range(2)]
if a > b:
    print('GREATER')
elif a == b:
    print('EQUAL')
else:
    print('LESS')

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if a > b:
  print('GREATER')
elif a == b:
  print('EQUAL')
else:
  print('LESS')
Problem p03844 (python)

Fixed submission:
print(eval(input()))

Buggy submission (verdict: Runtime Error):
print(eval(input))
Problem p04011 (python)

Fixed submission:
n, k, x, y = [int(input()) for _ in range(4)]
if k < n:
    ans = k * x + (n-k) * y
else:
    ans = n * x
print(ans)

Buggy submission (verdict: Runtime Error):
n, k, x, y = [int(input()) for _ in range(4)]
ans = k * x + max(n-k, 0) * y
print(ans)
n, k, x, y = [int(input()) for _ in range(4)]
if k < n:
    ans = k * x + (n-k) * y
else:
    ans = n * x
print(ans)