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

Fixed submission:
def main():
    from collections import deque
 
    n,m =map(int,input().split())
    abl=[[] for i in range(n+1)]
    for i in range(m):
        a,b = map(int,input().split())
        abl[a].append(b)
        abl[b].append(a)
 
    an=[0]*(n+1)
    an[0]=1
    tg = deque([1])
    while len(tg):
        itg = tg.popleft()
        for j in abl[itg]:
            if an[j]==0:
                an[j]=itg
                tg.append(j)

    if all(an):
        print('Yes')
        for j in an[2:]:
            print(j)
    else:
        print('No')
 
main()

Buggy submission (verdict: Runtime Error):
import numpy as np
import sys

n,m = map(int,input().split())
ab = [[int(i) for i in input().split()] for i in range(m)]

an=[0]*(n-1)
wk=[0]*n
awk=np.array(wk)
aab=np.array(ab)
tg =[1]
wtg=[]

while not(all(an)):# or len(aab)<=0:
    if len(aab)<=0:
        break
    for i in tg:
        awk=aab[np.any(aab==i,axis=1)]
        for j in range(len(awk)):
            if awk[j][0]==i:
                if an[awk[j][1]-2]==0:
                    an[awk[j][1]-2]=i
                    wtg.append(awk[j][1])
            else:
                if an[awk[j][0]-2]==0:
                    an[awk[j][0]-2]=i
                    wtg.append(awk[j][0])
            aab=aab[~np.any(aab==tg,axis=1)]

    tg=list(wtg)
    wtg=[]
if all(an):
    print('Yes')
    for i in an:
        print(i)
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np
import sys

n,m = map(int,input().split())
ab = [[int(i) for i in input().split()] for i in range(m)]

an=[0]*(n-1)
wk=[0]*n
awk=np.array(wk)
aab=np.array(ab)
tg =[1]
wtg=[]

while not(all(an)):# or len(aab)<=0:
    if len(aab)<=0:
        break
    for i in tg:
        awk=aab[np.any(aab==i,axis=1)]
        for j in range(len(awk)):
            if awk[j][0]==i:
                if an[awk[j][1]-2]==0:
                    an[awk[j][1]-2]=i
                    wtg.append(awk[j][1])
            else:
                if an[awk[j][0]-2]==0:
                    an[awk[j][0]-2]=i
                    wtg.append(awk[j][0])
            aab=aab[~np.any(aab==tg,axis=1)]

    tg=list(wtg)
    wtg=[]
if all(an):
    print('Yes')
    for i in an:
        print(i)
else:
    print('No')
Problem p02730 (python)

Fixed submission:
import sys
s = input()

n = len(s)
m = int((n-1)/2)
b = s[:m]

for i in range(int(m/2)):
    if b[i:(i+1)] != b[(m-i-1):m-i]:
        print('No')
        sys.exit()
m = int((n+3)/2)
b = s[m-1:]
m= len(b)
for i in range(int(m/2)):
    if b[i:(i+1)] != b[(m-i-1):m-i]:
        print('No')
        sys.exit()
for i in range(int(n/2)):
    if s[i:(i+1)] != s[(n-i-1):n-i]:
        print('No')
        sys.exit()  
print('Yes')

Buggy submission (verdict: Runtime Error):
b = s[:m]

for i in range(int(m/2)):
    if b[i:(i+1)] != b[(m-i-1):m-i]:
        print('No')
        sys.exit()
m = int((n+3)/2)
b = s[m-1:]
m= len(b)
for i in range(int(m/2)):
    if b[i:(i+1)] != b[(m-i-1):m-i]:
        print('No')
        sys.exit()
print('Yes')
Problem p02755 (python)

Fixed submission:
import math

a,b = map(int,input().split())

motoa = a/0.08

motob = b/0.1
a += 1
b += 1
xmotoa = a/0.08
xmotob = b/0.1

if motoa < motob <xmotoa:
    print(math.ceil(motob))
elif motoa < xmotob <xmotoa:
    print(math.ceil(motoa))
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())

motob = b/0.1
a += 0.999
xmotoa = a/0.08

print(xmotoa,xmotob)
if xmotoa >= motob:
    print(math.ceil(motoa))
else:
    print('-1')
Problem p02761 (python)

Fixed submission:
import sys

