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

Fixed submission:
N = int(input())
p = [int(i) for i in input().split()]
ans = 0
for i in range(N):
    if i+1 == p[i]:
        if i == N-1:
            l = p[i]
            k = p[i-1]
            p[i] = k
            p[i-1] = l
            ans +=1
        if i != N-1:
            l = p[i]
            k = p[i+1]
            p[i] = k
            p[i+1] = l
            ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = [int(i) for i in input().split()]
ans = 0
for i in range(N):
    if i+1 == p[i]:
        if i == N-1:
            l = p[i]
            k = l[i-1]
            p[i] = k
            p[i-1] = l
            ans +=1
        else:
            l = p[i]
            k = p[i+1]
            p[i] = k
            p[i+1] = l
            ans +=1
print(ans)
Problem p03673 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ki=[]
gu=[]
for i in range(n):
  if i%2:
    ki.append(a[i])
  else:
    gu.append(a[i])
#print(ki,gu)
if n%2==0:
  ki.reverse()
  ki.extend(gu)
  print(*ki)
else:
  gu.reverse()
  gu.extend(ki)
  print(*gu)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
if n % 2 == 0 :
    le = [0] * n // 2
    lo = [0] * n // 2
    counte = 0
    counto = 0
    for i in range(n) :
        if i % 2 == 0 :
            lo[counto] = a[i]
            counto+=1
        else :
            le[counte] = a[i]
            counte +=1
    le.reverse()
    l = le + lo
    S = ' '.join(l)
    print(S)
else :
    l = [a[0]]
    for i in range(1,n) :
        if i % 2 == 1 :
            l.append(a[i])
        else :
            l.insert(0,a[i])
    S = ' '.join(l)
    print(S)
Problem p02553 (python)

Fixed submission:
l=list(map(int, input().split()))
l1=[l[0],l[1]]
l2=[l[2],l[3]]
ans=l[0]*l[2]
for i in l1:
  for j in l2:
    if i*j>ans:
      ans=i*j
print(ans)

Buggy submission (verdict: Runtime Error):
import itertool
a,b,c,d=int(input().split())
l=[a,b,c,d]
c=itertools.combinations(l,2)
ans=a*b
for i in c:
  if i[0]*i[1]>ans:
    ans=i[0]*i[1]
print(ans)
Problem p02702 (python)

Fixed submission:
s=input()
n=len(s)
a=[0]*2019
a[0]=1
k=0
ans=0
mod=1
for i in range(n-1,-1,-1):
  k=(k+int(s[i])*mod)%2019
  mod=(mod*10)%2019
  a[k]+=1
for i in a:
  ans+=i*(i-1)*0.5

print(int(ans))

Buggy submission (verdict: Runtime Error):
s=int(input())
n=len(str(s))
a=[0]*2019
ans=0
k=s%2019
a[k]+=1
for i in range(n):
  s=int(s*0.1)
  k=s%2019
  a[k]+=1
for i in range(2019):
  ans+=a[i]*(a[i]-1)/2

print(int(ans))

Buggy submission (verdict: Runtime Error):
s=int(input())
n=len(str(s))
a=[0]*2019
a[0]=1
ans=0
k=s%2019
a[k]+=1
for i in range(n):
  s=int(s*0.1)
  k=s%2019
  a[k]+=1
for i in range(2019):
  ans+=a[i]*(a[i]-1)/2

print(int(ans))

Buggy submission (verdict: Runtime Error):
import math
s=int(input())
n=len(str(s))
ans=0
if n>=4:
  for i in range(n-3):
    for j in range(i+3,n):
      k=math.floor((s%10**(n-i))/10**(n-j-1))
      if k%2019==0:
        ans+=1
print(ans)
Problem p02786 (python)

Fixed submission:
H=int(input())
a=1
ans=0
while True:
  if a>H:
    break
  ans=ans+a
  a=a*2
 
print(ans)

Buggy submission (verdict: Runtime Error):
H=int(input())
a=1
ans=1
while True:
  if a>H:
    break
   ans=ans+a
  a=a*2

print(ans)
Problem p02789 (python)

Fixed submission:
N,M=map(int,input().split())
if N==M:
  ans="Yes"
