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

Fixed submission:
a = list(map(int,input().split()))
b = sorted(a)
if b == [5, 5, 7]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
h,w,a,b = map(int,input().split())
mod = 10**9 + 7
dp = [[0 for i in range(h+1)] for j in range(w+1)]
 
for i in range(w):
    for j in range(h):
        dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j])%mod
        if i == 0 and j == 0:
            dp[i+1][j+1] = 1
        if i < b and j >= h-a:
            dp[i+1][j+1] = 0
print(dp[w][h])

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
b = sorted(a)
if b = [5, 5, 7]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
b = sorted(a)3 
if b = [5, 5, 7]:
    print("YES")
else:
    print("NO")
Problem p02628 (python)

Fixed submission:
#ABC171B
n,k = map(int,input().split())
p = sorted(list(map(int,input().split())))
print(sum(p[:k]))

Buggy submission (verdict: Runtime Error):
#ABC171B
n,k = map(int,input().split())
p = sorted(list(map(int,inout().split())))
print(sum(p[:k]))
Problem p02706 (python)

Fixed submission:
#ABC163B
n,m = map(int,input().split())
a = list(map(int,input().split()))
print(-1 if sum(a) > n else n-sum(a))

Buggy submission (verdict: Runtime Error):
#ABC163B
n,m = map(int,input().split())
a = list(map(int,inout().split()))
print(-1 if sum(a) >= n else n-sum(a))
Problem p02778 (python)

Fixed submission:
s = input()
print("x"*len(s))

Buggy submission (verdict: Runtime Error):
s = input()
print("x"**len(s))
Problem p02784 (python)

Fixed submission:
#ABC153B
h,n = map(int,input().split())
a = list(map(int,input().split()))
print("Yes" if sum(a) >= h else "No")

Buggy submission (verdict: Runtime Error):
#ABC153B
h,n = map(int,input().split())
a = list(map(int,inout().split()))
print("Yes" if sum(a) >= h else "No")
Problem p02921 (python)

Fixed submission:
#ABC090
s = input()
t = input()
ans = 0
if s[0]==t[0]:
    ans+=1
if s[1]==t[1]:
    ans+=1
if s[2]==t[2]:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
#ABC090
s = input()
t = input()
ans = 0
if s[0]=t[0]:
    ans+=1
if s[1]=t[1]:
    ans+=1
if s[2]=t[2]:
    ans+=1
print(ans)
Problem p03136 (python)

Fixed submission:
#ABC117B
n = int(input())
l = list(map(int,input().split()))
print("Yes" if max(l) < (sum(l)-max(l)) else "No")

Buggy submission (verdict: Runtime Error):
#ABC117B
n = int(input())
l = [int(input()) for i in range(n)]
print("Yes" if max(l) >= (sum(l)-max(l)) else "No")

Buggy submission (verdict: Runtime Error):
#ABC117B
n = int(input())
l = [int(input()) for i in range(n)]
print("Yes" if max(l) >= sum(l)-max(l) else "No")
Problem p03292 (python)

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

Buggy submission (verdict: Runtime Error):
*a = map(int,input().split())
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
*a = map(input().split())
print(max(a)-min(a))
Problem p03385 (python)

Fixed submission:
#ABC093
s = input()
print("Yes" if len(set(s))==3 else "No")

Buggy submission (verdict: Runtime Error):
#ABC093
s = [input().split()]
print("Yes" if len(set(s))==3 else "No")
Problem p03502 (python)

Fixed submission:
#ABC080B
n = input()
print("Yes" if int(n) %sum(map(int,n)) == 0 else "No")

Buggy submission (verdict: Runtime Error):
#ABC080B
n = input()
print("Yes" if sum(map(int,n))%n == 0 else "No")
Problem p03543 (python)

Fixed submission:
a =  input()
print("Yes" if a[0]==a[1]==a[2] or a[3]==a[1]==a[2] else "No")

Buggy submission (verdict: Runtime Error):
a =  input()
print("Yes" if a[0]==a[1]==a[2] or a[3]==a[1]==a[2] "No")
Problem p03636 (python)

Fixed submission:
a,*b,c = input()
print(a+str(len(b))+c)

Buggy submission (verdict: Runtime Error):
a,*b,c = input()
print(a+string(len(b))+c)

Buggy submission (verdict: Runtime Error):
a,*b,c = input()
print(a+string(b)+c)

Buggy submission (verdict: Runtime Error):
a,*b,c = input()
print(a+len(b)+c)
Problem p03719 (python)

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

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