def ans(anl,n):
    an = 0
    for i in range(n):
        an += 10**(n-i-1)*anl[i]
    return(an)

n,m = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(m)]

sc.sort(key=lambda x:x[0])
sc.sort()
anl =[0 for i in range(n)]
anl[0] = 1

if m == 0:
    if n == 1:
        print(0)
        sys.exit()
    else:
        print(10**(n-1))
        sys.exit()
if m == 1:
    if sc[0][1] == 0 and n == 1:
        print(0)
        sys.exit()
    anl[sc[0][0]-1] = sc[0][1]
    if anl[0] == 0:
        print('-1')
        sys.exit()
    print(ans(anl,n))
    sys.exit()

for i in range(m):
    for j in range(1,m):
        if sc[i][0] == sc[j][0] and sc[i][1]!=sc[j][1]:
            print('-1')
            sys.exit()
        else:
            anl[sc[i][0]-1] = sc[i][1]

if anl[0] == 0:
    print('-1')
    sys.exit()

print(ans(anl,n))

Buggy submission (verdict: Runtime Error):
import sys

n,m = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(m)]

sc.sort(key=lambda x:x[0])
sc.sort()
anl =[0 for i in range(n)]
an = 0

if sc[0][1]==0:
    if n>1:
        print('-1')
        sys.exit()
    else:
        print(0)
        sys.exit()

for i in range(m):
    for j in range(1,m):
        if sc[i][0] == sc[j][0] and sc[i][1]!=sc[j][1]:
            print('-1')
            sys.exit()
        else:
            anl[sc[i][0]-1] = sc[i][1]

if anl[n-1]==0:
    print('-1')
    sys.exit()

for i in range(n):
    an += 10**(n-i-1)*anl[i]
print(an)

Buggy submission (verdict: Runtime Error):
import sys

n,m = map(int,input().split())
a = []
wk =[]
kai = 0
for i in range(m):
    wk = (list(map(int,input().split())))
    if wk in a:
        m -= 1
    else:
        a.append(wk)

a.sort()

if a[0][1] == 0:
        print('-1')
        sys.exit()
for i in range(m):
    if a[i][1]==n and a[i][1]==0:
        print('-1')
        sys.exit()
for i in range(m-1):
    if a[i][0] == a[i+1][0]:
        print('-1')
        sys.exit()

for i in range(m):
    kai += (10**(n-a[i][0]))*a[i][1]

print(kai)

Buggy submission (verdict: Runtime Error):
import sys

n,m = map(int,input().split())
a = []
wk =[]
kai = 0
for i in range(m):
    wk = (list(map(int,input().split())))
    if wk in a:
        m -= 1
    else:
        a.append(wk)

a.sort()

if a[0][1] == 0:
        print('-1')
        sys.exit()
for i in range(m):
    if a[i][1]==n and a[i][1]==0:
        print('-1')
        sys.exit()
for i in range(m-1):
    if a[i][0] == a[i+1][0]:
        print('-1')
        sys.exit()

for i in range(m):
    kai += (10**(n-a[i][0]))*a[i][1]

print(kai)
Problem p02772 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = []
wk = wk1 = 0

for i in range(n):
    if a[i]%2 == 0:
        b.append(a[i])

for j in range(len(b)):
    if b[j]%3 == 0 or b[j]%5 == 0:
        wk = 1
    else:
        wk1 = 1
if wk1 == 1:
    print('DENIED')
else:
    print('APPROVED')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b = []
wk = wk1 = 0

for i in range(n):
    if a[i]%2 == 0:
        b.append(a[i])

for j in range(len(b)):
    if b[j]%3 == 0 or b[j]%5 == 0:
        wk = 1
    else:
        wk1 = 1
if wk1 == 1:
    print('DENIED')
else:5
    print('APPROVED')
Problem p02780 (python)

Fixed submission:
n,k = map(int,input().split())
li = list(map(int,input().split()))
li = list(map(lambda x:(x+1)/2,li))

wk = 0
nn = n-k

for i in range(0,k):
    wk += li[i]
kwk = wk
for j in range(nn):
    wk = wk - li[j]
    wk = wk + li[j+k]
    kwk = max(wk,kwk)
 
print(kwk)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
li = list(map(int,input().split()))
li = list(map(lambda x:(x+1)/2,li))
wk = 0
nn = n-k+1
kai = [None]*(nn)