else:
  ans="No"
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=int(input())
if N==M:
  ans="Yes"
else:
  ans="No"
print("ans")
Problem p02898 (python)

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

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

Fixed submission:
s=input()

if s=="Sunny":
  a="Cloudy"
elif s=="Cloudy":
  a="Rainy"
else:
  a="Sunny"
  
print(a)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
t=0
while True:
  maxi=A[0]
  if len(A)>1 :
    maxi_2=A[1]
    t+=1
    maxi=maxi//2
    if t==M :
      A[0]=maxi
      break
    elif maxi_2>maxi :
      A[0]=maxi_2
      A[1]=maxi
      for i in range(1,N):
        if A[i]<A[i+1]:
          A[i]=A[i+1]
          A[i+1]=maxi
        else:
          break     
      continue
    else:
      continue
  else :
    maxi=maxi//(2**M)
    A[0]=maxi
    break

amount=sum(A)
print(amount)

Buggy submission (verdict: Runtime Error):
L=list(map(int,input().split()))
N=L[0]
K=L[1]
Q=L[2]
point=[K-Q]*N
for i in range(Q):
  ans=int(input())
  point[ans-1]+=1
for i in range(N):
  if point[i]>0 :
    print("Yes")
  else:
    print("No")
Problem p02945 (python)

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

c=a+b
if c<a-b :
  c=a-b
if c<a*b :
  c=a*b
print(c)

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

c=a+b
if c<a-b :
  c=a-b
if c<ab :
  c=ab
print(c)
Problem p02947 (python)

Fixed submission:
n = int(input())
s = [input()for _ in range(n)]

for i in range(n):
    s[i] = ''.join(sorted(s[i]))

s.sort()

ans = 0
count = 0

for i in range(1, n):
    if count == 0:
        if s[i] == s[i-1]:
            count = 2
    else:
        if s[i] == s[i-1]:
            count += 1
        else:
            ans += count * (count - 1) // 2
            count = 0

ans += count * (count - 1) // 2

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
word=[]
for i in range(N):
  word.append(input())
  
alphalist=["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"]
numlist=[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]


alphalist=[]
alpha=[[] for i in range(N)]
for i in range(N):
  word0=word[i]
  for v in range(10):
    alpha[i].append(word0[i])
  alpha[i].sort()
  alphalist.append(alpha[i])


number=0
for i in range(N):
  freq=alphalist.count(alphalist[i])
  if freq!=1:
    number0=(freq*(freq-1))/2
    number0=number0/freq
    number+=number0
  
print(int(number))
Problem p02582 (python)

Fixed submission:
s = input()

cnt = 0
L = []
for i in s:
    if i == "R":
        cnt += 1
    else:
        L.append(cnt)
        cnt = 0
L.append(cnt)
print(max(L))

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

cnt = 0
L = []
for i in s:
    if i == "R":
        cnt += 1
    else:
        L.append(cnt)
        cnt = 0

print(max(L))
Problem p02628 (python)

Fixed submission:
n, k = map(int, input().split())
l = sorted(list(map(int, input().split())))

ans = 0
for i in range(k):
    ans += l[i]

print(ans)

Buggy submission (verdict: Runtime Error):
import math 
n = int(input())
print(math.ceil(n/ 1000) * 1000 - n)
Problem p02719 (python)

Fixed submission:
n, k = map(int, input().split())
print(min(k - n % k, n % k))

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

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

cnt = gcd(n, k)

if n == 1 or k == 1:
    print(0)
else:
    a = max((n % k, k % n))
    print(min(a, gcd(n, k)))
Problem p02732 (python)

Fixed submission:
from collections import Counter

n = int(input())
l = list(map(int, input().split()))
cl = Counter(l)


cnt = 0
for v in cl.values():
    cnt += v * (v - 1) // 2 

