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

Fixed submission:
n=int(input())
m=int(n**0.5)
li=[0]*(10**4)
c=0
for i in range(1,m):
  for j in range(1,m):
    for k in range(1,m):
      if i*i+j*j+k*k+i*j+k*j+k*i<=n:
        li[i*i+j*j+k*k+i*j+k*j+k*i-1]+=1
for i in range(n):
  print(li[i])

Buggy submission (verdict: Runtime Error):
n=int(input())
m=int(n**0.5)
li=[0]*(10**4)
c=0
for i in range(1,m):
  for j in range(1,m):
    for k in range(1,m):
      li[i*i+j*j+k*k+i*j+k*j+k*i-1]+=1
for i in range(n):
  print(li[i])
Problem p02664 (python)

Fixed submission:
t=input()
n=len(t)
s=""
for i in range(n):
  if t[i]=="P":
    s+="P"
  else:
    s+="D"
print(s)

Buggy submission (verdict: Runtime Error):
t=input()
n=len(t)
s=""
for i in range(n):
  if p[i]=="P":
    s+="P"
  else:
    s+="D"
print(s)
Problem p02722 (python)

Fixed submission:
n=int(input())
N=[n]
import collections
def prime_factorize(n):
  a = []
  while n % 2 == 0:
    a.append(2)
    n //= 2
  f = 3
  while f * f <= n:
    if n % f == 0:
      a.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    a.append(n)
  return a
t=prime_factorize(n-1) # n-1の素因数
c = collections.Counter(t)
w=1
for i in c.values():
  w *= 1+i
w-=1
#print(w)
# wはn-1の約数の個数（1以外）

