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

Fixed submission:
x,y = map(int,input().split())
 
if x%y == 0:
  print(-1)
else:
  print(x)

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

def lcm(x,y):
    return (x * y)//math.gcd(x, y)

def thingo(x,y):
    if (x == 0 and y == 0):
        return -1
    if (x != 0 and y == 0):
        return x
    test = lcm(x,y)
    if (test-x >= x):
        return test-x
    else:
        return -1
print(thingo(x,y))

Buggy submission (verdict: Runtime Error):
import math

input = str(input()).split(" ")
for index in range(len(input)):
    input[index] = int(input[index])
x = input[0]
y = input[1]

def lcm(x,y):
    return (x * y)//math.gcd(x, y)

def thingo(x,y):
    test = lcm(x,y)
    if (test-x >= x):
        return test-x
    else:
        return -1
print(thingo(x,y))

Buggy submission (verdict: Runtime Error):
import math

input = str(input()).split(" ")
for index in range(len(input)):
    input[index] = int(input[index])
x = input[0]
y = input[1]

def canBeDone(x,y):
    thingo = True
    while thingo:
        div = math.gcd(x,y)
        x = int(x/div)
        y = int(y/div)
        if (div == 1):
            thingo = False
    if (x == 1 and y == 1):
        return -1
    else:
        return 1

def test(x, y):
    if (canBeDone(x,y) == -1):
        return -1
    for index in range(1, abs(y)):
        if (x * index % y != 0 and abs(x * index) <= 10**(18)):
            return x * index
    return -1
print(test(x,y))
Problem p03447 (python)

Fixed submission:
x = int(raw_input())
a = int(raw_input())
b = int(raw_input())

x -= a
print x % b

Buggy submission (verdict: Runtime Error):
x=int(input())
a=int(input())
b=int(input())
//CODE Program
u=x-a
v=u//b
w=v*b
left=u-w
print(left)
Problem p03448 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
y = int(input())
 
ans = 0
 
for ai in range(a+1):
    for bi in range(b+1):
        for ci in range(c+1):
            amount = 500 * ai + 100 * bi + 50 * ci
            if amount == y:
                ans += 1
 
print(ans)

Buggy submission (verdict: Runtime Error):
You went shopping to buy cakes and donuts with 
X
 yen (the currency of Japan).

First, you bought one cake for 
A
 yen at a cake shop. Then, you bought as many donuts as possible for 
B
 yen each, at a donut shop.

How much do you have left after shopping?

Constraints
1
≤
A
,
B
≤
1
 
000
A
+
B
≤
X
≤
10
 
000
X
, 
A
 and 
B
 are integers.

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
ans = 0
 
for ai in range(a+1):
    for bi in range(b+1):
        for ci in range(c+1):
            amount = 500 * ai + 100 * bi + 50 * ci
            if amount == x:
                ans += 1
 // Input
print(ans)
Problem p03456 (python)

Fixed submission:
# Q.B
import math
a,b = map(int,input().split(" "))
num = int(str(a)+str(b))
sq = math.sqrt(num)
isq = int(sq)
if isq*isq==num:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s=input()
p=input()
q=s+p
q=int(q)
l=q**(1/2.0)
m=int(l)
if(l==m):
    print("YES")
else:
    print("NO")
Problem p03487 (python)

Fixed submission:
n = int(input())
seq = [int(x) for x in input().split()]

if len(seq) == 1:
  if seq[0] == 1:
    print("0")
  else:
    print("1")
else:
  total = 0
  counts = {}
  for x in seq:
    if x not in counts:
      counts[x] = 1
    else:
      counts[x] += 1

  for key,val in counts.items():
    if val < key:
      total += val
    else:
      total += abs(key-val)
  print(total)

Buggy submission (verdict: Runtime Error):
from collections import Counter
a = int(input())
l = []
for i in range(0,a):
    b = int(input())
    l.append(b)
c=Counter(l)
d = dict(c)
print(d)
kv = []
for k,v in d.items():
    if k>v:
        t = v
        kv.append(t)
    elif k<v:
        t = v-k
        kv.append(t)
s = sum(kv)
print(s)
Problem p03494 (python)

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

flag=1
c=0
while flag==1:
  for i in range(0,n):
    if a[i]%2!=0:
      flag=0
      break
  if flag==1:
    c+=1
    for j in range(0,n):
      a[j]//=2
print(c)

Buggy submission (verdict: Runtime Error):
import sys