for y in range(nn):
    wk = 0
    for x in range(y,k+y):
        wk = wk + li[x]
    kai[x] = wk
 
print(max(kai))
Problem p03047 (python)

Fixed submission:
def L():
    return list(map(int, input().split()))

[N,K]=L()


print(N-K+1)

Buggy submission (verdict: Runtime Error):
[N,K]=L()

def L():
    return list(map(int, input().split()))
print(N-K+1)
Problem p03437 (python)

Fixed submission:
def L():
    return list(map(int, input().split()))

[x,y]=L()

if x%y==0:
  print(-1)
else:
  print(x)

Buggy submission (verdict: Runtime Error):
def L():
    return list(map(int, input().split()))

[x,y]=L()

if x%y==0:
  print(-1)
else:
  print x
Problem p02582 (python)

Fixed submission:
s = input()

if "RRR" in s:
    print(3)
elif "RR" in s:
    print(2)
elif "R" in s:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import re

pattern = re.compile("R+")
print(len(re.search(pattern, input()).group(0)))
Problem p02658 (python)

Fixed submission:
a = int(input())
li = list(map(int,input().split()))
total = 1
i = 1
for i in range(a):
    total = total*li[i]
    if total > 1000000000000000000:
        total = -1
        break
for i in range(a):
    if li[i] == 0:
        total = 0

print(total)

Buggy submission (verdict: Runtime Error):
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
    double sr;
    long long int lr;
    cin >> lr >> sr;

    cout << (long long int)(double(lr%1000) * sr)+(lr/1000)*((long long int)(sr*1000)) << endl;
}
Problem p02576 (python)

Fixed submission:
import math
n, x, t = map(int, input().split())
if n % x == 0:
    c = n / x
else:
    b = n / x
    c = math.ceil(b)
a = int(c * t)
print(a)

Buggy submission (verdict: Runtime Error):
import math
N,X,T=float(int,input().split())
B=math.ceil(N/X)
A=T*B
print(A)

Buggy submission (verdict: Runtime Error):
from math import ceil,floor
N,X,T=input().split()
A=T*(ceil(N/X))
print(A)

Buggy submission (verdict: Runtime Error):
import math
N,X,T=input().split()
B=math.ceil(N/X)
A=T*B
print(A)

Buggy submission (verdict: Runtime Error):
import math
N,X,T=map(int,input().split))
B=math.ceil(N/X)
A=T*B
print(A)

Buggy submission (verdict: Runtime Error):
import math
N,X,T=map(int,input().split))
A=T*(math.ceil(N/X))
print(A)
Problem p03280 (python)

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

print(a * b - (a + b - 1))

Buggy submission (verdict: Runtime Error):
input_lines = raw_input().split()
a = int(input_lines[0])
b = int(input_lines[1])

print(a * b - (a + b - 1))
Problem p03351 (python)

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

flag = 0
if abs(c - a) > d:
    if abs(b - a) > d or abs(c - b) > d:
        flag = 1

if flag == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X = int(input())

max = 1
for i in range(1,X+1):
    for j in range(2,i+1):
        for k in range(2,j+1):
            if j ** k == i:
                max = i
            if j ** k > i:
                break

print(max)

Buggy submission (verdict: Runtime Error):
X = int(input())

max = 1
for i in range(1,X+1):
    for j in range(2,i+1):
        for k in range(2,j+1):
            if j ** k == i:
                max = i
            if j ** k > i:
                break

print(max)

Buggy submission (verdict: Runtime Error):
X = int(input())

max = 1
for i in range(1,X+1):
    for j in range(2,i+1):
        for k in range(2,j):
            if j ** k == i:
                max = i
            if j ** k > i:
                break

print(max)

Buggy submission (verdict: Runtime Error):
input_lines = raw_input().split()
a = int(input_lines[0])
b = int(input_lines[1])
c = int(input_lines[2])
d = int(input_lines[3])

flag = 0
if abs(c - a) > d:
    if abs(b - a) > d or abs(c - b) > d:
        flag = 1

if flag == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
input_lines = raw_input().split()
a = int(input_lines[0])
b = int(input_lines[1])
c = int(input_lines[2])
d = int(input_lines[3])

flag = 0
if abs(c - a) > d:
    if abs(b - a) > d or abs(c - b) > d:
        flag = 1