def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0 and i!=1:
      divisors.append(i)
      if i != n // i and n//i!=1:
        divisors.append(n//i)
  return divisors
t=make_divisors(n)+[n]

for i in t:
  n=N[0]
  while n%i==0:
    n//=i
  if n%i==1:
    w+=1
print(w)

Buggy submission (verdict: Runtime Error):
n=int(input())
N=[n]
import collections
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0 and i!=1:
      divisors.append(i)
      if i != n // i and n//i!=1:
        divisors.append(n//i)
  return divisors+[n]
t=make_divisors(n)+make_divisor(n-1)
ans=0
for k in t:
  n=N[0]
  while n>=k:
    if n%k==0:
      n//=k
    else:
      n-=k
  if n==1:
    ans+=1
print(ans)
Problem p02741 (python)

Fixed submission:
k=int(input())
a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[k-1])

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
if h%2==1 and w%2==1:
  a1=((h+1)//2)*(w+1)//2
  a2=(h//2)*(w//2)
  print(a1+a2)
else:
  print((h*w)//2)
Problem p02761 (python)

Fixed submission:
n,m=map(int,input().split())
sc=[list(map(int,input().split())) for i in range(m)]
# 全探索
if n==1:
  for i in range(10):
    memo=0
    for li in sc:
      if str(i)[li[0]-1]!=str(li[1]):
        break
      else:
        memo+=1
    if memo==m:
      print(i)
      exit()
  print("-1")
elif n==2:
  for i in range(10,100):
    memo=0
    for li in sc:
      if str(i)[li[0]-1]!=str(li[1]):
        break
      else:
        memo+=1
    if memo==m:
      print(i)
      exit()
  print("-1")
else:
  for i in range(100,1000):
    memo=0
    for li in sc:
      if str(i)[li[0]-1]!=str(li[1]):
        break
      else:
        memo+=1
    if memo==m:
      print(i)
      exit()
  print("-1")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
sc=[]
for i in range(m):
  q=list(map(int,input().split()))
  if q not in sc:
    sc.append(q)
slist=[i[0] for i in sc]
if len(slist)!=len(set(slist)):
  print("-1")
  exit()
if n!=1 and [1,0] in sc:
  print(-1)
  exit()
if n==1 and sc == [[1,0]]:
  print(0)
  exit()

sc.sort()
num=""
k=0
sc.append(n+1)
for i in range(1,n+1):
  if sc[k][0]==i:
    num += str(sc[k][1])
    k+=1
  else:
    if i==1:
      num+="1"
    else:
      num += "0"
print(int(num))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
sc=[]
for i in range(m):
  q=list(map(int,input().split()))
  if q not in sc:
    sc.append(q)
slist=[i[0] for i in sc]
if len(slist)!=len(set(slist)):
  print("-1")
  exit()
if n!=1 and [1,0] in sc:
  print(-1)
  exit()

sc.sort()
num=""
k=0
sc.append(n+1)
for i in range(1,n+1):
  if sc[k][0]==i:
    num += str(sc[k][1])
    k+=1
  else:
    if i==1:
      num+="1"
    else:
      num += "0"
print(int(num))
Problem p02796 (python)

Fixed submission:
n=int(input())
xl=[list(map(int,input().split())) for i in range(n)]
xl=[i+[i[0]-i[1],i[0]+i[1]] for i in xl] # [point,arm,left,right]
xl.sort(key=lambda x: x[3])
i=0
ans=n
while i<len(xl)-1:
  if xl[i][-1]>xl[i+1][2]:
    del xl[i+1]
    ans-=1
  else:
    i+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
xl = [list(map(int,input().split())) for i in range(n)]
xl.sort()
def OK(list):
  for i in range(n-1):
    if list[i][0]+list[i][1] > list[i+1][0]-list[i+1][1]:
      return False
  return True

while OK(xl)==False:
  r=len(xl)
  memo=[0]*r
  for i in range(r-1):
    if memo[i]==0 and xl[i][0]+xl[i][1]>xl[i+1][0]-xl[i+1][1]:
      memo[i+1] += 1
  for i in range(r):
    if memo[r-1-i]==1:
      del xl[r-1-i]
print(len(xl))
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
 
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans = ans + 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(input().split())
 
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans = ans + 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for i in range(N)]
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d[i] * d[j]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split()))
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d[i] * d[j]
print(sum)
Problem p02886 (python)

Fixed submission:
N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for i in range(N)]
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range(i+1):
        sum = sum + d[i] * d[j]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range range(i):
        sum = sum + d[i+1] * d[j+1]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d[i] * d[j]
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
d_(i+1) = [ int(input()) for i in range(N)]
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d_i * d_j
print(sum)
Problem p02887 (python)

Fixed submission:
N = int(input())
S = input()
 
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans = ans + 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(input().split())
 
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans = ans + 1
print(ans)
Problem p02898 (python)

Fixed submission:
N,K = map(int, input().split())
h = list(map(int, input().split()))
 
num =0
for i in range(N):
    if h[i]>K or h[i] == K:
        num =num+ 1
print(num)

Buggy submission (verdict: Runtime Error):
N = int(input()) K = int(input())
h = list(map(int, input().split()))
 
num =0
for i in range(N):
    if h[i]>K or h[i] == K:
        num =num+ 1
print(num)

Buggy submission (verdict: Runtime Error):
N = int(input()), K = int(input())
h = list(map(int, input().split()))
 
num =0
for i in range(N):
    if h[i]>K or h[i] == K:
        num =num+ 1
print(num)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
h = list(map(int, input().split()))
 
num =0
for i in range(N):
    if h[i]>K or h[i] == K:
        num =num+ 1
print(num)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
h = list(map(int, input().split()))

num =0
for i in range(N):
    if h[i]>K or h[i] == K:
        num += 1
print(num)
Problem p02899 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
li=[0]*n
for i in range(n):
  li[a[i]-1] += i+1
for i in range(n):
  li[i]=str(li[i])
print(" ".join(li))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
li=[0]*n
for i in range(n):
  li[a[i]-1] += i+1
print(" ".join(li))
Problem p02909 (python)

Fixed submission:
s = input()
if s == 'Sunny':
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
s = input()
if s = 'Sunny':
  print("Cloudy")