Fixed submission:
o = list(input())
e = list(input())+[""]

for i,j in zip(o,e): print(i+j,end="")

Buggy submission (verdict: Runtime Error):

#ABC058B
o = input()
e = input()

for i in range(len(o)):
    print(o[i]+e[i],end="")

Buggy submission (verdict: Runtime Error):
o = list(input())
e = list(input())+[""]

for i,j zip(o,e): print(i+j,end="")
Problem p03852 (python)

Fixed submission:
c = input()
if c in "aeiou":
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
c  = input()
if c in "aeiou":
  print("vowel")
 else:
  print("consonant")
Problem p03860 (python)

Fixed submission:
print("A%sC"%input()[8])

Buggy submission (verdict: Runtime Error):

print("A%sC"%inut()[8])
Problem p04011 (python)

Fixed submission:
n,k,x,y=[int(input()) for i in [0]*4]
print(n*x-(x-y)*max(n-k,0))

Buggy submission (verdict: Runtime Error):
a,b,c,d=[int(input()) for i in [0]*4]
print(n,k,x,y=(int(input()) for i in [0]*4))
Problem p04044 (python)

Fixed submission:
n,l = map(int,input().split())
s = [input() for i in range(n)]
print(*sorted(s),sep="")

Buggy submission (verdict: Runtime Error):
n,l = map(int,input().split())
s = [input() for i in range(n)]
print(*stored(s),sep="")

Buggy submission (verdict: Runtime Error):
n,l = map(int,input().split())
s = input() for i in range(n)
print(*stored(s),sep="")

Buggy submission (verdict: Runtime Error):
n = input()
l = input()
s = input() for i in range(n)
print(*stored(s),sep="")
Problem p02719 (python)

Fixed submission:
def calc(n, k):
    if n == 0:
        return 0
    if n > k:
        a = n%k
        return min(abs(a-k), a)
    # kのほうがnより大きいとき
    if n*2 < k:
        return n
    else:
        # k = k%n+n+n
        return min(abs(n-k), k-abs(n-k))

n, k = (int(each) for each in input().split())
print(calc(n, k))

Buggy submission (verdict: Runtime Error):
n, k = (int(each) for each in input().split())
if n > k:
    a = n%k
    print(min(abs(a-k), a))
else:
    k = k%n+n+n
    b = min(abs(n-k), k-abs(n-k))
    if b == 0:
        print(n)
    else:
        print(b)
Problem p02761 (python)

Fixed submission:
def calculate(n, m, condition_list):
    if [1, 0] in condition_list and n > 1:
        return '-1'
    # こたえは1桁ごとに区切ったリストにする
    # 最後にjoinして回答する
    result = ['null']*n
    for condition in condition_list:
        if result[condition[0]-1] != 'null':
            if not result[condition[0]-1] == condition[1]:
                return '-1'
        result[condition[0]-1] = condition[1]
    # 指定がない桁はまだnullのままなのでそれを埋める
    for i in range(len(result)):
        if result[i] == 'null':
            # 一番左の桁が空いていたら1にする
            if i == 0 and n != 1:
                result[i] = 1
            # それ以外の桁が空いていたら0にする
            else:
                result[i] = 0
    return ''.join([str(each) for each in result])

n, m = (int(each) for each in input().split(' '))

# 条件をリストに入れる
condition_list = []
for i in range(m):
    condition_list.append([int(each) for each in input().split(' ')])

print(calculate(n, m, condition_list))

Buggy submission (verdict: Runtime Error):
def calculate(n, m, condition_list):
    if [1, 0] in condition_list:
        return '-1'
    # こたえは1桁ごとに区切ったリストにする
    # 最後にjoinして回答する
    result = ['null']*n
    for condition in condition_list:
        if result[condition[0]-1] != 'null':
            if not result[condition[0]-1] == condition[1]:
                return '-1'
        result[condition[0]-1] = condition[1]
    # 指定がない桁はまだnullのままなのでそれを埋める
    for i in range(result):
        if result[i] == 'null':
            # 一番左の桁が空いていたら1にする
            if i == 0 and n != 1:
                result[i] = 1
            # それ以外の桁が空いていたら0にする
            else:
                result[i] = 0
    return ''.join([str(each) for each in result])

n, m = (int(each) for each in input().split(' '))

# 条件をリストに入れる
condition_list = []
for i in range(m):
    condition_list.append([int(each) for each in input().split(' ')])

