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

Fixed submission:
X,Y=(i for i in input().split())
left=ord(X)-55
right=ord(Y)-55
if left==right:
    print("=")
elif left>right:
    print(">")
else:
    print("<")

Buggy submission (verdict: Runtime Error):
X,Y=(int(i) for i in input().split())
left=ord(X)-55
right=ord(Y)-55
if left==right:
  print("=")
elif left>right:
  print(">")
else:
  print("<")
Problem p03563 (python)

Fixed submission:
R=int(input())
G=int(input())
print(G*2-R)

Buggy submission (verdict: Runtime Error):
R=input()
G=input()
print(G*2-R)
Problem p03943 (python)

Fixed submission:
A=[int(i) for i in input().split()]
sort_list=sorted(A)
if sort_list[0]+sort_list[1]==sort_list[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A=[int(i) for i in input().split]
sort_list=sorted(A)
if sort_list[0]+sort_list[1]==sort_list[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A=[int(i) for i in input().split]
sort_list=sorted(A)
if sort_list[0]+sort_list[1]==sort_list[2]:
    print("Yes")
else:
    print("No")
Problem p02995 (python)

Fixed submission:
def gcd(a, b):
	if a < b:
		a,b = b,a
	while b:
		a, b = b, a % b
	return a
def lcm(a, b): 
	return (a*b)//gcd(a,b)

a,b,c,d = map(int,input().split())
a3 = b // c - (a-1) // c
b3 = b // d - (a-1) // d
if c < d:
	c,d = d,c
width = b - a + 1
c3 = b//lcm(c,d) - (a-1)//lcm(c,d)
print(int(width - a3 - b3 + c3))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
	if a < b:
		a,b = b,a
	while b:
		a, b = b, a % b
	return a
def lcm(a, b): 
	return (a*b)//gcd(a,b)

a,b,c,d = map(int,input().split())
a3 = b // c - (a-1) // c
b3 = b // d - (a-1) // d
if c < d:
	c,d = d,c
width = b - a + 1
c3 = b//lcm(c,d) - (a-1)//lcm(c,d)
print(int(width - a3 - b3 + c3))

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

Fixed submission:
A,P = map(int,input().split())
print(int((A*3+P)/2))

Buggy submission (verdict: Runtime Error):
import java.util.Scanner;
class Main{
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int P = scanner.nextInt();
        int ans = (A*3+P)/2;
        System.out.println(ans);
    }
}
Problem p03061 (python)

Fixed submission:
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    return gcd(b,a%b)

n = int(input())
a = list(map(int, input().split()))
rs, ls = [0], [0]
for i in range(n-1):
    rs.append(gcd(rs[i], a[i]))
    ls.append(gcd(ls[i], a[-i-1]))
gcd_list = [gcd(r,l) for r, l in zip(rs, ls[::-1])]
print(max(gcd_list))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
N = int(input())
a = list(map(int,input().split()))
if N==2:
    print(max(a))
else:
    gcd1 = gcd(a[0],a[1])
    gcd2 = gcd(a[0],a[2])
    gcd3 = gcd(a[1],a[2])
    flag1 = flag2 = flag3 = 0
    for i in range(N):
        if a[i]%gcd1 == 0:
            flag1 += 1
        if a[i]%gcd2 == 0:
            flag2 += 1
        if a[i]%gcd3 == 0:
            flag3 += 1
    ans = []
    if flag1 == N-1:
        ans.append(gcd1)
    if flag2 == N-1:
        ans.append(gcd2)
    if flag3 == N-1:
        ans.append(gcd3)
    print(max(ans))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
n = int(input())
a = list(map(int,input().split()))
li = []
li2 = []
for i in range(n-1):
    li.append(gcd(a[i],a[i+1]))
for i in range(n-2):
    li2.append(gcd(a[i],a[i+2]))
if n <= 3:
    li = set(li) | set(li2)
    ans = max(li)
    print(ans)
else:
    li = set(li) & set(li2)
    ans = max(li)
    print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int,input().split()))
li = []
li2 = []
for i in range(n-1):
    li.append(math.gcd(a[i],a[i+1]))