elif s = "Cloudy":
  print("Rainy")
else:
  print("Sunny")
Problem p02923 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
li=[0]
while len(h)>1:
  for i in range(len(h)):
    if i==len(h)-1:
      li += [len(h)-1]
      del h[1:]
    elif h[i]<h[i+1]:
      li += [len(h[0:i+1])-1]
      del h[0:i+1]
      break
print(max(li))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
li=[]
for i in range(n-1):
  if h[i]<h[i+1] or i==n-2:
    s=i-sum(li)
    li = li + [s]
print(max(li))
Problem p02952 (python)

Fixed submission:
n=int(input())
if n<10:
  print(n)
if 9<n<100:
  print(9)
if 99<n<1000:
  print(n-90)
if 999<n<10000:
  print(909)
if 9999<n<100000:
  print(n-9090)
if n==100000:
  print(90909)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans
if n<10:
  print(n)
if 9<n<100:
  print(9)
if 99<n<1000:
  print(n-90)
if 999<n<10000:
  print(909)
if 9999<n:
  print(n-9090)
Problem p02953 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
for i in range(n-1):
  if h[n-2-i]-1>h[n-1-i]:
      print('No')
      exit()
  elif h[n-2-i]-1==h[n-1-i]:
      h[n-2-i]=h[n-2-i]-1
print('Yes')

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
for i in range(n-1):
  if h[n-2-i]-1>h[n-1-i]:
      print('No')
      exit()
  elif h[n-2-i]-1=h[n-1-i]:
      h[n-2-i]=h[n-2-i]-1
print('Yes')
Problem p02971 (python)

Fixed submission:
n=int(input())
a=[ int(input()) for i in range(n)]

b=sorted(a)

for i in range(n):
  if a[i] != b[-1]:
    print(b[-1])
  else:
    print(b[-2])

Buggy submission (verdict: Runtime Error):
n=int(input())
a = [int(input()) for i in range(n)]
for i in range(n):
  b=a
  del b[i]
  print(max(b))
Problem p02983 (python)

Fixed submission:
l,r=map(int,input().split())
if r-l>=2019:
  print(0)
else:
  a=2019
  for i in range(l,r):
    for j in range(i+1,r+1):
      a=min((i%2019)*(j%2019)%2019,a)
  print(a)

Buggy submission (verdict: Runtime Error):
l,r=map(int,input().split())
if r-l>=2019:
  print(0)
else:
  a=2019
  for i in range(l,r):
    for j in range(i+1,r+1):
      a=min((i%2019)*(j%2019)%2019,a)
print(a)

Buggy submission (verdict: Runtime Error):
l,r=map(int,input().split())
if r-l>=2019:
  print(0)
else:
  a=2019
  for i in range(l,r):
    for j in range(i+1,r+1):
      if i==l and j==i+1:
        a=min((i%2019)*(j%2019)%2019,a)
print(a)

Buggy submission (verdict: Runtime Error):
l,r=map(int,input().split())
if r-l>=2019:
  print(0)
else:
  a=2019
  for i in range(l,r):
    for j in range(i+1,r+1):
      if i==l and j=i+1:
        a=min((i%2019)*(j%2019)%2019,a)
print(a)
Problem p02993 (python)

Fixed submission:
s=input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
s=input()
if s[0]==s[1] or s[1]==s[2] or s[2]=-s[3]:
  print("Bad")
else:
  print("Good")
Problem p03024 (python)

Fixed submission:
s=input()
n=len(s)
now=0
for i in range(n):
  if s[i]=="o":
    now+=1
if now + 15 - n >= 8:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
s=int(input())
n=len(s)
now=0
for i in range(n):
  if s[i]=="o":
    now+=1
if now + 15 - n >= 8:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
s=int(input())
n=len(s)
now=0
for i in range(n):
  if s[i]=="o":
    now+=1
if now<n-7:
  print("NO")
else:
  print("YES")
Problem p03071 (python)

Fixed submission:
a,b=map(int,input().split())