print(calculate(n, m, condition_list))
Problem p03030 (python)

Fixed submission:
rest = []

n = int(input())
for i in range(n):
  tmp = input().split()
  tmp[1] = int(tmp[1]) * (-1)
  tmp.append(i + 1)
  rest.append(tmp)

rest.sort()

for r in rest:
  print(r[2])

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

a.sort()

bc = []

for _ in range(m):
  bc.append(list(map(int, input().split())))

print(bc)
Problem p02786 (python)

Fixed submission:
h = int(input())
count = 0
count_1 = 1
count_2 = 1
while True:
    if h == 1:
        print(count_2)
        break
    else:
        h = h // 2
        count_1 = count_1 * 2
        count_2 += count_1

Buggy submission (verdict: Runtime Error):
h = input()
count = 0
count_1 = 1
count_2 = 1
while True:
    if h == 1:
        print(count_2)
        break
    else:
        h = h // 2
        count_1 = count_1 * 2
        count_2 += count_1
Problem p03000 (python)

Fixed submission:
n, x = map(int, input().split())
l = [int(x) for x in input().split()]
ans = 1
d = 0
for i in l:
    d += i
    if d <= x:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = [int(x) for x in input().split()]
ans = 0
d = 0
for i in l:
    d += i
    ans += 1
    if d > x:
        print(ans)
        exit(1)
Problem p02640 (python)

Fixed submission:
i = input().split()
i = [int(j) for j in i]
 
flg = 0
for a in range(i[0]+1):
  if 2*a+4*(i[0]-a)==i[1]:
    print("Yes")
    flg = 1
    
if flg==0:
  print("No")

Buggy submission (verdict: Runtime Error):
i = input().split()
i = [int(j) for j in i]

flg = 0
for a in range(i[0]):
  if 2*a+4*b==i[1]:
    print("Yes")
    flg = 1
    
if flg==0:
  print("No")
Problem p02642 (python)

Fixed submission:
import math
num = int(input())
arr = input().split()
arr = sorted([int(i) for i in arr])

lis1 = [0]*(arr[-1]+1)

for num in arr:
  for j in range(0, len(lis1), num):
    lis1[j] += 1

cnt = 0
for num in arr:
  if lis1[num]==1: cnt+=1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
import math
num = int(input())
arr = input().split()
arr = sorted([int(i) for i in arr])
arr = list(set(arr))

lis1 = [0]*(arr[-1]+1)

for num in arr:
  for j in range(0, len(lis1), num):
    lis1[j] += 1

cnt = 0
for num in arr:
  if lis1[num]==1: cnt+=1
    
print(cnt)
Problem p02909 (python)

Fixed submission:
tmp = ["Sunny", "Cloudy", "Rainy"]
today = input()

print(tmp[(tmp.index(today)+1)%3])

Buggy submission (verdict: Runtime Error):
tmp = ["Sunny", "Cloudy", "Rainy"]
today = input()

print(tmp[tmp.index(today)%3 + 1])
Problem p02911 (python)

Fixed submission:
import sys

num = input().split()
participant = int(num[0])
init_point = int(num[1])
correct = int(num[2])

tmp = [0]*participant

for i in range(correct):
  answer_person = int(input())-1
  tmp[answer_person] += 1

for i in tmp:
  if i<=correct-init_point:
    print("No")
  else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
num = input().split()
participant = int(num[0])
init_point = int(num[1])
correct = int(num[2])

tmp = [init_point]*participant

for i in range(participant):
  answer_person = int(input())
  tmp[answer_person-1] += 1
  tmp = [i-1 for i in tmp]
  
for item in tmp:
  if item>0: print("Yes")
  else: print("No")

Buggy submission (verdict: Runtime Error):
num = input().split()
participant = int(num[0])
init_point = int(num[1])
correct = int(num[2])

tmp = [init_point]*participant

for i in range(participant):
  answer_person = int(input())
  tmp[answer_person-1] += 1
  tmp -= 1
  
for item in tmp:
  if item>0: print("Yes")
  else: print("No")
Problem p02946 (python)

Fixed submission:
num = input().split()
a, b = int(num[0]), int(num[1])
tmp = []
for i in range(b-a+1,b+a):
  tmp.append(str(i))
print(' '.join(tmp))

Buggy submission (verdict: Runtime Error):
num = input().split()
a, b = int(num[0]), int(num[1])
tmp = []
for i in range(b-a+1,b+a):
  tmp.append(i)