for i in l:
    v = cl[i]
    ans = cnt - (v * (v - 1) // 2) + (v - 1) * (v - 2) // 2
    print(ans)

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


for i in range(len(a)):
    rem_k = a[:i] + a[i + 1:]
    # print(len(set(rem_k))) # 同一が2個以上のものを抽出してset
    cho = []
    for j in rem_k:
        if rem_k.count(j) >= 2:
            cho.append(j)
    # print(rem_k)
    for i in cho:
        if rem_k.count(i) - 2 < 0:
            ans = 0
        else:
            ans =  math.factorial(rem_k.count(i)) // (math.factorial(rem_k.count(i) - 2) * math.factorial(2))

    print(ans)
Problem p02765 (python)

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

if n >= 10:
    print(r)
else:
    print(r + (100 * (10 - n)))

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

k = round(sum(l) / n)
ans = 0
for i in l:
    ans += (k - i) ** 2

print(ans)
Problem p03086 (python)

Fixed submission:
S = input()

L = []
cnt = 0
for i in S:
  if i == "A" or i == "C" or i == "G" or i == "T":
    cnt += 1
  else:
    L.append(cnt)
    cnt = 0

L.append(cnt)

if len(L) == 0:
	print(0)
else:
	print(max(L))

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

L = []
cnt = 0
for i in S:
  if i == "A" or i == "C" or i == "G" or i == "T":
    cnt += 1
  else:
    L.append(cnt)
    cnt = 0
    
print(max(L))
Problem p03087 (python)

Fixed submission:
N, Q = list(map(int, input().split()))
s = input()
lr = [list(map(int, input().split())) for i in range(Q)]

L = [0] * (N + 1)

for i in range(N - 1):
  if s[i] == "A" and s[i + 1] == "C":
      L[i + 1] = 1 + L[i]
  else:
      L[i + 1] = L[i]


for i in range(Q):
    print(L[lr[i][1] - 1] - L[lr[i][0] - 1])

Buggy submission (verdict: Runtime Error):
N, Q = list(map(int, input().split()))
s = input()
lr = [list(map(int, input().split())) for i in range(Q)]

L = [0] * (N + 1)

for i in range(len(s)):
  if s[i] == "A" and s[i + 1] == "C":
      L[i + 1] = 1 + L[i]
  else:
      L[i + 1] = L[i]


for i in range(Q):
    print(L[lr[i][1] - 1] - L[lr[i][0] - 1])
Problem p03280 (python)

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

print(A * B - (A + B) + 1)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

print(A * B - (A + B) + 1)
Problem p03281 (python)

Fixed submission:
N = int(input())

ans = 0
for i in range(1, N + 1, 2):
    cnt = 0
    for j in range(1, i + 1):
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
        cnt = 0
    
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy

N = int(input())

cnt = 0
for i in range(1, N + 1, 2):
    if len(sympy.divisors(i)) == 8:
        cnt += 1

print(cnt)
Problem p03292 (python)

Fixed submission:
L = list(map(int,input().split()))
ans = 0
min_L = min(L)
L.remove(min_L)
cnt = min_L
sorted_L = sorted(L)
for i in sorted_L:
    ans += abs(i - cnt )
    cnt = i
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [int(i) for i in input().split()]
print(sum(L - N) )
Problem p03294 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [int(i) for i in input().split()]
print(sum(L - N) )
Problem p03352 (python)

Fixed submission:
N = int(input())
cnt = [1]
for i in range(1,N + 1):
    for j in range(2,N + 1):
        if i ** j <= N:
            cnt.append(i ** j)
        else:
            break
    
print(max(cnt))

Buggy submission (verdict: Runtime Error):
N = int(input())
cnt = []
for i in range(1,N + 1):
    for j in range(2,N + 1):
        if i ** j <= N:
            cnt.append(i ** j)
    
print(max(cnt))
Problem p03385 (python)

Fixed submission:
# coding: utf-8
import re
S = input()
find_a = re.findall("a",S)
find_b = re.findall("b",S)
find_c = re.findall("c",S)
if find_a and find_b and find_c:
    print("Yes")
else:
    print("No")

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

if (b - a + 1) > 2 * k:
    for i in range(a,a + k):
        print(i)
    for i in range(b - k + 1,b + 1):
        print(i)
else:
    for i in range(a,b + 1):
        print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
li = list(range(a,b + 1))
if (b - a + 1) > 2 * k:
    for i in li[:k]:
        print(i)
    for i in li[-k:]:
        print(i)
else:
    for i in li:
        print(i)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
import re
S = input()
find_a= re.findall("a")
find_b = re.findall("b")
find_c = re.findall("c")
if find_a and find_b and find_c:
    print("Yes")
else:
    print("No")
Problem p03386 (python)

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

if (b-a+1) > 2*k:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)
else:
    for i in range(a,b+1):
        print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