n=int(input())
l=[int(n) for n in input().split()]
sum=0
for i in l:
    if i%2!=0:
        oc=0
    sum+=i
if(oc==0):
    print(0)
else:
    c=0
    while(sum%2==0 and sum>=2):
        c+=1
        sum=sum//2
    print(c)
Problem p03548 (python)

Fixed submission:

x=list(map(int,input().split()))

nu=(x[0]-x[2]) % (x[1]+x[2])
res=(x[0]-x[2]-nu) / (x[1]+x[2])
print(int(res))

Buggy submission (verdict: Runtime Error):
x=int(input(""))
y=int(input(""))
z=int(input(""))
answer= (x-z)//(z+y)
print(answer)

Buggy submission (verdict: Runtime Error):
x=int(input())
y=int(input())
z=int(input())

print(x//(z+y))
Problem p03555 (python)

Fixed submission:
a=input()
b=input()
if(a[2]==b[0] and a[1]==b[1] and a[0]==b[2]):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a=list (map(input()) )
 if(a[0]==a[5] &&a[1]==a[4]&&a[2]==a[3]):
        print("Yes" )
else:
       print("No")
Problem p03556 (python)

Fixed submission:
n = int(input())
i = 1
while i * i <= n:
    i += 1
print((i - 1) * (i - 1))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())


for i in the range(n+1):
    ans= math.sqrt(i)
    ans= str(ans)
    if "." not in ans:
        print(ans)
        break
Problem p03625 (python)

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
a.sort()
lar=sec=i=0
while(i<n-1):
    if a[i]==a[i+1]:
        i+=1
        if a[i]>lar:
            sec=lar
            lar=a[i]
        elif a[i]>sec:
             sec=a[i]
    i+=1
print(lar*sec)

Buggy submission (verdict: Runtime Error):
n=input()
l=[int(x) for x in input().split()]
temp=list(set(x for x in l if l.count(x)>1))
y=max(temp)
if l.count(y)>3:
	lar=sec=y
else:
	lar=y
	temp.remove(y)
	sec=max(temp)
print(lar*sec)

Buggy submission (verdict: Runtime Error):
n=int(input())
ls=[]
temp=[]
temp= list((for x in input().split()))
temp=list(set([x for x in l if l.count(x)>1]))
for x in l:
	if (l.count(x)>3):
		ls.append(x)
temp+=list(set(ls))
if len(temp)<2:
	print(0)
else:
	x=max(temp)
	temp.remove(x)
	print(x*max(temp))

Buggy submission (verdict: Runtime Error):
lst = []
N = int(input("Enter number of elements : "))
for i in range(0,N):
    lst.append(int(input()))
temp = [x for x in lst if lst.count(x)>1]
list_set = set(temp)
dups = (list(list_set))
if (len(dups)<2):
   print('0')
   print('No rectangle can be formed')
else:
    a = dups[0]; b = dups[1]
    n=len(dups)    
    for i in range(0, n):
      for j in range(i + 1, n):
        if (dups[i]*dups[j]>a*b):
             a = dups[i]
             b = dups[j]
    print(a*b)
    print(a,' times ',b,' rectangle can be formed')

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

arrr = [0]*(max(arr)+2)

for i in arr:
    arrr[i]+=1

s1=0
s2=0

#print(arrr)

for j in range(max(arr),0,-1):
    #print(j)
    if arrr[j]>=2:
        arrr[j]-=2
        s1=j
        break

for j in range(max(arr),0,-1):
    if arrr[j]>=2:
        arrr[j]-=2
        s2=j
        break

print(s1*s2)

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

arrr = [0]*(max(arr)+2)

for i in arr:
    arrr[i]+=1

s1=0
s2=0

for j in range(max(arrr),0,-1):
    if arrr[j]>=2:
        arrr[j]-=2
        s1=j

for j in range(max(arrr),0,-1):
    if arrr[j]>=2:
        arrr[j]-=2
        s2=j

if s1==0 or s2==0:
    print(0)
else:
    print(s1*s2)
Problem p03644 (python)

Fixed submission:
a = int(input())
i = 1
while(i<=a):
	i *= 2
print(int(i/2))

Buggy submission (verdict: Runtime Error):
a = input()
i = 1
while (i<=a):
	i =i * 2
print(i/2)

Buggy submission (verdict: Runtime Error):
a = input()
i = 1
while i <= a :  
    i *= 2
print(i/2)
Problem p03647 (python)

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

is1 = [False] * (n + 1)
isN = [False] * (n + 1)