print(' '.join(tmp))
Problem p02947 (python)

Fixed submission:
import math

num = int(input())
tmp = {}
flg = 0
ans = 0
for i in range(num):
  inp = ''.join(sorted(input()))
  if inp not in tmp: tmp[inp]=1
  else: tmp[inp]+=1
for k, v in tmp.items():
  if v > 1:
    ans += v*(v-1)//2
    flg = 1
print(ans)

Buggy submission (verdict: Runtime Error):
num = int(input())
tmp = {}
for i in range(num):
  if i in tmp: tmp[i]=1
  else: tmp[i]+=1
for k, v in tmp.items():
  if v > 1: print(k)
Problem p02952 (python)

Fixed submission:
num = input()
ans = [9,0,900,0,90000]
tmp = 0

if len(num)%2==0:
  tmp = sum(ans[:len(num)])
elif len(num)==1:
  tmp = num
else:
  tmp += sum(ans[:len(num)-2])
  tmp += int(num)-10**(len(num)-1)+1

print(tmp)

Buggy submission (verdict: Runtime Error):
num = input()
ans = [9,0,900,0,90000]
tmp = 0
if len(num)%2==0:
  tmp = sum(ans[:len(num)])
else:
  tmp += sum(ans[:len(num)-2])
  tmp += int(num[1:])+1

print(tmp)
Problem p02975 (python)

Fixed submission:
iter_num = int(input())
num = input().split()
num = sorted([int(i) for i in num])

num_bin = [format(int(i),'b') for i in num]
max_len = len(num_bin[-1])

num_bin = [format(i, '0>{}'.format(max_len)) for i in num_bin]

tmp = []
for i in range(len(num_bin[0])):
  tmp_num = 0
  for j in num_bin:
    tmp_num += int(j[i])
  if tmp_num%2==0: tmp_num=0
  tmp.append(tmp_num)

flg = 0
for i in tmp:
  if i==0: pass
  else:
    flg = 1
    print('No')
    break
if flg == 0: print('Yes')

Buggy submission (verdict: Runtime Error):
iter_num = int(input())
num = input().split()

num_bin = [format(int(i),'b') for i in num]
max_len = len(num_bin[-1])

num_bin = [format(i, '0>{}'.format(max_len)) for i in num_bin]

tmp = []
for i in range(len(num_bin[0])):
  tmp_num = 0
  for j in num_bin:
    tmp_num += int(j[i])
  if tmp_num%2==0: tmp_num=0
  tmp.append(tmp_num)

flg = 0
for i in tmp:
  if i==0: pass
  else:
    flg = 1
    print('No')
    break
if flg == 0: print('Yes')
Problem p03260 (python)

Fixed submission:
num = list(map(int, input().split()))

if num[0]%2==0 or num[1]%2==0: print('No')
else: print('Yes')

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

if num[0]%2==0 and num[1]%2==0: print('No')
else: print('Yes')
Problem p03337 (python)

Fixed submission:
num = input().split()
a, b =int(num[0]), int(num[1])

ans = sorted([a+b, a-b, a*b])

print(ans[-1])

Buggy submission (verdict: Runtime Error):
num = input().split()
a, b =int(num[0]), int(num[1])