if flag == 0:
    print("Yes")
else:
    print("No")
Problem p03061 (python)

Fixed submission:
import fractions
N = int(input())
A = list(map(int, input().split()))

L = [0]
R = [0]

for i in range(N):
    L.append(fractions.gcd(L[i], A[i]))
    R.append(fractions.gcd(R[i], A[N - i - 1]))

ans = 0
for i in range(N):
    t = fractions.gcd(L[i], R[N - i - 1])
    ans = max(t, ans)

print(ans)

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

L = [0]
R = [0]

for i in range(N):
    L.append(fractions.gcd(L[i], A[i]))
    R.append(fractions.gcd(R[i], A[N - i - 1]))

ans = 0
for i in range(N):
    t = fractions.gcd(L[i], R[N - i - 1])
    ans = max(t, ans)

print(ans)
Problem p03261 (python)

Fixed submission:
def main():
    N = int(input())
    w = []
    for i in range(N):
        w.append(input())
        if i == 0:
            continue
        if w[i][0] != w[i-1][-1]:
            print('No')
            return

    if N == len(set(w)):
        print('Yes')
    else:
        print('No')

main()

Buggy submission (verdict: Runtime Error):
N = int(input())
w = []
for i in range(N):
    w.append(input())
    if i ==0:
        continue
    if w[i][0] !=  w[i-1][-1]:
        print('No')
        return

if N == len(set(w)):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
w = []
for i in range(N):
    w.append(input())
    if i ==0:
        continue
    if w[i][0] !=  w[i-1][-1]:
        print('No')
        return

if N == len(set(w)):
    print('Yes')
else:
Problem p03486 (python)

Fixed submission:

def main():
    S = input()
    T = input()

    s1 = [ord(s) - ord('a') for s in S]
    t1 = [ord(t) - ord('a') for t in T]

    s1.sort()
    t1.sort(reverse=True)


    for i, j in zip(s1, t1):
        if i < j:
            print('Yes')
            return

    if (len(s1) < len(t1)) & (i > j):
        print('No')
        return
    elif (len(s1) < len(t1)):
        print('Yes')
        return

    print('No')

main()

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

s1 = [ord(s) - ord('a') for s in S]
t1 = [ord(t) - ord('a') for t in T]

s1.sort()
t1.sort(reverse=True)

print(s1, t1)

for i, j in zip(s1, t1):
    if i < j:
        print('Yes')
        return

if (len(s1) < len(t1)) & (i > j):
    print('No')
    return
elif (len(s1) < len(t1)):
    print('Yes')
    return

print('No')
Problem p03171 (python)

Fixed submission:
from sys import stdin, stdout


def solve():
    n = int(input())
    A = [int(i) for i in stdin.readline().split()]
    dp = [[i,0] for i in A]
    t = [[0,0] for _ in range(len(A))]
    for i in range(1, len(A)):
        for j in range(i, len(A)):
            l = A[j-i] + dp[j][1]
            r = A[j] + dp[j-1][1]
            if l > r:
                t[j][0] = l
                t[j][1] = dp[j][0]
            else:
                t[j][0] = r
                t[j][1] = dp[j-1][0]
        dp = t
        t = [[0,0] for _ in range(len(A))]
    return dp[-1][0] - dp[-1][1]


print(solve())

Buggy submission (verdict: Runtime Error):
from sys import stdin, stdout



def solve():
    n = int(input())
    A = [int(i) for i in stdin.readline().split()]
    dp = [[i,0] for i in A]
    t = [[0,0] for _ in range(len(A))]
    for i in range(1, len(A)):
        for j in range(i, len(A)):
            l = A[j-i] + dp[j][1]
            r = A[j] + dp[j-1][1]
            if l > r:
                t[j][0] = l
                t[j][1] = dp[j][0]
            else:
                t[j][0] = r
                t[j][1] = dp[j-1][0]
        dp = t.copy()
        t = [[0,0] for _ in range(len(A))]
    return dp[-1][0] - dp[-1][1]


print(solve())
Problem p02641 (python)

Fixed submission:
x, n = map(int, input().split())
li = list(map(int, input().split()))
li.sort()
if len(li) == 0:
    print(x)
    exit()
x1 = x
while x1 in li:
    x1 -= 1
