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

Fixed submission:
#!/usr/bin/env python3

import fractions
n = int(input())
a = list(map(int, input().split()))


value = a[0]
for i in range(1, n):
    value = fractions.gcd(value, a[i])
print(value)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

n = int(input())
a = list(map(int, input().split()))


set_odd = set()
set_even = set()

for i in a:
    if i % 2 == 1:
        set_odd.add(i)
    else:
        set_even.add(i)

if len(set_odd) >= 2:
    print(1)
    exit()
elif len(set_odd) == 1:
    if len(set_even) >= 1:
        print(1)
        exit()
    else:
        print(min(set_odd))

# only even number
min_a = min(set_even)
set_even = list(set_even)

ans = []

for i in range(len(set_even)):
    ans_tmp = set_even[i] % min_a
    if ans_tmp != 0:
        ans.append(ans_tmp)
    if min_a-ans_tmp != 0:
        ans.append(min_a-ans_tmp)

if ans == []:
    print(min(set_even))
else:
    print(min(ans))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

n = int(input())
a = list(map(int, input().split()))


set_odd = set()
set_even = set()

for i in a:
    if i % 2 == 1:
        set_odd.add(i)
    else:
        set_even.add(i)

if len(set_odd) >= 2:
    print(1)
    exit()
elif len(set_odd) == 1:
    if len(set_even) >= 1:
        print(1)
        exit()
    else:
        print(min(set_odd))

# only even number
min_a = min(set_even)
set_even = list(set_even)

ans = []

for i in range(len(set_even)):
    ans_tmp = a[i] % min_a
    if ans_tmp != 0:
        ans.append(ans_tmp)
    if min_a-ans_tmp != 0:
        ans.append(min_a-ans_tmp)

if ans == []:
    print(min(set_even))
else:
    print(min(ans))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

n = int(input())
a = list(map(int, input().split()))


set_odd = set()
set_even = set()

for i in a:
    if i % 2 == 1:
        set_odd.add(i)
    else:
        set_even.add(i)

if len(set_odd) >= 2:
    print(1)
    exit()
elif len(set_odd) == 1:
    if len(set_even) >= 1:
        print(1)
        exit()
    else:
        print(min(set_odd))

# only even number
min_a = min(set_even)
set_even = list(set_even)

ans = []

for i in range(len(a)):
    ans_tmp = a[i] % min_a
    if ans_tmp != 0:
        ans.append(ans_tmp)
    if min_a-ans_tmp != 0:
        ans.append(min_a-ans_tmp)

if ans == []:
    print(min(set_even))
else:
    print(min(ans))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

n = int(input())
a = list(map(int, input().split()))


set_odd = set()
set_even = set()

for i in a:
    if i % 2 == 1:
        set_odd.add(i)
    else:
        set_even.add(i)

if len(set_odd) >= 2:
    print(1)
    exit()
elif len(set_odd) == 1:
    if len(set_even) >= 1:
        print(1)
        exit()
    else:
        print(min(set_odd))

# only even number
min_a = min(set_even)
set_even = list(set_even)

ans = []

for i in range(len(a)):
    ans_tmp = a[i] % min_a
    if ans_tmp != 0:
        ans.append(ans_tmp)
    if min_a-ans_tmp != 0:
        ans.append(min_a-ans_tmp)

print(min(ans))
Problem p03207 (python)

Fixed submission:
#!/usr/bin/env python3

a = int(input())
p = [int(input()) for _ in range(a)]

