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

Fixed submission:

import math
A = int(input())
B = int(input())
if B < A: A,B = B,A

if A == B:
    print(1)
else:
    t = int(math.floor(math.log2(B)))
    while (A & 2**t) == (B & 2**t):
        if A & 2**t:
            A -= 2**t
            B -= 2**t
        t-=1
    ans = 2**t - A              # [A,2^t-1]
    r = t-1
    while 2**t + 2**r > B and r>=0:
        r-=1
    # [2^t,2^t+2^{r+1}-1] \cup [2^t+A,2^{t+1}-1]
    C = 2**(r+1)
    if C < A:
        ans += C + 2**t - A
    else:
        ans += 2**t
    print(ans)

Buggy submission (verdict: Runtime Error):
import math
A = int(input())
B = int(input())
if B < A: A,B = B,A

if A == B:
    print(1)
else:
    t = int(math.floor(math.log2(B)))
    while (A & 2**t) == (B & 2**t):
        if A & 2**t:
            A -= 2**t
            B -= 2**t
        t-=1
    ans = 2**t - A              # [A,2^t-1]
    r = t-1
    while 2**t + 2**r > B:
        r-=1
    # [2^t,2^t+2^{r+1}-1] \cup [2^t+A,2^{t+1}-1]
    C = 2**(r+1)
    if C < A:
        ans += C + 2**t - A
    else:
        ans += 2**t

print(ans)
Problem p03328 (python)

Fixed submission:
# coding:utf-8
a, b= map(int, input().split())

diff = b-a
d = 0
for i in range(1, diff):
    d += int(i)
print(abs(d-a))

Buggy submission (verdict: Runtime Error):
# coding:utf-8
a, b= map(int, input().split())

diff = b-a
d = 0
for i in enumerate(diff+1, 1):
    d += i 