if a==b:
  print(a+b)
elif a>b:
  print(2*a-1)
else:
  print(2*b-1)

Buggy submission (verdict: Runtime Error):
a,b=map(int,iput().split())

if a>b or a==b:
  print(2*a-1)
else:
  print(2*b-1)
Problem p03109 (python)

Fixed submission:
s=input()
a=list(map(int,s.split("/")))
if a[0]<2019:
  print("Heisei")
  exit()
if a[0]==2019 and a[1]<=4:
  print("Heisei")
  exit()
print("TBD")

Buggy submission (verdict: Runtime Error):
s=input()
if int(s[:4])<2019:
  print("Heisei")
  exit()
if int(s[:4])=2019 and int(s[5])<=4:
  print("Heisei")
  exit()
print("TBD")
Problem p03125 (python)

Fixed submission:
a,b=map(int,input().split())
if b%a == 0:
  print(a+b)
else:
  print(b-a)

Buggy submission (verdict: Runtime Error):
a,b=int(input())
if b%a == 0:
  print(a+b)
else:
  print(b-a)
Problem p03140 (python)

Fixed submission:
n=int(input())
a=input()
b=input()
c=input()
ans=0
for i in range(n):
  m=len(set([a[i],b[i],c[i]]))
  ans+=m-1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=input()
b=input()
c=input
ans=0
for i in range(n):
  m=len(set([a[i],b[i],c[i]]))
  ans+=m-1
print(ans)
Problem p03239 (python)

Fixed submission:
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ct=[i for i in ct if i[1]<=t]
if len(ct)==0:
  print("TLE")
  exit()
ct.sort()
print(ct[0][0])

Buggy submission (verdict: Runtime Error):
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ct=[i for i in ct if i[1]<=t]
ct.sort()
print(ct[0][0])
Problem p03264 (python)

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