print(sum(p)-max(p)+max(p)//2)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

a = int(input())
p = [int(input()) for _ in range(p)]

print(sum(p)-max(p)+max(p)//2)
Problem p03835 (python)

Fixed submission:
# N^2
K, S = map(int, input().split())

K+=1

count=0
for i in range(K):
    for j in range(0, K):
        tmp = S - (i + j)
        if tmp>=0 and tmp<K:
            count+=1
#             print(i,j,tmp)

print(count)

Buggy submission (verdict: Runtime Error):
start = time.time()
K, S = map(int, input().split())

K+=1

count=0
for i in range(K):
    for j in range(0, K-i):
        tmp = S - (i + j)
        if tmp>=0 and tmp<=K:
            count+=1
#             print(i,j,tmp)

print(count)

end = time.time()
print(end-start)
Problem p02689 (python)

Fixed submission:
n, m = map(int, input().split())
h = [int(x) for x in input().split()]
l = [1] * n
for i in range(m):
	a, b = map(int, input().split())
	if h[a-1] >= h[b-1]:
		l[b-1] = 0
	if h[b-1] >= h[a-1]:
		l[a-1] = 0
print(sum(l))

Buggy submission (verdict: Runtime Error):
h = [int(x) for x in input().split()]
l = [1] * n
for i in range(m):
	a, b = map(int, input().split())
	if h[a-1] >= h[b-1]:
		l[b-1] = 0
	if h[b-1] >= h[a-1]:
		l[a-1] = 0
print(sum(l))
Problem p02570 (python)

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

Buggy submission (verdict: Runtime Error):
d,t,s=map(int,input().split())
if d<=t*s:
  print('Yes')
 e;se:
  print('No')
Problem p02627 (python)

Fixed submission:
a = input()
print('a' if a.islower() else 'A')

Buggy submission (verdict: Runtime Error):
TN=input()
list=[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]
if TN not in list:
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
a=input()
list=[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]
if a not in list:
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
a=input()
list=[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]
if a in list==False:
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
a=input()
list=[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]
if list(a)==False:
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
a=str(input())
list=[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]
if list(a)=False:
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
a=input()
list=[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]
if list(a)=False:
  print("A")
else:
  print("a")
Problem p02954 (python)

Fixed submission:
#入力を受け取る
s = list(input())
ans = [0] * len(s)

#左から見ていく.Rだけ位置を決定する.

undifined_childlen = 0

for i in range(len(s)):
    if s[i] == 'R':
        undifined_childlen += 1
    else:
        if undifined_childlen % 2 == 0:
            ans[i] += undifined_childlen // 2
            ans[i-1] += undifined_childlen // 2
        else:
            ans[i] += undifined_childlen // 2
            ans[i-1] += (undifined_childlen // 2) + 1
    
        undifined_childlen = 0
        

#右から見ていく.Lだけ位置を決定する.
undifined_childlen = 0

for i in list(reversed(range(len(s)))):
    if s[i] == 'L':
        undifined_childlen += 1
    else:
        if undifined_childlen % 2 == 0:
            ans[i+1] += undifined_childlen // 2
            ans[i] += undifined_childlen // 2
        else:
            ans[i+1] += (undifined_childlen // 2) + 1
            ans[i] += (undifined_childlen // 2)
    
        undifined_childlen = 0

print(*ans)

Buggy submission (verdict: Runtime Error):
def move(s, i, count, before):
    if s[i] == before:
        if s[i] == 'R':
            return move(s, i+1, count+1, s[i])
        else:
            return move(s, i-1, count+1, s[i])
    else:
        if count % 2 == 0:
            return i
        else:
            if s[i] == 'R':
                return i + 1
            else:
                return i - 1

s = list(input())
ans = [0] * len(s)

for child in range(len(s)):
    if s[child] == 'R':
        ans[move(s, child + 1, 1, s[child])] += 1
    else:
        ans[move(s, child - 1, 1, s[child])] += 1
    
print(*ans)

Buggy submission (verdict: Runtime Error):
def move(s, i, count, before):
    if s[i] == before:
        if s[i] == 'R':
            return move(s, i+1, count+1, s[i])
        else:
            return move(s, i-1, count+1, s[i])
    else:
        if count % 2 == 0:
            return i
        else:
            if s[i] == 'R':
                return i + 1
            else:
                return i - 1

s = list(input())
ans = [0] * len(s)

for child in range(len(s)):
    if s[child] == 'R':
        ans[move(s, child + 1, 1, s[child])] += 1
    else:
        ans[move(s, child - 1, 1, s[child])] += 1
    
print(ans)
Problem p02629 (python)

Fixed submission:
n=int(input())
result=''
while n>0:
    n-=1
    result+=chr(ord('a')+n%26)
    n//=26
print(result[::-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
name=['a','b','c','d','e','f','g','h','i','j','k','l','n','m','o','p','q','r','s','t','u','w','x','y','z']
result=''
if n<27:
    print(name[n-1])
else:
    while n>26:
        a=n%26
        result+=name[a-1]
        n//=26
    result+=name[n-1]
    print(result[::-1])
Problem p02754 (python)

Fixed submission:
n,a,b=map(int,input().split())
i=n%(a+b)
if i>a:
    print(a*(n//(a+b))+a)
else:
    print(a*(n//(a+b))+i)

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
a=N//(A+B)
if N%(A+B)==0:
    print(a*A)
elif N%(A+B)>=A:
    print(a*A+A))
elif N%(A+B)<A:
    print(a*A+(N%(A+B)))
Problem p02777 (python)

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

Buggy submission (verdict: Runtime Error):
s,t=input().split()
a,b=map(int,input().split())
u=input()
if s==u:
    print(a-1)
else:
    pritn(b-1)
Problem p03834 (python)

Fixed submission:
s=input()
result=''
for i in s:
    if i==',':
        result+=' '
    else:
        result+=i
print(result)

Buggy submission (verdict: Runtime Error):
s=input()
resutl=''
for i in s:
    if i==',':
        result+=' '
    else:
        result+=i
print(result)
Problem p02725 (python)

Fixed submission:
k,n=map(int,input('').split())
a=input('')
a=a.split(' ')
for b in range(n):
    a[b]=int(a[b])
a.sort()

m=0
for b in range(n-1):
    if m<=a[b+1]-a[b]:
        m=a[b+1]-a[b]

if m<=k-a[n-1]+a[0]:
    m=k-a[n-1]+a[0]

print(k-m)

Buggy submission (verdict: Runtime Error):
a=a.split(' ')
for b in range(n):
    a[b]=int(a[b])

m=0
for b in range(n-1):
    if m<=a[b+1]-a[b]:
        m=a[b+1]-a[b]

if m<=k-a[n-1]+a[0]:
    m=k-a[n-1]+a[0]

print(k-m)
Problem p02693 (python)

Fixed submission:
I = [input() for i in range(2)]
K = int(I[0])
S = I[1].split()
A = int(S[0])
B = int(S[1])

na = A//K
nb = B//K

la = A%K
lb = B%K

#print(na)
#print(nb)

if na < nb or la == 0 or lb == 0 :
    ans = 'OK'
else:
    ans = 'NG'

print(ans)

Buggy submission (verdict: Runtime Error):
import math
I = input().split()
A = int(I[0])
B = int(I[1])
N = int(I[2])
def fl(x):
    return math.floor((A*x)/B) - A*math.floor(x/B)

An = fl(N)

if  B == 1 :
    An = int(0)

if B < N :
    for i in range(B,N) :
        if i >= B+1 and fl(i) <= fl(i-1) :
            An = fl(i-1)
            break
elif B == N :
    An = fl(N-1)

print(str(An))

Buggy submission (verdict: Runtime Error):
import math
I = input().split()
A = int(I[0])
B = int(I[1])
N = int(I[2])
def fl(x):
    return math.floor((A*x)/B) - A*math.floor(x/B)

An = fl(N)

if A == 1 : 
    if  B == 1 :
        An = int(0)

if B < N :
    for i in range(B,N) :
        if i >= B+1 and fl(i) <= fl(i-1) :
            An = fl(i-1)
            break
elif B == N :
    An = fl(N-1)

print(str(An))

Buggy submission (verdict: Runtime Error):
import math
I = input().split()
A = int(I[0])
B = int(I[1])
N = int(I[2])
def fl(x):
    return math.floor((A*x)/B) - A*math.floor(x/B)

An = fl(N)

if A == 1 and B == 1 :
    An = int(0)

if B < N :
    for i in range(B,N) :
        if i >= B+1 and fl(i) <= fl(i-1) :
            An = fl(i-1)
            break
elif B == N :
    An = fl(N-1)

print(str(An))

Buggy submission (verdict: Runtime Error):
import math
I = input().split()
A = int(I[0])
B = int(I[1])
N = int(I[2])
def fl(x):
    return math.floor((A*x)/B) - A*math.floor(x/B)

An =fl(N)

if A == 1 and B == 1 :
    An = 0

if B < N :
    for i in range(B,N) :
        if i >= B+1 and fl(i) <= fl(i-1) :
            An = fl(i-1)
            break
elif B == N :
    An = fl(N-1)

print(str(An))

Buggy submission (verdict: Runtime Error):
import math
I = input().split()
A = int(I[0])
B = int(I[1])
N = int(I[2])
def fl(x):
    return math.floor((A*x)/B) - A*math.floor(x/B)

if B > N :
    An =fl(N)
else :
    for i in range(B,N) :
        if i >= 2 and fl(i) < fl(i-1) :
            An = fl(i-1)
            break
        else:
            An = fl(N)


print(str(An))
Problem p02712 (python)

Fixed submission:
import numpy as np
N = int(input())
if N >= 2 :
    An = np.zeros(N+2, dtype=np.int)
    #An = [[] for _ in range(1,N+2)]
    #print(An)
    for s in range(1,N+1) :
        #print(s)
        if s%3 != 0 and s%5 != 0 :
            An[s] = int(s) 
            #print(s)
            #print(An[s])
    ans = np.sum(An)

else:
    ans = int(1)

print (int(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
if N >= 2 :
    An = [[] for _ in range(1,N)]
    #print(An)
    for s in range(1,N) :
        #print(s)
        if s%3 == 0 :
            An[s] = 0 
        elif s%5 == 0 :
            An[s] = 0
        else:
            An[s] = int(s) 
            #print(s)
            #print(An[s])
    ans = int(sum(An))
else:
    ans = int(1)

print (ans)
Problem p02859 (python)

Fixed submission:
rad = int(input())
S = round(rad*rad,0)
print(S)

Buggy submission (verdict: Runtime Error):
I = [input() for i in range(2)]
sn = int(I[0])
ss = str(I[1])
if sn%2 == 1 :
    A = 'No' 
else:
    sl = int(sn/2) 
    # print(sl)
    if sl >= 2 : 
        H1 = ss[:sl]
        H2 = ss[sl:]
    #     print(H1)
    #     print(H2)
    elif sl == 1 :
        H1 = ss[0]
        H2 = ss[1]
    if  H1 == H2 :
        A = 'Yes'
    else:
        A = 'No'
print(A)

Buggy submission (verdict: Runtime Error):
I = [input() for i in range(2)]
sn = int(I[0])
ss = str(I[1])
if sn%2 == 1 :
    A = 'No' 
else:
    sl = int(sn/2) 
    print(sl)
    if sl >= 2 : 
        H1 = ss[:sl]
        H2 = ss[sl:]
    elif sl == 1 :
        H1 = ss[0]
        H2 = ss[1]
    if  H1 == H2 :
        A = 'Yes'
    else:
        A = 'No'
print(A)

Buggy submission (verdict: Runtime Error):
I = [input() for i in range(2)]
sn = int(I[0])
ss = str(I[1])
if sn%2 == 1 :
    A = 'No' 
else:
    sl = int(sn/2) 
    print(sl)
    if sl >= 2 : 
        H1 = ss[0:sl]
        H2 = ss[sl:]
        print(H1)
        print(H2)
    elif sl == 1 :
        H1 = ss[0]
        H2 = ss[1]
    if  H1 == H2 :
        A = 'Yes'
    else:
        A = 'No'
print(A)

Buggy submission (verdict: Runtime Error):
round(r*r,0)
Problem p02860 (python)

Fixed submission:
I = [input() for i in range(2)]
sn = int(I[0])
ss = str(I[1])
if sn%2 == 1 :
    A = 'No' 
else:
    sl = int(sn/2) 
    # print(sl)
    if sl >= 2 : 
        H1 = ss[:sl]
        H2 = ss[sl:]
    #     print(H1)
    #     print(H2)
    elif sl == 1 :
        H1 = str(ss[0])
        H2 = str(ss[1])
    if  H1 == H2 :
        A = 'Yes'
    else:
        A = 'No'
print(A)

Buggy submission (verdict: Runtime Error):
I = [input() for i in range(2)]
if I(0)%2 = 1 :
    A = 'No' 
else:
    H1 = I(1)[:I(0)/2]
    H2 = I(1)[I(0)/2+1:]
    if  H1 = H2 :
        A = 'Yes'
    else:
        A = 'No'

print(A)

Buggy submission (verdict: Runtime Error):
I = list(map(int,input().split()))
if I(0)%2 = 1 :
    A = 'No' 
else:
    H＝I(1)[:I 0)/2]
    if I(1) = H + H :
        A = 'Yes'
    else:
        A = 'No'

print(A)
Problem p02723 (python)

Fixed submission:
s = input()
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if s[3] == s[4] and s[5] == s[6]:
    print("Yes")
else:
    print("No")
Problem p02549 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
import numpy as np

# import numba
# from numba import njit, b1, i4, i8, f8

input = sys.stdin.readline
mod = 998244353


def I():
    return int(input())


def MI():
    return map(int, input().split())


# @njit((i8, i8[:]), cache=True)
def main(N, steps):
    dp = np.zeros(N + 1, np.int64)
    dpsum = np.zeros(N + 1, np.int64)
    dp[1] = 1
    dpsum[1] = 1
    for i in range(2, N + 1):
        for l, r in steps:
            li = i - r
            ri = i - l
            if ri < 0:
                continue
            li = max(li, 1)
            dp[i] += dpsum[ri] - dpsum[li - 1]
            dp[i] %= mod
        dpsum[i] = dpsum[i - 1] + dp[i]
        dpsum[i] %= mod

    return dp[N]


N, K = MI()

steps = []
for _ in range(K):
    l, r = MI()
    steps.append((l, r))


print(main(N, steps))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import numpy as np

input = sys.stdin.readline
mod = 998244353


def I():
    return int(input())


def MI():
    return map(int, input().split())



N, K = MI()

steps = set()
for _ in range(K):
    l, r = MI()
    steps |= set(range(l, r + 1))

dp = np.zeros(N)
dp[0] = 1

for i in range(N):
    for s in steps:
        tmp = i - s
        if tmp >= 0:
            dp[i] += dp[tmp]
            dp[i] %= mod

print(int(dp[N - 1]))
Problem p02572 (python)

Fixed submission:
N = int(input())
An = list(map(int, input().split()))
tt = sum(An)
total = tt
ans = 0
for A in An:
    At = A * (total-A)
#     if v == 1:
#         At = A * (tt-A)
#     else:
#         At = A * (tt-A*v)*v
#     print(A, total, At, ans)
#     md = At % (10**9+7)
    ans = (ans+At) % (10**9+7)
    total -= A
#     print(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
mport sys
import numpy as np
import math
import collections
import copy
import decimal
import itertools
from collections import deque 
from functools import reduce
from itertools import product
from itertools import combinations

# input = sys.stdin.readline
N = int(input())
An = list(map(int, input().split()))
An_l = list(itertools.accumulate(An))
An_l.insert(0, 0)
ans = 0
for i, A in enumerate(An):
    tt = An_l[-1] - An_l[i+1]
#     print(i, An_l[-1], An_l[i], tt)
    At = A * tt
#     print(A, tt, At)
    ans = (ans+At) % (10**9+7)
#     print(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
An = list(map(int, input().split()))
An_s = collections.Counter(An)
total = 0
for k in An_s:
    total += k
ans = 0
for A, v in An_s.items():
    At = A * (total-A)*v
#     print(A, total, At, ans)
    ans = (ans+At) % (10**9+7)
#     print(ans)
print(ans//2)
Problem p02597 (python)

Fixed submission:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product
from itertools import combinations

# input = sys.stdin.readline
N = int(input())
Cn = list(input())

Cc = copy.copy(Cn)
if (Cn[0] == "R"):
    Rflg = True
else:
    Rflg = False
ans = 0
K = N-1    
allw = False
for i in range(N):
    if Rflg and Cc[i] == "R":
        continue
    else:
        Rflg = True
    if Cc[i] == "W":
        for j in range(K, i, -1):
            if Cc[j] == "R":
#                 print("change")
                ans += 1
                Cc[i], Cc[j] = Cc[j], Cc[i]
                K = j
#                 print(Cc)
                break
        else:
            allw = True

    else:
#         print("replace")
        ans += 1
        Cc[i] = "W"
#         print(Cc)
    if allw:
        break

print(ans)

Buggy submission (verdict: Runtime Error):
Cc = copy.copy(Cn)
if (Cn[0] == "R"):
    Rflg = True
else:
    Rflg = False
ans = 0
K = N-1    
allw = False
for i in range(N):
    if Rflg and Cc[i] == "R":
        continue
    else:
        Rflg = True
    if Cc[i] == "W":
        for j in range(K, i, -1):
            if Cc[j] == "R":
#                 print("change")
                ans += 1
                Cc[i], Cc[j] = Cc[j], Cc[i]
                K = j
#                 print(Cc)
                break
        else:
            allw = True

    else:
#         print("replace")
        ans += 1
        Cc[i] = "W"
#         print(Cc)
    if allw:
        break
Problem p02629 (python)

Fixed submission:
import sys
import numpy as np
import math
import collections
from collections import deque 
from functools import reduce

# input = sys.stdin.readline
n = int(input())
ret = ''
while(n > 0):
    n -= 1
    ret += chr(ord('a') + n % 26)
    n //= 26
print(ret[::-1])

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
import math
from collections import deque 
from functools import reduce

n = int(input())
az = "abcdefghijklmnopqrstuvwxyz"
cnt = 12
ret = []
ama = n % 26
na = n
for i in range(12, 0, -1):
    if 26**(i-1) > n:
        continue
    sho = na // (26**i)
    if sho > 0:
        ret.append(az[sho-1])
    else:
        if len(ret) > 0:
            ret.append('z')
    na -= sho * (26**i)
if (ret[0] == 'z'):
    del ret[0]
re = "".join(ret)
print(re)
Problem p02572 (python)

Fixed submission:
n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))

Buggy submission (verdict: Runtime Error):
from C import ans


n = int(input())
n_list = [int(i) for i in input().split()]

s = sum(a**2 for a in n_list)
ans = sum(n_list) ** 2 - s

print((ans//2)%(10**9+7))
Problem p03745 (python)

Fixed submission:
n = int(input())
num_list = list(map(int, input().split()))
ans = 1
cnt_list = [0] * n
a = int()

for i in range(1,n):
    if num_list[i-1] > num_list[i]:
        cnt_list[i] = -1
    if num_list[i-1] < num_list[i]:
        cnt_list[i] = 1

while 1 in cnt_list and -1 in cnt_list:
    del cnt_list[:max(cnt_list.index(1),cnt_list.index(-1))]
    cnt_list[0] = 0
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
num_list = list(map(int, input().split()))
ans = 1
cnt_list = [0] * n

for i in range(1,n):
    if num_list[i-1] > num_list[i]:
        cnt_list[i] = -1
    if num_list[i-1] < num_list[i]:
        cnt_list[i] = 1

for i in range(1,n-1):
    if cnt_list[i] == -1 * cnt_list[1]:
        if cnt_list[i+1] == cnt_list[1] or cnt_list[i-1] == cnt_list[1]:
            ans+=1
if cnt_list[n-1] == -1 * cnt_list[1] and cnt_list[n-2] == cnt_list[1]:
    ans += 1

print(ans)
Problem p02595 (python)

Fixed submission:
import math
n,d=map(int,input().split())
c=0
for i in range(n):
  a,b=map(int,input().split())
  r=math.sqrt(a**2+b**2)
  if r<=d:
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
import math
n,d=map(int(input().split()))
c=0
for i in range(n):
  a,b=map(int(input().split()))
  r=math.sqrt(a**2+b**2)
  if r<=d:
    c+=1
print(c)
Problem p02753 (python)

Fixed submission:
s=input()
if s=="AAA" or s=="BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
s=input()
if s=="AAA" or s=="BBB":
  print(No)
else:
  print(Yes)
Problem p02771 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==b:
   print "Yes"
elif a==c:
   print "Yes"
elif b==c:
   print "Yes"
else:
   print "No"
Problem p02624 (python)

Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1):
  ans+=(i+i*(n//i))*(n//i)//2
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy
n = int(input())
a = 0
for j in range(1,n+1):
    a += j * len(sympy.divisors(j))
print(a)

Buggy submission (verdict: Runtime Error):
import sympy
n = int(input())
a = 0
for i in range(1,n+1):
    a += i*sympy.divisor_count(i)
print(a)
Problem p02711 (python)

Fixed submission:
li=list(str(input()))
if '7' in li:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a
Problem p02723 (python)

Fixed submission:
li=list(input())
a=li[2]
b=li[3]
c=li[4]
d=li[5]
if a==b:
    if c==d:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
li=list(input())
a=li[2]
b=li[3]
c=li[4]
d=li[5]
if a=b:
    if c=d:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
li=list(inoput())
a=li[2]
b=li[3]
c=li[4]
d=li[5]
if a=b:
    if c=d:
        print('Yes')
    else:
        print('No')
else:
    print('No')