li = list(range(a,b + 1))
if (b - a + 1) > 2 * k:
    for i in range(a,a + k):
        print(i)
    for i in range(b - k + 1,b + 1):
        print(i)
else:
    for i in li:
        print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
li = list(range(a,b + 1))
if b - a + 1 > 2 * k:
    for i in li[:k]:
        print(i)
    for i in li[-k:]:
        print(i)
else:
    for i in li:
        print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
li = list(range(a,b+1))
if b - a + 1 >= 2 * k:
    for i in li[:k]:
        print(i)
    for i in li[-k:]:
        print(i)
else:
    for i in li:
        print(i)

Buggy submission (verdict: Runtime Error):
def solve(): 
    a,b,k = map(int,input().split())
    li = list(range(a,b+1))
    if b - a + 1 >= 2 * k:
        for i in li[:k]:
            print(i)
        for i in li[-k:]:
            print(i)
    else:
        for i in li:
            print(i)
            
if __name __ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
li = list(range(A,B+1))

from_A = li[0:K]
to_B = li[-K::]

sum_li  = list(set(from_A + to_B))

for i in sum_li:
    print(i)

Buggy submission (verdict: Runtime Error):
#coding utf-8
A,B,K= map(int,input().split())
y = list(range(A,B + 1))
for i in y[0:K]:
    print(i)

for i in y[-K-1:-1]:
    print(i)

Buggy submission (verdict: Runtime Error):
#coding utf-8
A,B,K= map(int,input().split())
y = list(range(A,B + 1))
for i in y[0:K]:
    print(i)

for i in y[-1:-K-1:-1]:
    print(i)

Buggy submission (verdict: Runtime Error):
#coding utf-8
A,B,K= map(int,input().split())
y = list(range(A,B + 1))
#for i in y[0:K]:
  #  print(i)

print(y[-1:-K-1:-1])
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("Even")
eles:
    print("Odd")
Problem p03473 (python)

Fixed submission:
#coding: utf-8
M = int(input())
x = 24 + (24 - M) 
print(x)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
S = input()
def crazy(a,b,S):
    num = "0123456789"
    S = S[:A] + S[A+1:]
    if S[a] != "-":
        return False
    for i in S[:a]:
        if i not in num:
            return False
    return True

if crazy(a,b,S):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#coding: utf-8
import re
A,B = map(int,input().split())
S = input()
find_underscore = re.findall("\-",S[A])
find_num_a = re.findall("[0-9]",S[:A-1])
find_num_b = re.findall("[0-9]",S[A+1:])
if find_underscore and find_num_a and find_num_b:
    print("Yes")
else:
    print("No")
Problem p03493 (python)

Fixed submission:
S = input()
count = 0
for i in S:
    if i == "1":
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
def abe(n):
    count = 0
    while n % 2 ==0:
        n = n / 2
        count += 1
    return count

x = int(input())
y = map(int,input().split())
z = min(map(abe,y))
print(z)
Problem p03597 (python)

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

print(N ** 2 - A)

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

cnt = 0
for i in x:
    cnt += 2 * min(i,K - i)

print(cnt)
Problem p03635 (python)

Fixed submission:
n,m = map(int,input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n,m = int(input())
print((n-1)*(m-1))
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):
A,B = map(intinput().split())

if A % 3 == 0 or B % 3 == 0 or (A + B)  % 3 == 0:
  print("Possible")
else:
  print("Impossible")
Problem p03711 (python)

Fixed submission:
# coding: utf-8
gl=[[1,3,5,7,8,10,12],[4,6,9,11],[2]]
x,y=map(int,input().split())
for g in gl:
    if x in g and y in g:
        print('Yes')
        exit()
print('No')

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

li =[[1,3,5,7,8,10,12],[4,6,9,11],[2]]

for i in li:
    if x and y in i:
        print("Yes")
        sys.exit()