print(abs(d-a)
Problem p03359 (python)

Fixed submission:
a,b=map(int,input().split())
if a>b:
   print(a-1)
else:
   print(a)

Buggy submission (verdict: Runtime Error):
a=(int,input())
b=(int,input())
if a>b:
   print(a-1)
else:
   print(a)
Problem p03433 (python)

Fixed submission:
a = int(input())
n = int(input())
if((a%500)<=n):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b=int(input())
b=int(a%500)
if (b<=n):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = int(input())
a%500==b
if (b<=n):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = int(input())
if((a%500)<=b):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if((a%500)<=b):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,A=map(int.input().split())
if N%500<=A:
  print ("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
int.("A")
int.("N")
if N%500<=A:
  print ("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
int(A)
int(N)
if N%500<=A:
  print ("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
int("A")
int("N")
if N%500<=A:
  print ("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
if N%500<=A:
  print ("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
if N%500<=A:
print("Yes")
else: 
print("No")

Buggy submission (verdict: Runtime Error):
N,A=map(int,input().split())
if N%500<=A
print("Yes")
else 
print("No")
Problem p03455 (python)

Fixed submission:
(a,b)=map(int,input().split())
if a*b%2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
(a,b)=map(int,input().split())
if a*b%2==0:
  print(偶数)
else
  print(奇数)
Problem p03351 (python)

Fixed submission:
A=input().split()
a=int(A[0])
b=int(A[1])
c=int(A[2])
d=int(A[3])
if abs(a-c) <= d:
  print("Yes")
elif (abs(a-b) <= d) & (abs(b-c) <= d):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A=input().split()
a=A[0]
b=A[1]
c=A[2]
d=A[3]
if abs(a-c) <= d:
  print("Yes")
elif (abs(a-b) <= d) & (abs(b-c) <= d):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A=input().split()
a=A[0]
b=A[1]
c=A[2]
d=A[3]
if abs(a-c) <= d:
  print("Yes")
elif (abs(a-b) <= d) && (abs(b-c) <= d):
  print("Yes")
else:
  print("No")
Problem p03424 (python)

Fixed submission:
input();print(['Four','Three'][len(set(list(input().split())))-4])

Buggy submission (verdict: Runtime Error):
print(['Four','Three'][len(set(list(input().split())))-4])
Problem p03695 (python)

Fixed submission:
input();a=[0]*9
for x in input().split():
    x=int(x)
    if x>3599:x=3200
    a[x//400]+=1
b=sum([1 if x else 0 for x in a[:8]])
print(max(1,b),b+a[8])

Buggy submission (verdict: Runtime Error):
a=[0]*9;input()
for x in list(map(int,input().split())):a[x//400]=1 if x<3200 else a[8]+1
b=sum(a[:8]);print(b,b*(b in[0,8])ora=[0]*9;input()
for x in list(map(int,input().split())):
    if x<3200:a[x//400]=1
    else:a[8]+=1
b=sum(a[:8]);print(b,b*(b==8)or b+a[8]) b+a[8])

Buggy submission (verdict: Runtime Error):
a=[0]*9;input()
for x in list(map(int,input().split())):a[x//400]=1 if x<3200 else a[8]+1
b=sum(a[:8]);print(b,b*(b in[0,8])or b+a[8])

Buggy submission (verdict: Runtime Error):
a=[0]*9;input()
for x in list(map(int,input().split())):
    if x<3200:a[x//400]=1
    else:a[x//400]+=1
b=sum(a[:8]);print(b,b*(b==8)or b+a[8])

Buggy submission (verdict: Runtime Error):
a=[0]*9;input()
for x in list(map(int,input().split())):
    if x<3200:a[x//400]=1
    else:a[x//400]+=1
b=sum(a[:8]);print((b,b)*(b==8)or b,b+a[8])
Problem p03711 (python)

Fixed submission:
x,y=map(int,input().split());a=[4,6,9,11];b=[1,3,5,7,8,10,12];print(['No','Yes'][int(x in a)*(y in a)+ int(x in b)*(y in b)])

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split());w+=2
print('#'*w)
for _ in[0]*h:print('#'+input()+'#')
print('#'*w)

Buggy submission (verdict: Runtime Error):
nput().split());a=[4,6,9,11];b=[1,3,5,7,8,10,12];print(['No','Yes'][(x in a and y in a)+x in b and y in b])

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split());a=[4,6,9,11];b=[1,3,5,7,8,10,12];print(['No','Yes'][x in a and y in a+x in b and y in b])
Problem p03730 (python)

Fixed submission:
def g(a,b):
    while b:a,b=b,a%b
    return a
a,b,c=map(int,input().split());print(['NO','YES'][c%g(a,b)==0])

Buggy submission (verdict: Runtime Error):
a,_,c=map(int,input()).split();print(['YES','NO'][a&1==0and c&1])
Problem p03737 (python)

Fixed submission:
print(*[x[0].swapcase() for x in input().split()],sep='')

Buggy submission (verdict: Runtime Error):
a=int(input());b=int(input());print('EQUAL' if a==b else 'GREATER' if a>b else 'LESS')
Problem p03795 (python)

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

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split());print((min(2*n,m)+m)//4)
Problem p03797 (python)

Fixed submission:
n,m=map(int,input().split())
print(min((m+2*n)//4,m//2))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=n%(m//2)
m-=2*a
if m<0:m=0
print(a+m//4)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=n%(m//2)
print(a+(m-2*a)//4)
Problem p03799 (python)

Fixed submission:
n,m=map(int,input().split())
print(min(m+2*n,2*m)//4)

Buggy submission (verdict: Runtime Error):
n=int(input());s=input();a=['SS','WS','SW','WW']
for i in range(n):
    for j in range(4):a[j]+='SW'[::-1 if s[i]=='o' else 1][a[j][i]==a[j][i+1]]
for i in range(4):
    if a[i][1]==a[i][n+1] and a[i][0] == a[i][n]:print(a[i][1:n+1]);exit()
print(-1)
Problem p03339 (python)

Fixed submission:
n=int(input())
s=input()
ans=[]
alle=list(s).count("E")
allw=n-alle
ecnt=wcnt=0
for i in range(n):
    if s[i] == "W":
        ans.append(wcnt+alle-ecnt)
        wcnt+=1
    else:
        ans.append(wcnt+alle-ecnt-1)
        ecnt+=1
print(min(ans))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
ans=[]
alle=list(s).count("E")
allw=n-alle
ecnt=wcnt=0
for i in range(n):
    ans.append(wcnt+alle-(i-wcnt+ecnt)
    if s[i] == "W":
        wcnt+=1
    else:
        ecnt+=1
print(min(ans))
Problem p03328 (python)

Fixed submission:
a,b = [int(i) for i in input().split(' ')]
n=b-a#13-8=5
N=n-1#5-1=4
x=(1/2*N)*(N+1)#2*5=10
y= x - a#10-8=2
print(int(y))

Buggy submission (verdict: Runtime Error):
 a,b = [int(i) for i in input().split(' ')]
 n=b-a
 N=n-1
 ans=(1/2*N)*(N+1)
 bns= ans - a
 print(bns)
Problem p03501 (python)

Fixed submission:
N,A,B=map(int, input().split())
if A*N<=B:
 print(A*N)
else:
 print(B)

Buggy submission (verdict: Runtime Error):
N=input()
T=0
for i in (N):
 T+=int(i)
if int(N)%T==0:
 print('Yes')
else:
 print('No')
Problem p03693 (python)

Fixed submission:
r,g,b=map(int, input().split())
if (r*100+g*10+b)%4==0:
 print ('YES')
else:
 print ('NO')

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(i) for i in input().split()]
b,c,d,e,f,g,h,j,k=0,0,0,0,0,0,0,0,0
for i in range(N):
 if (a[i]<400):
  b=1
 elif (a[i]<800):
  c=1
 elif ([i]<1200):
  d=1
 elif (a[i]<1600):
  e=1
 elif (a[i]<2000):
  f=1
 elif ([i]<2400):
  g=1
 elif (a[i]<2800):
  h=1
 elif (a[i]<3200):
  j=1
 else:
  k += 1
min=b+c+d+e+f+g+h+j
max=min+k
if min==0:
 min=1
print (min,max)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(i) for i in input().split()]
b,c,d,e,f,g,h,j,k=0,0,0,0,0,0,0,0,0
for i in range(N):
 if (a[i]<400):
  b=1
 elif (400<=a[i]<800):
  c=1
 elif (800<=a[i]<1200):
  d=1
 elif (1200<=a[i]<1600):
  e=1
 elif (1600<=a[i]<2000):
  f=1
 elif (2000<=a[i]<2400):
  g=1
 elif (2400<=a[i]<2800):
  h=1
 elif (2800<=a[i]<3200):
  j=1
 else:
  k += 1
min=b+c+d+e+f+g+h+j
max=min+k
if min==0:
 min=1
print (min,max)
Problem p03719 (python)

Fixed submission:
a,b,c=map(int, input().split())
if a<=c and c<=b:
 print ('Yes')
else:
 print('No')

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
list1=[]
for i in range (M):
    list1 += list(map(int,input().split()))
for j in range(1,N+1):
 print (list1.count(j))
Problem p03759 (python)

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

Buggy submission (verdict: Runtime Error):
O=str(input())
E=str(input())
m=max(len(O),len(E))
for i in range(m):
 if (i<len(O)):
  print (O[i], end=" ")
 if (i<len(E)):
  print(E[i], end=" ")
Problem p03778 (python)

Fixed submission:
W,a,b=map(int,input().split())
if (b-a-W>0):
 print (b-a-W)
elif (a-b-W>0):
 print(a-b-W)
else:
 print (0)

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

Fixed submission:

def abc_3() :
	H, W = map(int, input().split())
	print (min(div_3(H, W), div_3(W, H), div_s(H, W), div_s(W, H)))

def div_3(H, W) :
	w = W //3
	if w == 0 :
		return 10000000000
	if W % 3 == 0 :
		return 0
	else :
		return H

def div_s(H, W) :
	min_diff = 10000000000
	for w in range(1, W) :
		s1 = w * H
		s2 = (W - w) * (H // 2)
		s3 = W * H - s2 - s1
		diff = max(s1, s2, s3) - min(s1, s2, s3)
		if diff < min_diff :
			min_diff = diff
	return min_diff

#for i in range(5) :
#	abc_3()
#	print ('input:', end = '')
#	if input() == 'q' :
#		break

abc_3()

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

if x % 3 == 0 :
  print (0)
elif y % 3 == 0 :
  print (0)
else :
  if y > x :
    z = y
    y = x
    x = z

  a = int(x / 3) + 1
  if y % 2 == 0 :
    a = a - 1
    s = a * y
    #print (s)

    t = int((x - a) * y / 2)
    #print (t)
    if t > s :
      print (t - s)
    else
      print (s - t)
  else :
    s = a * y
    #print (s)

    x = x - a
  
    if y > x :
      z = y
      y = x
      x = z
  
    b = int(x / 2)
    t = b * y
    #print (t)

    print (s - t)
Problem p03719 (python)

Fixed submission:
b, c, d = map(int, input().split())
if b < c :
    if b <= d <= c :
        print('Yes')
    else :
        print('No')
else :
     if b <= d <= c :
        print('Yes')
     else :
        print('No')

Buggy submission (verdict: Runtime Error):
b, c, d = map(int, input().split())
if b < c :
    if b <= d <= c :
        print('Yes')
    else :
        print('No')
else :
     if b <= d <= c :
        print('Yes')
    else :
        print('No')
Problem p03962 (python)

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

Buggy submission (verdict: Runtime Error):
a = [int(i) for i in input().split()]
if a == b == c :
    print (1)
elif a == b or b == c :
    print (2)
else :
    print (3)
Problem p04029 (python)

Fixed submission:
a = int(input())
b = 0
 
for i in range(a + 1) :
    b = b + i
 
print(b)

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

for i in range(a)
    b = b * a

print(b)
Problem p04043 (python)

Fixed submission:
a = [int(i) for i in input().split()]
a.sort()
if a[0] == 5 and a[1] == 5 and a[2] == 7 :
    print('YES')
else :
    print('NO')

Buggy submission (verdict: Runtime Error):
a = [int(i) for i in input().split()]
a.sort()
if a[0] == 5 and a[1] == 5 and a[2] == 7 :
    print('YES')
else
    print('NO')
Problem p03337 (python)

Fixed submission:
line = input()
line = line.split()

A = int(line[0])
B = int(line[1])
print(max(A + B, A - B, A * B))

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

int count(char *s, char c, int N1, int N2)
{
  int i, num = 0;
  for (i = N1; i < N2; ++i)
  {
    if (s[i] == c) ++num;
  }
  return num;
}

int main()
{
  int N;
  scanf("%d", &N);
  char S[N];
  scanf("%s", S);

  int n_list[N];
  int j;
  for (j = 0; j < N: ++j)
  {
    n_list[j] = 0;
  }

  int num = 0;
  num += count(S, 'E', 1, N);
  n_list[0] = num;
  int i;
  for (i = 1; i < N - 2; ++i)
  {
    num = 0;
    num += count(S, 'W', 0, i-1);
    num += count(S, 'E', i+1, N);
    n_list[i] = num;
  }
  num = 0;
  num += count(S, 'W', 0, N-1);
  n_list[0] = num;

  num = 10;
  for (i = 0; i < N; ++i)
  {
    printf("%d\n", n_list[i]);
    if (n_list[i] < num) num = n_list[i];
  }

  printf("%d", num);
}

Buggy submission (verdict: Runtime Error):

  2 line = input()
  3 line = line.split()
  6
  7 A = int(line[0])
  8 B = int(line[1])
  9 print(max(A + B, A - B, A * B))
~
~
~
~
Problem p03338 (python)

Fixed submission:
N = int(input())
S = input()

s_list = list(set(S))
n_list = []

for i in range(1, N - 2):
    line1 = S[:i]
    line2 = S[i:]
    num = 0
    for c in s_list:
        _1 = line1.count(c)
        _2 = line2.count(c)
        if (_1 > 0 and  _2 > 0):
            num += 1
    n_list.append(num)

if (len(n_list) > 0):
    print(max(n_list))
else:
    print(0)

Buggy submission (verdict: Runtime Error):

N = int(input())
S = input()

s_list = list(set(S))
n_list = []

for i in range(1, N - 2):
    line1 = S[:i]
    line2 = S[i:]
    num = 0
    for c in s_list:
        _1 = line1.count(c)
        _2 = line2.count(c)
        if (_1 > 0 and  _2 > 0):
            num += 1
    n_list.append(num)
    
print(max(n_list))

Buggy submission (verdict: Runtime Error):

N = int(input())
S = input()

s_list = list(set(S))
n_list = []

for i in range(1, N - 1):
    line1 = S[:i]
    line2 = S[i:]
    num = 0
    for c in s_list:
        _1 = line1.count(c)
        _2 = line2.count(c)
        if (_1 > 0 and  _2 > 0):
            num += 1
    n_list.append(num)
    
print(max(n_list))

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

s_list = list(set(S))
n_list = []

for i in range(1, N - 1):
    line1 = S[:i]
    line2 = S[i:]
    num = 0
    for c in s_list:
        _1 = line1.count(c)
        _2 = line2.count(c)
        num += min(_1, _2)
    n_list.append(num)
    
print(max(n_list))
Problem p03328 (python)

Fixed submission:
a,b = map(int, input().split())
c = b - a
d = range(1, c, 1)
e = sum(d)
f = e - a
print(f)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
c = b - a
d = range(1, c, 1)
e = sum(d)
f = e - a
print(f)
Problem p03472 (python)

Fixed submission:
N, H = [int(i) for i in input().split()]
ken_a = 0
ken_b = []
for _ in range(N):
    a,b = input().split()
    if int(a) >= H or int(b) >= H:
        print(1)
        quit()
    if ken_a < int(a):
        ken_a = int(a)
    ken_b.append(int(b))
res = 0
for b_ in sorted(ken_b,reverse=True):
    if b_ > ken_a:
        H = H - b_
        res += 1
        if H <= 0:
            print(res)
            quit()

res = res + (H//ken_a)
if H%ken_a != 0:
    res += 1
print(res)

Buggy submission (verdict: Runtime Error):
N, H = [int(i) for i in input().split()]
ken_a = 0
ken_b = []
for _ in range(N):
    a,b = input().split()
    if a >= H or b >= H:
        print(1)
        quit()
    if ken_a < int(a):
        ken_a = int(a)
    ken_b.append(int(b))
res = 0
for b_ in ken_b:
    if b_ > ken_a:
        H = H - b_
        res += 1

res = res + (H//ken_a)
if H%ken_a != 0:
    res += 1
print(res)
Problem p03495 (python)

Fixed submission:
from collections import Counter
N,K = [int(i) for i in input().split()] 
A = [int(i) for i in input().split()]
counter = Counter(A)
ans = 0
counter_list = counter.most_common()[::-1]
if K < len(counter_list):
    for a in counter_list[:len(counter_list)-K]:
        ans += a[1]
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
N,K = [int(i) for i in input().split()] 
A = [int(i) for i in input().split()]
counter = Counter(A)
ans = 0
counter_list = counter.most_common()
if K > len(counter_list):
    while (K!=len(counter_list)):
        ans += counter_list[-1][1]
        counter_list = counter_list[:-1]

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
N,K = [int(i) for i in input().split()] 
A = [int(i) for i in input().split()]
counter = Counter(A)
ans = 0
counter_list = counter.most_common()
while (K!=len(counter_list)):
    ans += counter_list[-1][1]
    counter_list = counter_list[:-1]
    
print(ans)
Problem p03565 (python)

Fixed submission:
S1 = input()
T = input()

S1_r = S1[::-1]
T_r = T[::-1]
if len(S1) < len(T):
    print("UNRESTORABLE")
else:    
    for i in range(len(S1)-len(T)+1):
        flag1 = True
        flag2 = True
        for s,t in zip(S1_r[i:i+len(T)],T_r):
            if s == "?" or s == t:
                pass
            else:
                flag1 = False 
                break
        if flag1:
            flag2 = False
            S1_r = S1_r.replace(S1_r[i:i+len(T)],T_r,1)
            S_r = ["a" if s1 == "?" else s1 for s1 in S1_r]
            print("".join(S_r[::-1]))
            break
    if flag2:
        print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
S1 = input()
T = input()

if len(S1) < T:
    print("UNRESTORABLE")
    quit()

for i in range(len(S1)-len(T)+1):
    flag1 = True
    flag2 = True
    for s,t in zip(S1[i:i+len(T)],T):
        if s == "?" or s == t:
            pass
        else:
            flag1 = False 
            break
    if flag1:
        flag2 = False
        S1 = S1.replace(S1[i:i+len(T)],T)
        S = ["a" if s1 == "?" else s1 for s1 in S1]
        print("".join(S))
        break
if flag2:
    print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
S1 = input()
T = input()


for i in range(len(S1)-len(T)+1):
    flag1 = True
    flag2 = True
    for s,t in zip(S1[i:i+len(T)],T):
        if s == "?" or s == t:
            pass
        else:
            flag1 = False 
            break
    if flag1:
        flag2 = False
        S1 = S1.replace(S1[i:i+len(T)],T)
        S = ["a" if s1 == "?" else s1 for s1 in S1]
        print("".join(S))
        break
if flag2:
    print("UNRESTORABLE")
Problem p03578 (python)

Fixed submission:
from collections import Counter
N = input()
D = Counter([i for i in input().split()])
M = input()
T = Counter([i for i in input().split()])
for key, value in T.items():
    try:
        if D[key] < value:
            print("NO")
            break
    except:
        print("NO")
        break
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
N = input()
D = [i for i in input()]
M = input()
T = [i if i in D else "<muri>" for i in input()]

if "<muri>" in T:
    print("NO")
    quit()
for t in T:
    if d in D:
        D.remove(t)
    else:
        print("NO")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N = input()
D = [i for i in input()]
M = input()
T = [i if i in D else "<muri>" for i in input()]

if "<muri>" in T:
    print("NO")
    quit()
for t in T:
    if d in D:
        D.remove(t)
    else:
        print("NO")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N = input()
D = [i for i in input()]
M = input()
T = [i for i in input()]

for d in D:
    if t in T:
        T.remove(t)
    if len(T)==0:
        print("YES")
        quit()
print("NO")

Buggy submission (verdict: Runtime Error):
N = input()
D = [int(i) for i in input()]
M = input()
T = [int(i) for i in input()]

for t in T:
    try:
        D.remove(t)
    except:
        print("NO")
        quit()
print("YES")
Problem p03693 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 28 21:42:33 2016

@author: you
"""

n = list(map(int, input().split()))
l = n[0] * 100 + n[1] * 10 + n[2]
m = l % 4
if m == 0:
    ans = "YES"
else:
    ans = "NO"
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 28 21:42:33 2016

@author: you
"""

n = int(input())
a = list(map(int, input().split()))
a.sort()
colornum = 0
colorflag = [0,0,0,0,0,0,0,0]
rainbow = 0
maxvalue = 0
minvalue = 0
for i in range(n):
    if colorflag[0] == 0 and a[i] < 400:
        colornum = colornum + 1
        colorflag[0] = 1
    elif colorflag[1] == 0 and a[i] >= 400 and a[i] < 800:
        colornum = colornum + 1
        colorflag[1] = 1
    elif colorflag[2] == 0 and a[i] >= 800 and a[i] < 1200:
        colornum = colornum + 1
        colorflag[2] = 1
    elif colorflag[3] == 0 and a[i] >= 1200 and a[i] < 1600:
        colornum = colornum + 1
        colorflag[3] = 1
    elif colorflag[4] == 0 and a[i] >= 1600 and a[i] < 2000:
        colornum = colornum + 1
        colorflag[4] = 1
    elif colorflag[5] == 0 and a[i] >= 2000 and a[i] < 2400:
        colornum = colornum + 1
        colorflag[5] = 1
    elif colorflag[6] == 0 and a[i] >= 2400 and a[i] < 2800:
        colornum = colornum + 1
        colorflag[6] = 1
    elif colorflag[7] == 0 and a[i] >= 2800 and a[i] < 3200:
        colornum = colornum + 1
        colorflag[7] = 1
    elif a[i] >= 3200:
        rainbow = rainbow + 1
for j in range(8):
    if colorflag[j] == 1:
        minvalue = minvalue + 1
maxvalue = minvalue + rainbow
if minvalue == 0:
    minvalue = 1
    maxvalue = rainbow
print(minvalue,maxvalue)
Problem p03337 (python)

Fixed submission:
a,b = map(int,input().split())
temp = max(a+b,a-b)
print(max(temp,a*b))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
maxd = 0
for a in range(1,N-1):
    X = set([])
    Y = set([])
    for x in range(0,a):
        X.add(S[x])
    for y in range(a,N):
        Y.add(S[y])
    diffnum = len(X&Y)
    maxd = max(diffnum,maxd)
print(maxd)
Problem p03370 (python)

Fixed submission:
import math

N, X = map(int, input().split())
m = {}
num = 0


for i in range(N):
  m[i] = int(input())
  X = X - m[i]
  num += 1

print(math.floor(X / min(m[i] for i in m) + num))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
X = int(input())
m = {}
num = 0


for i in range(N):
  m[i] = int(input())
  X = X - m[i]
  num += 1

print(math.floor(X / min(m[i] for i in m) + num))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
X = int(input())
m = {}
num = 0


for i in range(N):
  m[i] = int(input())
  X = X - m[i]
  num += 1
  print(num)
  print(X)

print(math.floor(X / min(m[i] for i in m) + num))
Problem p03385 (python)

Fixed submission:
m = list(input())
if len(set(m)) == 3:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
m = list(map(int, input().split()))
A = m[0]
B = m[1]
K = m[2]

g = list(range(A, B+1))
if len(g) <= 2*K:
    for v in g:
        print(v)
else:
    for i in range(K):
        print(g[i])
    for i in range(len(g)-K, len(g)):
        print(g[i])