for i in range(m):
    a, b = map(int, input().split())
    if(a > b):
        a, b = b, a
    if(a == 1):
        is1[b] = True
    if(b == n):
        isN[a] = True

import sys

for i in range(2, n):
    if(is1[i] and isN[i]):
        print("POSSIBLE")
        sys.exit(0)

print("IMPOSSIBLE")

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


connections = dict()
answer = {
    'true': 'POSSIBLE',
    'false': 'IMPOSSIBLE'
}


def add_to_set(a, b):
    if a in connections:
        connections[a].add(b)
    else:
        connections[a] = set([b])

    if b in connections:
        connections[b].add(a)
    else:
        connections[b] = set([a])


for i in range(m):
    a, b = list(map(int, input().split()))
    add_to_set(a, b)

island_1 = connections.get(1)
island_N = connections.get(n)

for e in island_1:
    if e in island_N:
        print(answer['true'])
    else:
        print(answer['false'])

Buggy submission (verdict: Runtime Error):
n, m = input().split()

m = int(m)


connections = {}
answer = {
    'true': 'POSSIBLE',
    'false': 'IMPOSSIBLE'
}


def add_to_set(a, b):
    if a in connections:
        connections[a].add(b)
    else:
        connections[a] = {b}

    if b in connections:
        connections[b].add(a)
    else:
        connections[b] = {a}


for i in range(m):
    a, b = input().split()
    add_to_set(a, b)


for e in connections['1']:
    if e in connections[n]:
        print(answer['true'])
    else:
        print(answer['false'])

Buggy submission (verdict: Runtime Error):
n,m=map(int, input().split())
main_list=list()
list2=list()
for i in range(m):
    a,b=map(int, input().split())
    list2.append(a)
    list2.append(b)
    main_list.append(list2)
    list2=[]
for i in range(m):
    if main_list[i][0]==1:
        for j in range(m):
            if (main_list[i][1]==main_list[j][0])and(main_list[j][1]==n):
                k=0
                print("POSSIBLE")
                break
if k!=0:
    print("IMPOSSIBLE")
Problem p03759 (python)

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

Buggy submission (verdict: Runtime Error):
import math
h,w = map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  nos = math.ceil(w/2)*math.ceil(h/2) + math.floor(w/2)*math.floor(h/2)
  print(nos)

Buggy submission (verdict: Runtime Error):
a=int(input("Enter the height a in meters="))
b=int(input("Enter the height b in meters="))
c=int(input("Enter the height c in meters="))
if(1<=a and 1<=b and 1<=c and a<=100 and b<=100 and c<=100):
    if(b-a==c-b):
        print("Yes")
        print('Since'+str(b)+ '-' +str(a)+ '=' +str(c)+ '-' +str(b)+ ',this arrangement of poles is beautiful.')
    elif(c-b==b-a):
        print("Yes")
        print('Since'+str(c)+ '-' +str(b)+ '=' +str(b)+ '-' +str(a)+ ',this arrangement of poles is beautiful.')
    else:
        print("NO")
        print('Since'+str(b)+ '-' +str(a)+ '≠' +str(c)+ '-' +str(b)+ ',this arrangement of poles is not beautiful.')