print("No")
Problem p04011 (python)

Fixed submission:
N = int(input())
K = int(input()) 
X = int(input())
Y = int(input())
if N < K:
    print(X * N)
else:
    print(K * X + (N - K) * Y)

Buggy submission (verdict: Runtime Error):
N,K,X,Y = map(int,input().split())
if N < K:
    print(X * N)
else:
    print(K * X + (N - K) * Y)

Buggy submission (verdict: Runtime Error):
N,K,X,Y = map(int,input().split())
price = 0
for i in range(1,N+1):
    if i <= K:
        price += X
    else:
        price += Y
print(price)
Problem p02554 (python)

Fixed submission:
n = int(input())
print((10**n -2*9**n +8**n) % 1000000007)

Buggy submission (verdict: Runtime Error):
n = int(input())
print((10**n -2*9**n + 8**n)/1000000007)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n >=2:
  ans = (10**(n-2)*n*(n-1))/(10**9 + 7)
else:
  ans = 0
print(ans)
Problem p02657 (python)

Fixed submission:
data = input().split(" ")
a ,b= int(data[0]) , int(data[1])
print(a*b)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split(" ")]
result = 1
for idx in A:
	result *= idx
if result <= 10**18:
	print(result)
else:
 	print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input(" ").split()]
 
result = 1
for idx in A:
    result *= idx
if result <= 10**18:
	print(result)
else:
 	print("-1")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]

result = 1
for idx in A:
  result *= idx
  
if result >= 10**18:
  print("-1")
else:
  print(result)
Problem p02801 (python)

Fixed submission:
print(chr(ord(input()) + 1))

Buggy submission (verdict: Runtime Error):
print(chir(ord(input())+1))
Problem p02945 (python)

Fixed submission:
a, b = map(int,input().split())
r = []
r.append(a+b)
r.append(a-b)
r.append(a*b)
print(max(r))

Buggy submission (verdict: Runtime Error):
a, b = map(int,inptu().split())
r = []
r.append(a+b)
r.append(a-b)
r.append(a*b)
print(max(r))
Problem p03853 (python)

Fixed submission:
data_num = [int(i) for i in input().split(" ")]
data = [input() for i in range(data_num[0])]
for i in data:
  print(i)
  print(i)

Buggy submission (verdict: Runtime Error):
data_num = [int(i) for i in input().split(" ")]
data = [input() for i in range(data_num[0])]
for i in data:
  	print(i)	
    print(i)
Problem p03997 (python)

Fixed submission:
data = [int(input()) for i in range(3)]
result = (data[0]+data[1])*data[2]*0.5
if result == int(result) :
  print(int(result))
else :
  print(result)

Buggy submission (verdict: Runtime Error):
data = [int(input()) for i in range(3)]
result = data[0]+data[1])*data[2]*0.5
if result == int(result) :
  print(int(result))
else :
  print(result)
Problem p04029 (python)

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

Buggy submission (verdict: Runtime Error):
children = int(input())
total = 0

for i in range(chldren):
  total += i+1
print(total)
Problem p04043 (python)

Fixed submission:
data = [int(i) for i in input().split(" ")]
total = 0
for i in data:
    if i==7 or i==5:
        total += i
if total == 17:
  	print("YES")
else:
  	print("NO")

Buggy submission (verdict: Runtime Error):
tupni = [int(idx) for idx in input.split(" ")]
if tupni.sort() == [5,5,7]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
tupni = [int(idx) for idx in input.split()]
if tupni.sort() == [5,5,7]:
  print("YES")
else:
  print("NO")
Problem p02613 (python)

Fixed submission:
n=int(input())
ac,wa,tle,re=0,0,0,0
for i in range(n):
  hoge=input()
  if(hoge=="AC"):
    ac+=1
  elif(hoge=="WA"):
    wa+=1
  elif(hoge=="TLE"):
    tle+=1
  elif(hoge=="RE"):
    re+=1
    
print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))

Buggy submission (verdict: Runtime Error):
n=int(input())
ac,wa,tle,re=0,0,0,0
for i in range(n):
  hoge=input()
  if(hoge="AC"):
    ac+=1
  elif(hoge="WA"):
    wa+=1
  elif(hoge="TLE"):
    tle+=1
  elif(hoge="RE"):
    re+=1
    