x2 = x
while x2 in li:
    x2 += 1
if x-x1 > x2-x:
    print(x2)
else:
    print(x1)

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
li = list(map(int, input().split()))
li.sort()
if len(li) == 0:
    print(x)
    exit()
x1 = x - 1
x2 = x + 1
li1 = []
li2 = []
while x1 >= x - 10:
    if x1 not in li:
        li1.append(x1)
    x1 -= 1
li1.sort(reverse=True)
while x2 <= x + 10:
    if x2 not in li:
        li2.append(x2)
    x2 += 1
li2.sort()
if x - li1[0] > li2[0] - x:
    print(li2[0])
else:
    print(li1[0])
Problem p02658 (python)

Fixed submission:
n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)

Buggy submission (verdict: Runtime Error):
n = input()
li = list(map(int, input().split()))
a = 1
if 0 in li:
    print(0)
else:
    for x in li:
    a *= x
    if a > 10**18:
        print(-1)
    else:
        print(a)

Buggy submission (verdict: Runtime Error):
n = input()
li = list(map(int, input().split()))
a = 1
for x in li:
    a *= x
if a > 10**18:
    print(-1)
elif n > 10**5:
    print(-1)
else:
    print(a)
Problem p03635 (python)

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

Buggy submission (verdict: Runtime Error):
n, m = [map(int, input().split()) for i in range(2)]
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n, m = [int(input()) for i in range(2)]
print((n-1)*(m-1))
Problem p02606 (python)

Fixed submission:
l,r,d=map(int,input().split())
print(r//d-(l-1)//d)

Buggy submission (verdict: Runtime Error):
l,r,d=map(int(input()).split())
print(r//d-(l-1)//d)
Problem p02741 (python)

Fixed submission:
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]
k=int(input())
print(a[k-1])

Buggy submission (verdict: Runtime Error):
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]
k=int(input())
print(a(k-1))
Problem p02801 (python)

Fixed submission:
c=input()
alp="abcdefghijklmnopqrstuvwxyz"
for i in range(25):
  if c==alp[i]:
    print(alp[i+1])
    break

Buggy submission (verdict: Runtime Error):
c=input()
alp="abcdefghijklmnopqrstuvwxyz"
for i in range(25):
  if c==alp[i]:
    print(alh[i+1])
    break
Problem p02853 (python)

Fixed submission:
x,y=map(int, input().split())
coin=0
if x==1 and y==1:
  coin+=400000
if x==1:
  coin+=300000
if y==1:
  coin+=300000
if x==2:
  coin+=200000
if y==2:
  coin+=200000
if x==3:
  coin+=100000
if y==3:
  coin+=100000
print(coin)

Buggy submission (verdict: Runtime Error):
x,y=map(int, input())
coin=0
if x==1 and y==1:
  coin+=400000
if x==1:
  coin+=300000
if y==1:
  coin+=300000
if x==2:
  coin+=200000
if y==2:
  coin+=200000
if x==3:
  coin+=100000
if y==3:
  coin+=100000
print(coin)
Problem p03284 (python)

Fixed submission:
n,k=map(int, input().split())
if n%k==0:
  print("0")
else:
  print("1")

Buggy submission (verdict: Runtime Error):
n,k=map(int, input())
if n%k==0:
  print("0")
else:
  print("1")
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())
if b-a+1>2k:
  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)
Problem p03469 (python)

Fixed submission:
s=input()
print(s[:3]+"8"+s[4:])