for i in range(n-2):
    li2.append(math.gcd(a[i],a[i+2]))
li = set(li)  | set(li2)
ans = max(li)
print(ans)
Problem p03069 (python)

Fixed submission:
n = int(input())
s = list(input())
ans = white = s.count('.')
black = 0
for i in s:
    if i == '.':
        white -= 1
    else:
        black += 1
    ans = min(ans,white+black)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())
black1 = s.count('#')
white1 = s.count('.')
if black1 > 0:
    for i in reversed(s):
        if i == '#':
            n -= 1
        else:
            break
    l1 = s[:n]
    black2 = l1.count('#')
    b = l1.index('#')
    l2 = l1[b:]
    white2 = l2.count('.')
    l3 = s[b:]
    black3=l3.count('#')
    print(min(black1,white1,black2,white2,black3))
else:
    print('0')
Problem p03071 (python)

Fixed submission:
A,B = map(int,input().split())
if B < A:
    n = A
    A -= 1
else:
    n = B
    B -= 1
if B < A:
    n += A
else:
    n += B

print(n)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
A,B = map(int,input().split())
if B < A:
    n = A
    A -= 1
else:
    n = B
    B -= 1
if B < A:
    n += A
else:
    n += B

print(n)
Problem p03086 (python)

Fixed submission:
s = input()
ans = []
counter = 0
for i in s:
    if i in 'ATGC':
        counter += 1
    else:
        counter = 0
    ans.append(counter)
print(max(ans))

Buggy submission (verdict: Runtime Error):
s = input()
ans = []
counter = 0
for i in s:
    if i in 'ATGC':
        counter += 1
    else:
        ans.append(counter)
        counter = 0
print(max(ans))

Buggy submission (verdict: Runtime Error):
s = input()
ans = []
counter = 0
for i in s:
    if i in 'ATGC':
        counter += 1
    else:
        ans.append(counter)
        conuter = 0
print(max(ans))

Buggy submission (verdict: Runtime Error):
s = input()
ans = []
counter = 0
for i in s:
    if i in 'ATGC':
        counter += 1
    else:
        ans.append(counter)
        conter = 0

print(max(ans))
Problem p03087 (python)

Fixed submission:
n,q = map(int,input().split())
S = input()
d = [0] * n
counter = 1
for i in range(n - 1):
    d[i] = counter
    if S[i]+S[i + 1] == 'AC':
            d[i+1] = counter
            counter += 1