print("AC x "+ac)
print("WA x "+wa)
print("TLE x "+tle)
print("RE x "+re)
Problem p02677 (python)

Fixed submission:
import math
a,b,h,m=map(int, input().split())
a_x=math.cos(abs(math.radians(6*m)-math.radians(30*h+0.5*m)))
print((a**2+b**2-2*a*b*a_x)**0.5)

Buggy submission (verdict: Runtime Error):
a,b,h,m=map(int, input().split())import math
a,b,h,m=map(int, input().split())
a_x=math.cos(math.radians(30*h+0.5*m))
a_y=math.sin(math.radians(30*h+0.5*m))
b_x=math.cos(math.radians(60*m))
b_y=math.sin(math.radians(60*m))
print((abs(a*a_x-b*b_x)**2+abs(a*a_y-b*b_y)**2)**0.5)
Problem p02705 (python)

Fixed submission:
n=int(input())

print(2*n*3.141592)

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

if(sum(hoge)>n):
  print(-1)
else:
  print(n-sum(hoge))
Problem p02802 (python)

Fixed submission:
n,m=map(int,input().split())
hoge=[0 for i in range(n)]
huga=[0 for i in range(n)]
for i in range(m):
  a,b=map(str,input().split())
  if(hoge[int(a)-1]==0 and b=="AC"):
    hoge[int(a)-1]=1
  if(hoge[int(a)-1]==0 and b=="WA"):
    huga[int(a)-1]+=1
    
for i in range(n):
  if(hoge[i]==0):
    huga[i]=0
    
print(sum(hoge),sum(huga))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
wa=0
hoge=[0 for i in range(n)]
huga=[0 for i in range(n)]
for i in range(m):
  a,b=map(str,input().split())
  if(hoge[int(a)-1]==0 and b=="AC"):
    hoge[int(a)-1]=1
  if(hoge[int(a)-1]==0 and b=="WA"):
    huga[int(a)-1]=1
    
for i in range(n):
  if(hoge[i]==0):
    huga=0
    
print(sum(hoge),sum(huga))
Problem p03005 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=int(input())
if(b==1):
  print(0)
else:
  print(a-b)
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):
n=int(input())
hoge=list(map(int,input().split()))
###
def huga(a,b):
  x=max(a,b)
  y=min(a,b)
  z=1
  for i in range(y):
    wa=y-i
    if(x%wa==0 and y%wa==0):
      z=wa
      break
  return z
###
hoge.sort(reverse=True)
ans=hoge[0]
for i in range(n-1):
  ans=huga(ans,hoge[i+1])
  
print(ans)
Problem p03238 (python)

Fixed submission:
N=int(input())
if(N==1):
  print("Hello World")
if(N==2):
  A=int(input())
  B=int(input())
  print(A+B)

Buggy submission (verdict: Runtime Error):
n=int(input())
hoge=[]
for i in range(n):
  x,y,z=map(int,input().split())
  if(z!=0):
    hoge.append([x,y,z])
  

if(len(hoge)==1):
  print(*hoge[0])
  exit()

for i in range(101):
  for j in range(101):
    h=[]
    for k in range(len(hoge)):
      h.append(hoge[k][2]+abs(hoge[k][0]-i)+abs(hoge[k][1]-j))
      
    if(h.count(h[0])==len(h)):
      print(i,j,h[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=int(input())
B=int(input())
if(N==1):
  print("Hello World")
if(N==2):
  print(A+B)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=int(input())
B=int(input())
if(N==1):
  print("Hello World")
else:
  print(A+B)
Problem p03239 (python)

Fixed submission:
N,T=map(int, input().split())
ans=9999
for i in range(N):
  A,B=map(int, input().split())
  if (T>=B):
    if(ans>=A):
      ans=A
if(ans==9999):
  print("TLE")
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
N,T=map(int, input().split())
ans=9999
for i inrange(N):
  A,B=map(int, input().split())
  if (T>B):
    if(ans>A):
      ans=A
if(ans==9999):
  print("TLE")
else:
  print(ans)