Buggy submission (verdict: Runtime Error):
s=input()
print(s[:2]+"8"+s[4:]
Problem p03486 (python)

Fixed submission:
s=input()
t=input()
new_s=sorted(s)
new_s="".join(new_s)
new_t=sorted(t,reverse=True)
new_t="".join(new_t)
if new_s<new_t:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
s=s.sort()
t=t.sort(reverse=True)
if s<t:
  print("Yes")
else:
  print("No")
Problem p03624 (python)

Fixed submission:
s=input()
alp="abcdefghijklmnopqrstuvwxyz"
ans="None"
for i in alp:
  exist=False
  if i in s:
    exist=True
  if not exist:
    ans=i
    break
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
alh="abcdefghijklmnopqrstuvwxyz"
exist=False
ans="None"
for i in alf:
  if i in s:
    exist=True
  if not exist:
    ans=i
    break
print(ans)
Problem p03658 (python)

Fixed submission:
n,k=map(int, input().split())
l=list(map(int, input().split()))
l.sort(reverse=True)
length=0
for i in range(k):
  length+=l[i]
print(length)

Buggy submission (verdict: Runtime Error):
n,k=int(input())
l=list(map(int, input().split()))
l.sort(reverse=True)
length=0
for i in range(k):
  length+=l[i]
print(length)
Problem p03680 (python)

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
bu=0
end=-1
for i in range(n):
  if bu==1:
    end=i
    break
  bu=a[bu]-1
print(end)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[input() for i in range(n)]
bu=0
end=-1
for i in range(n):
   if bu==1:
    end=i-1
    break
  bu=a[bu]-1
print(end)
Problem p03720 (python)

Fixed submission:
n,m=map(int, input().split())
road_num=[0]*n
for i in range(m):
  a,b=map(int, input().split())
  road_num[a-1]+=1
  road_num[b-1]+=1
for i in range(n):
  print(road_num[i])

Buggy submission (verdict: Runtime Error):
n,m=map(int, input().split())
road_num=[0]*n
for i in range(m):
  a,b=map(int, input().split())
  road_num[a]+=1
  road_num[b]+=1
for i in range(n):
  print(road_num[i])
Problem p03738 (python)

Fixed submission:
a=input()
b=input()
if len(a)==len(b):
  if a==b:
    print("EQUAL")
  elif a<b:
    print("LESS")
  else:
    print("GREATER")
elif len(a)<len(b):
  print("LESS")
else:
  print("GREATER")

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
if len(a)==len(b):
  if a==b:
    print("EQUAL")
  elif a<b:
    print("LESS")
  else a>b:
    print("GREATER")
elif len(a)<len(b):
  print("LESS")
else:
  print("GREATER")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
if a==b:
  print("EQUAL")
elif a<b:
  print("LESS")
else:
  print("GREATER")
Problem p03760 (python)

Fixed submission:
o=input()
e=input()
pw=""
for i in range(len(o)+len(e)):
  if i%2==0:
    pw=pw+o[i//2]
  else:
    pw=pw+e[i//2]
print(pw)

Buggy submission (verdict: Runtime Error):
o=input()
e=input()
pw=""
for i in range(len(o)+len(e)):
  if i%2==0:
    pw=pw+e[i//2]
  else:
    pw=pw+o[i//2]
print(pw)
Problem p03814 (python)

Fixed submission:
s=input()
a_min=0
z_max=0
for i in range(len(s)):
  if s[i]=="A":
    a_min=i
    break
for i in range(len(s)):
  if s[i]=="Z":
    z_max=i
print(z_max-a_min+1)

Buggy submission (verdict: Runtime Error):
s=input()
a_min=0
z_max=0
for i in s:
  if s[i]=="A":
    a_min=i
    break
for i in s:
  if s[i]=="Z":
    z_max=i
print(z_max-a_min+1)
Problem p03844 (python)

Fixed submission:
a,op,b=input().split()
a=int(a)
b=int(b)
if op=="+":
  print(a+b)
if op=="-":
  print(a-b)

Buggy submission (verdict: Runtime Error):
a,op,b=input().split()
a=int(a)
b=int(b)
if op="+":
  print(a+b)
if op="-":
  print(a-b)
Problem p03861 (python)

Fixed submission:
a,b,x=map(int, input().split())
max=b//x
min=(a+x-1)//x
print(max-min+1)

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
max=b//x
min=(a+x-1)//x
print(max-min+1)

Buggy submission (verdict: Runtime Error):
a,b,x=map(int, input())
n=x*((a+x-1)//x)
cnt=0
while n<=b:
  cnt+=1
  n+=x
print(cnt)
Problem p03919 (python)

Fixed submission:
h,w=map(int, input().split())
s=[list(input().split()) for i in range(h)]
alp="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(h):
  for j in range(w):
    if s[i][j]=="snuke":
      print(alp[j]+str(i+1))
      break

Buggy submission (verdict: Runtime Error):
h,w=map(int, input().split())
s=[list(input().split()) for i in range(h)]
alp="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(h):
  for j in range(w):
    if s[i][j]=="snuke":
      print(alp[j+1]+(i+1))
      break