Buggy submission (verdict: Runtime Error):
a=int(input("Enter a"))
b=int(input("Enter b"))
c=int(input("Enter c"))
if a-b == b-c || b-a == c-b:
 print(Beautiful")
else:
 print("No")

Buggy submission (verdict: Runtime Error):
def beautiful:
     a,b,c = input().split()
      if fabs(b-a) == fabs(c-b):
            print('YES')
      else:
            print('NO')

beautiful()

Buggy submission (verdict: Runtime Error):
def beautiful:
     a,b,c = input().split()
      if ((abs(b-a)) == (abs(c-b))):
            print('YES')
      else:
            print('NO')

beautiful()

Buggy submission (verdict: Runtime Error):
def beautiful:
      a,b,c = int(input()).split()
      if ((abs(b-a)) == (abs(c-b))):
            print('YES')
      else:
            print('NO')

beautiful()

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if(abs(a-b)==abs(b-c)):
    print("Yes")
else:
    print("No")
Problem p03760 (python)

Fixed submission:
a = input()
b = input()

if(len(a) > len(b)):
    for i in range(len(b)):
        print(a[i],b[i],sep="",end="")
    print(a[i+1:])
else:
    for i in range(len(a)):
        print(a[i],b[i],sep="",end="")
    print(b[i+1:])

Buggy submission (verdict: Runtime Error):
O=list(input())
E=list(input())
F=[]
j=0
k=0
for i in range(0,len(O)+len(E)):
    F.append('0')
while j<(len(O)+len(E)):
    if j%2==0:
        F[j]=E[j//2]
    else:
        F[j] = O[j//2]
    j=j+1
F= ''.join([str(elem) for elem in F])
print(F)

Buggy submission (verdict: Runtime Error):
O=list(input())
E=list(input())
F=[]
j=0
k=0
F=[0]*(len(O)+len(E))

while j<(len(O)+len(E)):
    F[j]=E[k]
    j=j+2
    k=k+1
j=1 
k=0
while j<(len(O)+len(E)):
    F[j]=O[k]
    j=j+2
    k=k+1 
F= ''.join([str(elem) for elem in F])
print(F)
Problem p03795 (python)

Fixed submission:
import math
n=int(input())
ans=n*800-(n//15)*200
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())

k = n//15

cost = n*800

return = k*200

print(cost - return)

Buggy submission (verdict: Runtime Error):
x = int(raw_input())
print(x*800 - (x/15) * 200)
#asdf#asdf#asdf#asdf#asdf#asdf#asdf#asdf#asdf#asdf#asdf
Problem p03800 (python)

Fixed submission:
#!/usr/bin/python
# -*- coding: utf-8 -*-



def gen(start, s):
	for i in xrange(1, len(s)+1):
		c = start[i]
		h = s[i] if i < len(s) else s[0]
		if h == 'o':
			if c == 'S':
				start += start[i-1]
			else:
				start += 'S' if start[i-1] == 'W' else 'W'
		else:
			if c == 'S':
				start += 'S' if start[i-1] == 'W' else 'W'
			else:
				start += start[i-1]

	if start[:2] == start[-2:]:
		return start[:-2]
	return ''


def main():
	n = int(raw_input())
	s = raw_input()

	for x in ('SS', 'SW', 'WW', 'WS'):
		ans = gen(x, s)
		if ans:
			print ans
			return
	print -1

if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python
# -*- coding: utf-8 -*-



def gen(start, s):
	for i in xrange(1, len(s)+1):
		c = start[i]
		h = s[i] if i < len(s) else s[0]
		if h == 'o':
			if c == 'S':
				start += start[i-1]
			else:
				start += 'S' if start[i-1] == 'W' else 'W'
		else:
			if c == 'S':
				start += 'S' if start[i-1] == 'W' else 'W'
			else:
				start += start[i-1]

	if start[:2] == start[-2:]:
		return start[:-2]
	return ''


def main():
	n = int(raw_input())
	s = raw_input()

	for x in ('SS', 'SW', 'WW', 'WS'):
		ans = gen(x, s)
		if ans:
			print ans
			return
	print -1

if __name__ == '__main__':
	main()
Problem p03826 (python)

Fixed submission:
s = raw_input().split()
p= int(s[0]) 
q= int(s[1])
r= int(s[2])
s= int(s[3])
def area(a,b,c, d):
    if a*b > c*d:
        print a*b
    elif c*d > a*b:
        print c*d
    else:
        print a*b
x = area(p,q,r,s)

Buggy submission (verdict: Runtime Error):
s = input()
a = s/1000 
b = s/100 -(s/1000)*10 
c = s/10 -(s/100)*10 
d = s - (s/10)*10

if a*b > c*d:
    print a*b
elif c*d > a*b:
    print c*d
else:
    print a*b
Problem p03836 (python)

Fixed submission:
s = raw_input().split()
a= int(s[0]) 
b= int(s[1])
c= int(s[2])
d= int(s[3])

w = c-a 
h = d-b 
u ="U"
d = "D"
r = "R"
l = "L"

str = "U"*h + "R"*w + "D"*h + "L"*w + "L" + u*(h+1) + r*(w+1) + d + r + d*(h+1) + l*(w+1) + u  
print str

Buggy submission (verdict: Runtime Error):
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define uint unsigned int
#define ull  unsigned long long
typedef string str;
typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define fi first
#define se second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int INF = 1e9 + 5;
const int N = 2e5 + 123;
int main(){
    speed;
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    int l = x - a;
    int r = y - b;
    if(l > 0){
        for(int i = 0; i < l; ++i){
            cout << 'R';
        }
        if(r > 0){
            for(int i = 0; i < r; ++i){
                cout << 'U';
            }
        }
        else{
            for(int i = 0; i < abs(r); ++i){
                cout << 'D';
            }
        }
        for(int i = 0; i < l; ++i){
            cout << 'L';
        }
        if(r > 0){
            for(int i = 0; i < abs(r); ++i){
                cout << 'D';
            }
        }
        else{
            for(int i = 0; i < r; ++i){
                cout << 'U';
            }
        }
    }
    else{
        for(int i = 0; i < abs(l); ++i){
            cout << 'L';
        }
        if(r > 0){
            for(int i = 0; i < r; ++i){
                cout << 'D';
            }
        }
        else{
            for(int i = 0; i < abs(r); ++i){
                cout << 'U';
            }
        }
        for(int i = 0; i < abs(l); ++i){
            cout << 'R';
        }
        if(r > 0){
            for(int i = 0; i < r; ++i){
                cout << 'U';
            }
        }
        else{
            for(int i = 0; i < abs(r); ++i){
                cout << 'D';
            }
        }
    }
}
Problem p03844 (python)

Fixed submission:
l=input().split()
a=int(l[0])
x=l[1]
b=int(l[2])
if(x=='+'):
    print(a+b)
else:
    print(a-b)

Buggy submission (verdict: Runtime Error):
a,b,c=input()
a=int(a)
c=int(c)

if b=='+':
    s=a+c
else:
    s=a-c
print(s)

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
a=int(a)
c=char(c)
b=int(b)
if c=='+' :
    print(a+b)
else
    print(a-b)

Buggy submission (verdict: Runtime Error):
s=str(input())
if s[1]=='+':
   print(int(s[0])+int(s[2]))
else: 
    print(int(s[0])-int(s[2]))

Buggy submission (verdict: Runtime Error):

a,op,b=map(int,input().split())
if op=="+":
  suma=int(a)+int(b)
  print(suma)
elif op=="-":
  resta=int(a)-int(b)
  print(resta)
Problem p03853 (python)

Fixed submission:
h,w = map(int, input().split())
stage = [list(input()) for i in range(h)]
ans = [0 for i in range(2*h)]
for i in range(h):
    ans[2*i] = stage[i]
    ans[2*i+1] = stage[i]
for i in ans:
    for j in i:
        print(j, end = "")
    print()

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
for i in range(W):
    C = input()
    print(C)
    print(C)
Problem p03962 (python)

Fixed submission:
a=list(map(int,input().split()))
print(len(set(a)))

Buggy submission (verdict: Runtime Error):
n=[]
n=input(). split(" ")
sort (n) 
c=0
p=0
if (n[1]!=n[0]):
    c=1
if(n[1]!=n[2]):
     p=1
print(c+p+1)
Problem p04029 (python)

Fixed submission:

while True:
    try:
        n = int(input())
        sum = int(0)
        for i in range(1, n+1):
            sum += i
        print(sum)
    except:
        break;

Buggy submission (verdict: Runtime Error):

while True:
    n = int(input())
    sum = int(0)
    for i in range(1,n+1):
        sum += i
    print(sum)
Problem p04030 (python)

Fixed submission:
s=input()
l=[]
for i in range(len(s)):
    if s[i]=='0':
        l.append('0')
    elif s[i]=='1':
        l.append('1')
    elif s[i]=='B' and len(l)!=0:
        l.pop()
    
for i in l:
    print(i,end='')

Buggy submission (verdict: Runtime Error):
s = input()
len = 0
op = []
 
for i in s:
    if(i == '1'):
        op.append('1')
        len += 1
    elif(i == '0'):
        op.append('0')
        len += 1
    elif(i == 'B'):
        if(len > 0):
            op.pop()
            len = len - 1
 
for i in op:
    print(i, end = ''
Problem p04043 (python)

Fixed submission:
a=input().split(" ")
a=list(map(int,a))
b=a[0]*a[0]+a[1]*a[1]+a[2]*a[2]
if b==99:
    print("YES")
else :
    print("NO")

Buggy submission (verdict: Runtime Error):
#include <stdio.h>


int main()
{
int A,B,C,d;
scanf("%d %d %d",&A,&B,&C);


if (A&&B==5&&C==7)
    printf("YES\n");
else if (A&&C==5&&B==7)
    printf("YES\n");
else if(A==7&&B&&C==5)
    printf("YES\n");
else
printf("NO\n");

return 0;
}
Problem p02923 (python)

Fixed submission:
n=int(input())
h = list(map(int,input().split()))
m=0
count = 0

for i in range (n-1):
    if h[i]>=h[i+1]:
        count += 1
    else:
        m = max(m,count)
        count = 0
m = max(m,count)
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
h = list(map(int,input().split()))
i=0
m=0
count = 0

for i in range (n):
    if h[i]>=h[i+1]:
        count += 1
    else:
        m = max(m,count)
        count = 0    
m = max(m,count)            
print(m)
Problem p02953 (python)

Fixed submission:
import sys
n = int(input())
h = list(map(int,input().split()))
for k in range(n-1):
    if h[k+1]==h[k]-1:
        h[k+1]=h[k+1]+1
    elif h[k+1]>=h[k]:
        continue
    else:
        print('No')
        sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
h = list(map(int,input().split()))
for k in range(n-1):
    if h[k+1]==h[k]-1:
        h[k+1]=h[k]
    elif h[k+1]>=h[k]:
        continue
    else:
        print('No')
        sys.exit()
print('Yes'

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
h = [input() for i in range(n)]
for k in range(n-1):
    if h[k+1]==h[k]-1:
        h[k+1]=h[k]+1
    elif h[k+1]>h[k]:
        continue
    else:
        print('No')
        sys.exit()
print('Yes')
Problem p02983 (python)

Fixed submission:
import sys
l,r = map(int,(input().split()))
if r-l>=2018:
    print(0)
    sys.exit()

else:
    if l%2019>r%2019:
        l=l%2019
        r=r%2019+2019
    else:
        l=l%2019
        r=r%2019

    m=2018
    for i in range(l,r):
        for j in range(i+1,r+1):
            a =i*j%2019
            m =min(m,a)

    print(m)

Buggy submission (verdict: Runtime Error):
l,r = map(int,(input().split()))
if r-l>=2018:
    print(0)
    sys.exit()

else:
    if l%2019>r%2019:
        l=l%2019
        r=r%2019+2019
    else:
        l=l%2019
        r=r%2019

    m=2018
    for i in range(l,r):
        for j in range(i+1,r+1):
            a =i*j%2019
            m =min(m,a)

    print(m)

Buggy submission (verdict: Runtime Error):
l,r = map(int,(input().split()))
if r-l>=2018:
    print('0')
    sys.exit()

else:
    if l%2019>r%2019:
        l=l%2019
        r=r%2019+2019
    else:
        l=l%2019
        r=r%2019

        m=2018
    for i in range(l,r):
        for j in range(i+1,r+1):
            a =i*j%2019
            m =min(m,a)

    print(m)

Buggy submission (verdict: Runtime Error):
l,r = map(int,(input().split()))
if r-l>=2018:
    print(0)
    sys.exit()

else:
    if l%2019>r%2019:
        l=l%2019
        r=r%2019+2019
    else:
        l=l%2019
        r=r%2019

        m=2018
    for i in range(l,r):
        for j in range(i+1,r+1):
            a =i*j%2019
            m =min(m,a)

    print(m)
Problem p03001 (python)

Fixed submission:
w,h,x,y=map(int,input().split())
z=0
if x==h//2 and y==w//2 :
    z=1
elif y==h//2 and x==w//2:
    z=1
if w%2==1 or h%2==1:
    z=0
print(w*h/2,z)

Buggy submission (verdict: Runtime Error):
w,h,x,y=map(int,input().split())
z=0
if x==h//2 or x==w//2 or y==h//2 or y==w//2:
    z=1
print(w*h/2+' '+z)
Problem p03424 (python)

Fixed submission:
n = int(input())
l=list(input())
if 'Y' in l:
  print('Four')
else:
  print('Three')

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(input())
if 'Y' in l:
  print(Four)
else:
  print(Three)n = int(input())
l=list(input())
if 'Y' in l:
  print('Four')
else:
  print('Three')

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(input())
if 'Y' in l:
  print(Four)
else:
  print(Three)
Problem p03761 (python)

Fixed submission:
n=int(input())
h = [input() for d in range (n)]
alphabet=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
list=[]


for k in range(26):
    m=50
    for i in range (n):
         x =h[i].count(alphabet[k])
         m =min(x,m)
    list.append(alphabet[k]*m)

print(''.join(list))

Buggy submission (verdict: Runtime Error):
n=int(input())
h = [input() for d in range (n)]
alphabet=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
list=[]


for k in range(26):
    for i in range (n):
         m=50
         x =h[i].count(alphabet[k])
         m =min(x,m)
    list.append(alphabet[k]*m)

print('',join(list))