Buggy submission (verdict: Runtime Error):
k=int(input())
if n%2==0:
  print(k*k//4)
else:
  print((k+1)*(k-1)//4)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2==0:
  print(k*k//4)
else:
  print((k+1)*(k-1)//4)
Problem p03338 (python)

Fixed submission:
n=int(input())
s=input()
ans=0
for i in range(1,n):
  s1=s[:i]
  s2=s[i:]
  li1=set([s1[j] for j in range(len(s1))])
  li2=set([s2[j] for j in range(len(s2))])
  ans = max(ans,len(li1 & li2))
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
ans=0
for i in range(1,n):
  s1=s[:i]
  s2=s[i:]
  li1=set([s1[j] for j in range(s1)])
  li2=set([s2[j] for j in range(s2)])
  ans = max(ans,len(li1 & li2))
print(ans)
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if abs(a-c)<=d or (abs(a-b)<=d and abs(b-c)<=d):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if abs(a,c)<=d or (abs(a,b)<=d and abs(b,c)<=d):
  print("Yes")
else:
  print("No")
Problem p03352 (python)

Fixed submission:
x=int(input())
li=[]
for i in range(32):
  for j in range(2,6):
    if pow(i,j)<=x:
      li.append(pow(i,j))
print(max(li))

Buggy submission (verdict: Runtime Error):
x=int(input())
prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
li=[]
def f(n):
  c=0
  while x%n==0:
    x //= n
    c+=1
  return c
ans=0
for p in prime:
  ans = max(ans,f(p))
print(ans)
Problem p03400 (python)

Fixed submission:
n=int(input())
d,x=map(int,input().split())
a=[int(input()) for i in range(n)]
eaten = [((d-1)//a[i])+1 for i in range(n)]
print(sum(eaten)+x)

Buggy submission (verdict: Runtime Error):
n=int(input())
d,x=map(int,input().split())
a=[int(input()) for i in range(n)]
eaten = [((d-1)//a[i])+1 for i in range(n)]
print(sun(eaten)+x)
Problem p03407 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a+b>=c:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input())
if a+b>=c:
  print("Yes")
else:
  print("No")
Problem p03502 (python)

Fixed submission:
n=int(input())
def f(k):
  m=len(str(k))
  a=0
  for i in range(m):
    a+=int(str(k)[i])
  return a
if n%f(n)==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
def f(k):
  m=len(str(k))
  a=0
  for i in range(m):
    a+=str(k)[i]
  return a
if n%f(n)==0:
  print("Yes")
else:
  print("No")
Problem p03565 (python)

Fixed submission:
s=input()
t=input()
n=len(s)
m=len(t)
li=[]
for i in range(n-m+1):
  u=s[i:i+m]
  c=0
  for j in range(m):
    if u[j]!="?" and u[j]!=t[j]:
      c=1
      break
  if c==0:
    if i==0:
      v=t+s[i+m:]
    elif i==n-m:
      v=s[:i]+t
    else:
      v=s[:i]+t+s[i+m:]
    for k in range(n):
      if v[k]=="?":
        v=v[:k]+"a"+v[k+1:]
    li.append(v)
if li==[]:
  print("UNRESTORABLE")
else:
  li.sort()
  print(li[0])

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
n=len(s)
m=len(t)
li=[]
for i in range(n-m+1):
  u=s[i:i+m]
  c=0
  for j in range(m):
    if u[j]!="?" and u[j]!=t[j]:
      c=1
      break
  if c==0:
    if i==0:
      v=t+s[i+m]
    elif i==n-m:
      v=s[:i]+t
    else:
      v=s[:i]+t+s[i+m]
    for k in range(n):
      if v[k]=="?":
        v=v[:k]+"a"+v[k+1:]
    li.append(v)
if li==[]:
  print("UNRESTORABLE")
else:
  li.sort()
  print(li[0])

Buggy submission (verdict: Runtime Error):
=input()
t=input()
n=len(s)
m=len(t)
li=[]
for i in range(n-m+1):
  u=s[i:i+m]
  c=0
  for j in range(m):
    if u[j]!="?" and u[j]!=t[j]:
      c=1
      break
  if c==0:
    if i==0:
      v=t+s[i+m]
    elif i==n-m:
      v=s[:i]+t
    else:
      v=s[:i]+t+s[i+m]
    for k in range(n):
      if v[k]=="?":
        v=v[:k]+"a"+v[k+1:]
    li.append(v)
if li==[]:
  print("UNRESTORABLE")
else:
  li.sort()
  print(li[0])
Problem p03606 (python)

Fixed submission:
n=int(input())
lr=[list(map(int,input().split())) for i in range(n)]
ans=0
for i in lr:
  ans += i[1]-i[0]+1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
lr=[list(map(int,input().split())) for i in range(n)]
ans=0
for i in lr:
  ans += r-l+1
print(ans)
Problem p03607 (python)

Fixed submission:
n=int(input())
li=[int(input()) for i in range(n)]
import collections
a=collections.Counter(li)
b=a.most_common()
ans=0
for i in range(len(b)):
  if b[i][1]%2==1:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
li=[0]*((10**9)+1)
ans=0
for i in range(n):
  a=int(input())
  if li[a]==0:
    li[a]=1
    ans += 1
  else:
    li[a]=0
    ans -= 1
print(ans)
Problem p03611 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=a.copy()
for i in a:
  b.append(i-1)
  b.append(i+1)
import collections
c=collections.Counter(b)
d=c.most_common()
print(d[0][1])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=a.copy()
for i in a:
  b.append(i-1)
  b.append(i+1)
import collection
c=collection.Counter(b)
d=c.most_common()
print(d[0][1])
Problem p03624 (python)

Fixed submission:
s=input()
alphabet = set([chr(i) for i in range(97, 97+26)])
x=set([s[i] for i in range(len(s))])
y=alphabet - x
if len(y)==0:
  print("None")
  exit()
z=list(y)
z.sort()
print(z[0])

Buggy submission (verdict: Runtime Error):
s=input()
alphabet = set([chr(i) for i in range(97, 97+26)])
x=set([s[i] for i in range(len(s))])
y=alphabet - x
z=list(y)
z.sort()
print(z[0])
Problem p03637 (python)

Fixed submission:
from numpy import log
def f(k):
  c=0
  while k % 2 == 0:
    k //= 2
    c+=1
    if c==2:
      break
  return c
def g(k):
  return f(int(k))
n=int(input())
a=list(map(g,input().split()))
ct0=a.count(0)
ct1=a.count(1)
ct2=a.count(2)
if ct0 <= ct2 or (ct0 == ct2 + 1 and ct1==0):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
from numpy import log
def f(k):
  c=0
  while k % 2 == 0:
    k //= 2
    c+=1
    if c==2:
      break
  return c
def g(k):
  return f(int(k))
n=int(input())
a=list(map(g,input().split()))
a.sort()
ct0=a.count(0)
ct1=a.count(1)
ct2-a.count(2)
if ct0 > ct2:
  print("No")
else:
  print("Yes")
Problem p03693 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
li = [0]*9
for i in a:
  if i < 400:
    li[0]+=1
  elif i < 800:
    li[1]+=1
  elif i < 1200:
    li[2]+=1
  elif i < 1600:
    li[3]+=1
  elif i < 2000:
    li[4]+=1
  elif i < 2400:
    li[5]+=1
  elif i<2800:
    li[6]+=1
  elif i<3200:
    li[7]+=1
  else:
    li[8]+=1
li_ = [i for i in li[:-1] if i>0]
num = len(li_)
if num==0:
  print(1,n)
else:
  print(num, num + li[-1])
Problem p03730 (python)

Fixed submission:
from fractions import gcd
a,b,c=map(int,input().split())
d=gcd(a,b)
if c%d==0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b,c=map(int,input().split())
d=gcd(a,b)
if c%d==0:
  print("YES")
else:
  print("NO")
Problem p03773 (python)

Fixed submission:
a,b=map(int,input().split())
print((a+b)%24)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
print((a+b)%24)
Problem p03854 (python)

Fixed submission:
s=input()
while len(s)>0:
  #初めがdreamの場合
  if s[:5]=="dream" and (len(s)==5 or s[5]=="d" or s[5:8]=="era"):
    s=s[5:]
  elif s[:7]=="dreamer" and (len(s)==7 or s[7]=="d" or s[7]=="e"):
    #初めがdreamerの場合
    s=s[7:]
  elif s[:5]=="erase" and (len(s)==5 or s[5]=="d" or s[5]=="e"):
    #初めがeraseの場合
    s=s[5:]
  elif s[:6]=="eraser" and (len(s)==6 or s[6]=="d" or s[6]=="e"):
    s=s[6:]
  else:
    print("NO")
    exit()
print("YES")

Buggy submission (verdict: Runtime Error):
s=input()
while len(s)>0:
  #初めがdreamの場合
  if s[:5]=="dream" and (len(s)==5 or s[5]=="d" or d[5:8]=="era"):
    s=s[5:]
  elif s[:7]=="dreamer" and (len(s)==7 or s[7]=="d" or s[7]=="e"):
    #初めがdreamerの場合
    s=s[7:]
  elif s[:5]=="erase" and (len(s)==5 or s[5]=="d" or s[5]=="e"):
    #初めがeraseの場合
    s=s[5:]
  elif s[:6]=="eraser" and (len(s)==6 or s[6]=="d" or s[6]=="e"):
    s=s[6:]
  else:
    print("NO")
    exit()
print("YES")
Problem p03909 (python)

Fixed submission:
h,w=map(int,input().split())
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"]
for i in range(h):
  s=list(map(str,input().split()))
  for j in range(w):
    if s[j]=="snuke":
      print(alphabet[j]+str(i+1))

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
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"]
for i in range(h):
  s=list(map(str,input().split()))
  for j in range(w):
    if s[i]=="snuke":
      print(alphabet[j]+str(i+1))