ans = sorted([a+b, a-b, a*b , a//b])

print(ans[-1])

Buggy submission (verdict: Runtime Error):
num = input().split()
a, b =int(num[0]), int(num[1])

ans = [a+b, a-b, a*b , a//b]

print(ans[-1])

Buggy submission (verdict: Runtime Error):
num = input().split()
a, b =int(num[0]), int(num[1])

ans = sorted([a+b, a-b, a*b , a//b])

print(ans[0])
Problem p03351 (python)

Fixed submission:
num = input().split()
a, b, c, d = int(num[0]), int(num[1]), int(num[2]), int(num[3])

if abs(a-b)<=d and abs(b-c)<=d or abs(a-c) <= d:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
num = input().split()
a, b, c, d = int(num[0]), nt(num[1]), nt(num[2]), nt(num[3])

if abs(a-b)<=d and abs(b-c)<=d:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
num = input().split()
a, b, c, d = int(num[0]), nt(num[1]), nt(num[2]), nt(num[3])

if math.abs(a-b)<=d and math.abs(b-c)<=d:
  print("Yes")
else:
  print("No")
Problem p03399 (python)

Fixed submission:
tmp = []
for i in range(4):
  tmp.append(int(input()))
  
print(min(tmp[0], tmp[1])+min(tmp[2], tmp[3]))

Buggy submission (verdict: Runtime Error):
tmp = []
for i in range(4):
  tmp.append(int(input()))
  
ptint(min(tmp[0], tmp[1])+min(tmp[2], tmp[3]))
Problem p03437 (python)

Fixed submission:
num = input().split(" ")
num = [int(i) for i in num]
if num[0]%num[1]==0: print("-1")
else: print(num[0])

Buggy submission (verdict: Runtime Error):
num = input().split(" ")
[i = int(i) for i in num]

if num[0]%num[1]==0:
  print("-1")
else:
  print(num[0])

Buggy submission (verdict: Runtime Error):
num = int(input()).split(" ")
ans=0
for i in range(10**18):
  if i%num[0]==0 and i%num[1]!=0:
    ans=i
    break
  else:
    pass
if ans==0: print(-1)
else: print(ans)
Problem p03469 (python)

Fixed submission:
print("2018"+input()[4:])

Buggy submission (verdict: Runtime Error):
print("2018"+input([4:]))
Problem p03543 (python)

Fixed submission:
num = input()
if num[:3].count(num[0])==3 or num[1:].count(num[1])==3:
  print("Yes")
else: print("No")

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

tmp = 0
for i in range(len(num)):
  if num[i]==num[i+1]: tmp+=1
  else: tmp=0
if tmp>=3: print('Yes')
else: print('No')
Problem p03844 (python)

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

a,b = int(num[0]), int(num[2])
if num[1]=='+': print(a+b)
else: print(a-b)

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

a,b = int(num[0]), int(num[1])
if num[1]=='+': print(a+b)
else: print(a-b)
Problem p03860 (python)

Fixed submission:
word = input().split()
print(word[0][0]+word[1][0]+word[2][0])

Buggy submission (verdict: Runtime Error):
word = input().split()
print(word[0][1]+word[1][1]+word[2][1])
Problem p03997 (python)

Fixed submission:
num = [int(input()) for i in range(3)]
 
print(int((num[0]+num[1])*num[2]/2))

Buggy submission (verdict: Runtime Error):
num = [input() for i in range(3)]

print((num[0]+num[1])*num[2]/2)
Problem p04011 (python)

Fixed submission:
a = [int(input()) for i in range(4)]
ans = 0

for i in range(1,a[0]+1):
  if i<=a[1]:
    ans += a[2]
  else:
    ans += a[3]

print(ans)

Buggy submission (verdict: Runtime Error):
a = [input() for i in range(4)]
ans = 0

for i in range(1,a[0]+1):
  if i<a[1]:
    ans += a[2]
  else:
    ans += a[3]

print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
ini = input()
ini_pri=input()
left_pri=input()

ans = 0
for i in range(n):
  	if i < ini:
      ans += ini_pri
    else:
      ans += left_pri

print(ans)
Problem p02724 (python)

Fixed submission:
N = int(input())
div,mod = divmod(N,500)
div2 = mod//5
print(1000*div + 5*div2)

Buggy submission (verdict: Runtime Error):
N = int(input())
div,mod = divmod(N,5000)
div2 = (mod,5)
print(5000*div + 5*div2)
Problem p02802 (python)

Fixed submission:
from collections import defaultdict
N,M = map(int,input().split())
AC_List = defaultdict(int)
WA_List = defaultdict(int)

for i in range(M):
    Num,Sta = map(str,input().split())
    if Num in AC_List:
        continue
    else:
        if Sta == "WA":
            WA_List[Num] += 1
        else:
            AC_List[Num] += 1

ansct = 0
for k,v in WA_List.items():
    if k in AC_List:
        ansct += v
            
print(str(len(AC_List))+" " +str(ansct))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
N,M = map(int,input().split())
AC_List = defaultdict(int)
WA_List = defaultdict(int)

for i in range(M):
    Num,Sta = map(str,input().split())
    if Num in AC_List:
        continue
    else:
        if Sta == "WA":
            WA_List[Num] += 1
        else:
            AC_List[Num] += 1

ansct = 0
for k,v in WA_List:
    if k in AC_List:
        ansct += v
            
print(str(len(AC_List))+" " +str(ansct))
Problem p02830 (python)

Fixed submission:
#https://atcoder.jp/contests/abc148/tasks/abc148_b
N = int(input())
a,b = map(str,input().split())
moji = ""
for i in range(N):
    moji += a[i]+b[i]

print(moji)

Buggy submission (verdict: Runtime Error):
#https://atcoder.jp/contests/abc148/tasks/abc148_b
N = int(input())
a,b = map(int,input().split())
moji = ""
for i in range(N):
    moji += a[i]+b[i]

print(moji)
Problem p02909 (python)

Fixed submission:
Weather_List = ["Sunny", "Cloudy", "Rainy","Sunny"]

print(Weather_List[Weather_List.index(str(input()))+1])

Buggy submission (verdict: Runtime Error):
N,K,Q = map(int,input().split())
Answer_List = {}
for i in range(Q):
    CA = int(input())
    if CA in Answer_List:
        Answer_List[CA] += 1 
    else:
        Answer_List[CA] = 1
 
Lose_Status = K - Q
if Lose_Status > 0:
    for j in range(N):
        print("Yes")
else:
    Standard = abs(Lose_Status) + 1
    for j in range(N):
        if j + 1 in Answer_List:
            if Answer_List[j + 1] >= Standard:
                print("Yes")
            else:
                print("No")
        else:
                print("No")
Problem p02923 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
N_List = list(map(int,input().split()))
maxct = 0
for i in range(N-1):
    if N_List[i] >= N_List[i+1]:
        ct += 1
        if (i == N - 2) & (ct > maxct):
            maxct  = ct
    else:
        if maxct < ct:
            maxct = ct
            ct = 0

print(maxct)
Problem p02947 (python)

Fixed submission:
## from collections import Counter
from collections import Counter

N=int(input())
Word_List=[]

for i in range(N):
    Temp_Word=''.join(sorted(input()))
    Word_List.append(Temp_Word)

Word_Count=Counter(Word_List)
Word_PairCount_List = []

for i in Word_Count.values():
    if i > 1 :
        Word_PairCount_List.extend(range(i))

print(sum(Word_PairCount_List))

Buggy submission (verdict: Runtime Error):
#Guide Book https://atcoder.jp/contests/abc128/tasks/abc128_b
N = int(input())
Shop_List=[]
for i in range(N):
    Temp_List=list(input().split())
    Temp_List[1]=int(Temp_List[1])
    Temp_List.append(i+1)
    Shop_List.append(Temp_List)


Shop_List_Sorted = sorted(Shop_List, key=lambda x:(x[0], -x[1]))
for k in range(N):
    print(Shop_List_Sorted[k][2])
Problem p02983 (python)

Fixed submission:
import itertools

L,R = map(int,input().split())
if R - L + 1 >= 2019:
    ans = 0
else:
    LL = L % 2019
    RR = R % 2019
    if LL < RR:
        Amari_List = list(range(LL,RR+1))
        ans = 2019
        for v1,v2 in itertools.combinations(Amari_List, 2):
            ca = (v1*v2) % 2019 
            if  ca < ans:
                ans = ca
    else:
        ans = 0

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

L,R = map(int,input().split())
N_List = list(range(L,R+1))
N = len(N_List)
if N >= 2019:
    ans = 0
else:
    F = N_List[0] % 2019
    L = N_List[-1] % 2019
    if F < L:
        ans = 2019
        Amari_List = list(range(F,L+1))
        for v1,v2 in itertools.combinations(Amari_List, 2):
            ca = v1*v2 % 2019 
            if  ca < ans:
                ans = ca
    else:
        ans = 0

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

L,R = map(int,input().split())
N_List = list(range(L,R+1))
N = len(N_List)
if N >= 2019:
    ans = 0
else:
    F = N_List[0] % 2019
    L = N_List[-1] % 2019
    if F < L:
        ans = 2019
        Amari_List = list(range(F,L+1))
        for v1,v2 in itertools.combinations(Amari_List, 2):
            if v1*v2 < ans:
                ans = v1*v2
    else:
        ans = 0

print(ans)
Problem p02999 (python)

Fixed submission:
N,M = map(int,input().split())
print(("0","10")[N >= M])

Buggy submission (verdict: Runtime Error):
W,H,x,y = map(int,input().split())
flg = 0
if W/2 == x and H/2 ==y:
    ans = (W*H)/2
    flg = 1
elif W/2 == x or H/2 ==y:
    ans = (W*H)/2
    flg = 0
else:
    tatemax = min(W-x,x)*H
    yokomax = min(H-y,y)*W
    if tatemax == yokomax:
        ans = tatemax
        flg =1
    else:
        ans = max(tatemax,yokomax)
        flg =0
print(str(ans)+ " " + str(flg))