d[len(S)-1] = counter
for i in range(q):
    r,l = map(int,input().split())
    print(d[l-1]-d[r-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
S = input()
d = [0] * n
for i in range(n - 1):
        if S[i]+S[i + 1] == 'AC':
                d += 1
for i in range(q):
        r,l = map(int,input().split())
        su = 0
        for j in range(r-1,l):
                su += d[j]
        print(su-d[r-1])
Problem p03211 (python)

Fixed submission:
n=input()
a=[]
for i in range(len(n)-2):
    a.append(abs(int(n[i:i+3])-753))
print(min(a))

Buggy submission (verdict: Runtime Error):
s = input()
ans = min(abs(s[i:i+3] - 753) for i in range(len(s) -2))
print(ans)
Problem p03220 (python)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h = list(map(int, input().split()))
x = [abs(a-(t-b*0.006)) for b in h]
print(x.index(min(x))+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h = list(map(int, input().split()))
x = [abs(a-(t-b*0.006)) for b in h]
print(x.index(min(x)+1))
Problem p03227 (python)

Fixed submission:
n = input()

if len(n) == 2:
    print(n)
elif len(n) == 3:
    print(n[::-1])

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

if len(n) == 2:
    print(n)
else if len(n) == 3:
    print(n[::-1])
Problem p03244 (python)

Fixed submission:
from collections import Counter
n = int(input())
v = list(map(int,input().split()))
even = Counter(v[::2]).most_common(2)
odd = Counter(v[1::2]).most_common(2)

if even[0][0] != odd[0][0]:
    ans =  n - even[0][1] - odd[0][1]
else:
    if len(even) == 1 or len(odd)==1:#単一の要素からなる場合ex.)1111
        ans = n//2
    else:
        ans =  n - max(even[0][1] + odd[1][1],even[1][1]+odd[0][1])
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
v = list(map(int,input().split()))
even = Counter(v[::2]).most_common(2)
odd = Counter(n[1::2]).most_common(2)
if even[0][0] != odd[0][0]:
    ans =  n - even[0][1] - odd[0][1]
else:
    if len(even) == 1:
        ans = n//2
    else:
        ans =  n - max(even[0][1] + odd[1][1],even[1][1],odd[0][1])
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
v = list(map(int,input().split()))
even = Counter(v[::2]).most_common(2)
odd = Counter(n[1::2]).most_common(2)
if even[0][0] != odd[0][0]:
    ans =  n - even[0][1] - odd[0][1]
else:
    if len(even) == 1:
        ans = n//2:
    else:
        ans =  n - max(even[0][1] + odd[1][1],even[1][1],odd[0][1])
print(ans)
Problem p03288 (python)

Fixed submission:
n = int(input())

if 0 <= n and n < 1200 :
    print("ABC")
elif n < 2800 :
    print("ARC")
else :
    print("AGC")

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

if n < 1200 :
    print(ABC)
elif n < 2800 :
    print(ARC)
else :
    print(AGC)
Problem p03292 (python)

Fixed submission:
n = list(map(int,input().split()))
n.sort()
ans = n[2]-n[0]
print(ans)

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

a = abs((int(n[1])-int(n[0]))+abs((int(n[2])-int(n[1]))
b = abs((int(n[2])-int(n[0]))+abs((int(n[1])-int(n[2]))
c = abs((int(n[2])-int(n[1]))+abs((int(n[0])-int(n[2]))
d = abs((int(n[0])-int(n[1]))+abs((int(n[2])-int(n[0]))
e = abs((int(n[1])-int(n[2]))+abs((int(n[0])-int(n[1]))
f = abs((int(n[0])-int(n[2]))+abs((int(n[1])-int(n[0]))

w = min(a,b,c,d,e,f)

print(w)
Problem p03293 (python)

Fixed submission:
import sys

s = input()
t = input()

a = int(len(s))

for i in range(0,a) :
    s = s[a-1::]+s[:a-1:]
    if s == t :
        print("Yes")
        sys.exit()

print("No")

Buggy submission (verdict: Runtime Error):
import sys

s = input()
t = input()

a = int(len(s))

for i in range(0,a) :
    s = s[:a-1:]+s[a-1::]
    if s == t :
        print("Yes")
        sys.exist()

print("No")
Problem p03294 (python)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]
print(sum(a)-N)

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

a.sort()

for m in range(0,int(a[n])) :
    for j in range(0,n) :
        f[m] += m//a[j]

f.sort()

print(f[n])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split(" ")

max = a[0]
for i in range(1,n) :
    if max < a[i] :
        max = a[i]

f = 0
for j in range(1,int(max)) :
    for d in range(0,n) :
        f[j] += j//a[d]

max1 = 0
for i in range(1,int(max)):
    if max1 < f[i] :
        max1 = f[i]

print(max1)
Problem p03549 (python)

Fixed submission:
n,m = map(int,input().split())
res = (1900*m+100*(n-m))*(2**m)
print(res)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split(''))
res = (1900*m+100(n-m))*2**m
print(res)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
print((1900*m+100(n-m))*2**m)
Problem p03573 (python)

Fixed submission:
numlist = list(input().split())
print(sorted(numlist,key=lambda x:numlist.count(x))[0])

Buggy submission (verdict: Runtime Error):
numlist = list(input().split())
print(sorted(numlist,key=lambda x:numlist.sount(x))[0])
Problem p03657 (python)

Fixed submission:
a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
n,k=int(input().split())
if (n+k)%3 == 0:
  print("Possible")
else:
  print("Impossible")
Problem p03219 (python)

Fixed submission:
X, Y = (int(x) for x in input().split())
print(X + int(Y / 2))

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = (int(x) for x in input().split())
altitude_list = [int(x) for x in input().split()]
dif_list = list(map(lambda x: abs(A - (T - x * 0.006)), altitude_list))
print(dif_list.index(min(dif_list)) + 1)
Problem p02953 (python)

Fixed submission:
N=int(input())
H=list(map(int, input().split()))
Z=0
count=0
for i in range(N-1):
    A=H[i+1]
    B=H[i]-1
    if A < B:
        print('No')
        Z=Z+1
        break
    if A == B:
        count=count+1
        if count >=2 and A < C:
            print('No')
            Z=Z+1
            break
        else:
            C=A
if Z == 0:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int, input().split()))
count=0
for i in range(N-1):
    A=H[i+1]
    B=H[i]-1
    if A < B:
        print('No')
        Z=Z+1
        break
    if A == B:
        count=count+1
        if count == 2:
            print('No')
            Z=Z+1
            break
if Z == 0:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int, input().split()))
for i in range(N-1):
    A=H[i+1]
    B=H[i]-1
    if A < B:
        print(No)
    else:
        print(Yes)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=map(int, input().split())
for i in range(N-1):
    A=H[i+1]
    B=H[i]-1
    if A < B:
        print(Yes)
    else:
        print(No)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=map(int, input().split())
for i in range(N-1):
    A=H[i+1]
    B=H[i]-1
    if A < B:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
H=map(int, input().split())
for i in range(N-1):
    A=H[i+1]
    B=H[i]-1
    if A < B:
        print(No)
    else:
        print(Yes)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=map(int, input().split())
for i in range(N-1):
    if H[i+1] < H[i]-1:
        print(No)
    else:
        print(Yes)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=map(int, input().split())
for i in range(N-1):
    if H[i+1] < H[i]:
        print(No)
    else:
        print(Yes)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=map(int, input().split())
for i in range(N-1):
    if H[i+1] < H[i]:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
H=map(int, input().split())
for i in range(N-1):
    if H[i+1] < H[i]:
        print(No)
    else:
        print(Yes)

Buggy submission (verdict: Runtime Error):
N=int(input())
H= map(int, input().split())
for i in range(N-1)
    if H[i+1] < H[i]:
        print(No)
    else:
        print(Yes)
Problem p02957 (python)

Fixed submission:
A,B = map(int, input().split())
C=(A+B)/2
D=A+B
if D %2 > 0:
    print('IMPOSSIBLE')
elif D %2 == 0:
    print((A+B)//2)

Buggy submission (verdict: Runtime Error):
A,B = map(int, input().split())
if A+B %2 == 1:
    print('IMPOSSIBLE)
else:
    print((A+B)/2)
Problem p02993 (python)

Fixed submission:
S=input()
if S[0]==S[1]:
  print('Bad')
elif S[1]==S[2]:
  print('Bad')
elif S[2]==S[3]:
  print('Bad')
else:
  print('Good')

Buggy submission (verdict: Runtime Error):
S=int(input())
if S[0]==S[1]:
  print('Bad')
elif S[1]==S[2]:
  print('Bad')
elif S[2]==S[3]:
  print('Bad')
else:
  print('Good')
Problem p03029 (python)

Fixed submission:
A,P= map(int, input().split())
B=(3*A+P) // 2
print(B)

Buggy submission (verdict: Runtime Error):
A,P= map(int, input().split())
print((3*A+P)%2))
Problem p03071 (python)

Fixed submission:
A,B=map(int, input().split())
if A-B>=1:
  print(2*A-1)
elif A==B:
  print(A+B)
else:
  print(2*B-1)

Buggy submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A-B>=1:
  print(2*A-1)
  break
elif A==B:
  print(A+B)
  break
else:
  print(2*B-1)

Buggy submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A-B>=1:
  print(2*A-1)
  break
elif A==B:
  print(A+B)
  break
else:
  print(2*B-1)
  break

Buggy submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A-B>=2:
  print(2*A-1)
elif A=B:
  print(A+B)
else:
  print(2*B-1)
Problem p03085 (python)

Fixed submission:
b = input()
A='A'
T='T'
C='C'
G='G'
if b==A:
    print(T)
elif b==C:
    print(G)
elif b==G:
    print(C)
elif b==T:
    print(A)

Buggy submission (verdict: Runtime Error):
b = input()
A='A'
T='T'
C='C'
G='G'
if b==A;
    print(T)
elif b==C;
    print(G)
elif b==G;
    print(C)
elif b==T;
    print(A)

Buggy submission (verdict: Runtime Error):
b = input()
A=A
T=T
C=C
G=G
if b==A;
    print('T')
elif b==C;
    print('G')
elif b==G;
    print('C')
elif b==T;
    print('A')

Buggy submission (verdict: Runtime Error):
b = input()
if b=='A';
    print('T')
elif b=='C';
    print('G')
elif b=='G';
    print('C')
elif b=='T';
    print('A')

Buggy submission (verdict: Runtime Error):
b = input()
if b==A;
    print('T')
elif b==C;
    print('G')
elif b==G;
    print('C')
elif b==T;
    print('A')
Problem p03145 (python)

Fixed submission:
AB,BC,CA = map(int, input().split())
print(AB*BC//2)

Buggy submission (verdict: Runtime Error):
AB,BC = map(int, input().split())
print(AB*BC/2)
Problem p03238 (python)

Fixed submission:
a = int(input())
if a == 1:
  print('Hello World')
else:
  b=[int(input()) for i in range(2)]
  c=b[0]+b[1]


  print(c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b=[int(input()) for i in range(2)]
c=b[0]+b[1]
if a == 1:
  print('Hello World')
else:
  print(c)

Buggy submission (verdict: Runtime Error):
a = int(input())
list=[int(input()) for i in range(2)]
if a == 1:
  print(Hello World)
else:
  print(list[0]+list[1])

Buggy submission (verdict: Runtime Error):
a = int(input())
if a == 1:
  print(Hello World)
else:
  list=[int(input()) for i in range(2)]
  print(list[0]+list[1])

Buggy submission (verdict: Runtime Error):
a = int(input())
if a == 1:
  print(Hello World)
else:
  list=[input() for i in range(2)]
  print(list[0]+list[1])
Problem p03260 (python)

Fixed submission:
A,B=map(int, input().split())
if A==2 or B==2:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
A,B=map(int(input()))
if A==2 or B==2:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
A,B=map(int.input())
if A==2 or B==2:
  print('No')
else:
  print('Yes')
Problem p03264 (python)

Fixed submission:
K=int(input())
if K%2==0:
  A=K*K//4
  print(A)
else:
  B=(K-1)*(K+1)//4
  print(B)

Buggy submission (verdict: Runtime Error):
K=int(input())
if K%2==0
  A=K*K//4
  print(A)
else:
  B=(K-1)*K//4
  print(B)

Buggy submission (verdict: Runtime Error):
K=int.input()
if K%2==0
  A=K*K//4
  print(A)
else:
  B=(K-1)*K//4
  print(B)
Problem p03323 (python)

Fixed submission:
A,B= map(int, input().split())
if A<=8 and B<=8:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
A,B= map(int, input().split())
if A<=8 and B<=8:
    print(Yay!)
else:
    print(:()

Buggy submission (verdict: Runtime Error):
A,B= map(int, input().split())
if A<=8 and B<=8;
    print('Yay!')
else:
    print(':(')
Problem p03844 (python)

Fixed submission:
A,op,B=input().strip().split()
if op == '+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

Buggy submission (verdict: Runtime Error):
A,op,B=input().strip().split()
if op == '+':
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
A,op,B=input().strip().split()
if op=='+':
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
A,op,B=input().split()
if op=='+':
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
A,op,B=list(map(input().split()))
if op=='+':
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
A,op,B=list(map(int, input().split()))
if op=='+':
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
A,op,B=list(map(int, input().split()))
if op=='+:'
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
A,op,B=list(map(int, input().split()))
if op==+:
  print(A+B)
else:
  print(A-B)
Problem p03813 (python)

Fixed submission:
x=int(input())
if x < 1200:
      print("ABC")
else:
      print("ARC")

Buggy submission (verdict: Runtime Error):
x=int(input())
if x<1200:
      print(ABC)
else:
      print(ARC)

Buggy submission (verdict: Runtime Error):
x=int(input(())
if x<1200:
      print(ABC)
else:
      print(ARC)
Problem p02885 (python)

Fixed submission:
A,B=map(int,input().split())
n=A-(B*2)
if n>=0:
    print(n)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
n=A-(B*2)
if n>=0:
    print(n)
else:
    print(o)
Problem p03730 (python)

Fixed submission:
A,B,C = [int(i) for i in input().split()]
Flag = False

for i in range(1,B+1):
    D = i*A % B
    if D == C:
        Flag = True
        break

if Flag == True:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
A,B,C = [int(i) for i in input().split()]
Flag = False

for i in range(1,B+1):
    D = i*A % B
    if D = C:
        Flag = True
        break

if Flag == True:
    print('YES')
else:
    print('NO')
Problem p03761 (python)

Fixed submission:
N = int(input())
s = []
for i in range(N):
    val = sorted(input())
    s.append(val)

an = 0
for i in range(N):
    if len(s[an]) <= len(s[i]):
        continue
    else:
        an = i

a = s[an]

for i in range(N):
    n = 0
    while a != s[i] and n < len(a) and n < len(s[i]):
        if a[n] == s[i][n]:
            n += 1
        else:
            if a[n] > s[i][n]:
                s[i].pop(n)
            else:
                a.pop(n)
    if len(a) > len(s[i]):
        a = s[i]

print(''.join(a))

Buggy submission (verdict: Runtime Error):
N = int(input())
s = []
for i in range(N):
    val = sorted(input())
    s.append(val)

an = 0
for i in range(N):
    if len(s[an]) <= len(s[i]):
        continue
    else:
        an = i

a = s[an]
n = 0

for i in range(N):
    n = 0
    while len(s[i]) > len(a) and n < len(a):
        if a[n] == s[i][n]:
            n += 1
        else:
            if n == 0:
                a.pop(0)
                s[i].pop(0)
            else:
                if ord(a[n]) > ord(s[i][n]):
                    s[i].pop(n)
                else:
                    a.pop(n)
    if a[n-1] == s[i][n-1]:
        continue
    else:
        a.pop(-1)

print(''.join(a))

Buggy submission (verdict: Runtime Error):
N = int(input())
s = []
for i in range(N):
    val = sorted(input())
    s.append(val)

an = 0
for i in range(N):
    if len(s[an]) <= len(s[i]):
        continue
    else:
        an = i

a = s[an]
n = 0

for i in range(N):
    n = 0
    while len(s[i]) > len(a) and n < len(a):
        if a[n] == s[i][n]:
            n += 1
        else:
            if n == 0:
                a.pop(0)
                s[i].pop(n)
            else:
                if ord(a[n]) > ord(s[i][n]):
                    s[i].pop(n)
                else:
                    a.pop(n)
    if a[n-1] == s[i][n-1]:
        continue
    else:
        a.pop(-1)

print(''.join(a))

Buggy submission (verdict: Runtime Error):
N = int(input())
s = []
for i in range(N):
    val = sorted(input())
    s.append(val)

an = 0
for i in range(N):
    if len(s[an]) <= len(s[i]):
        continue
    else:
        an = i

a = s[an]
n = 0

for i in range(N):
    n = 0
    while len(s[i]) > len(a) and n < len(a):
        if a[n] == s[i][n]:
            n += 1
        else:
            if ord(a[n]) > ord(s[i][n]):
                s[i].pop(n)
                n -= 1
            else:
                a.pop(n)
                n -= 1
    if a[n-1] == s[i][n-1]:
        continue
    else:
        a.pop(-1)

print(''.join(a))
Problem p03826 (python)

Fixed submission:
A,B,C,D = [int(i) for i in input().split()]

S1 = int(A*B)
S2 = int(C*D)

if S1 >= S2:
    print(S1)
elif S2 > S1:
    print(S2)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())

max = 0
x = 0

for i in range(N):
    if S[i] == 'I':
        x += 1
    else:
        x -= 1
    if x > max:
        max = x

print(max)

Buggy submission (verdict: Runtime Error):
A,B,C,D = [int(i) for i in input().split()]

S1 = int(A*B)
S2 = int(C*D)

if S1 >= S2:
    print(S1)
else:
    return 0
if S2 >= S1:
    print(S2)
else:
    return 0