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

Fixed submission:
import numpy as np
H, W = list(map(int, input().split()))
count = 0
s = np.array([['d']*(W+2)]*(H+2))

for i in range(1, H+1):
    mojiretu = input()
    for j in range(1, W+1):
        s[i][j] = mojiretu[j-1]


def handan():
    for i in range(1, H+1):
        for j in range(1, W+1):
            if s[i][j] == '#':
                if (s[i-1][j] == ('.' or 'd')) and (s[i+1][j] == ('.' or 'd')) and (s[i][j-1] == ('.' or 'd')) and (s[i][j+1] == ('.' or 'd')):
                    return 'No'
    return 'Yes'

print(handan())

Buggy submission (verdict: Runtime Error):
H, W = list(map(int, input().split()))
count = 0
s = [[None]*(W+2)]*(H+2)

for i in range(1, H+1):
    s[i] = input().split()

for i in range(1, H+1):
    for j in range(1, W+1):
        if s[i][j] == '#':
            if s[i-1][j] == '.' and s[i+1][j] == '.' and s[i][j-1] == '.' and s[i][j+1] == '.':
                print(No)
                break

count_list = [[i, j] for i in range(1, H+1) for j in range(1 W+1) if s[i][j] == '#']
count_black = len(count_list)

if count == count_list:
    print(Yes)
Problem p03415 (python)

Fixed submission:
sanmoji=[0]*3
for i in range(3):
    sanmoji[i] = input()[i]

moji=""
for i in range(3):
    moji += sanmoji[i]
print(moji)

Buggy submission (verdict: Runtime Error):
K = input().split()
N = int(K[0])
K = int(K[1])

count = 0
for b in range(K+1, N+1):
        count += int((N+K*(K+1)/2-(b-2)*(b-1)/2)/b)


if K != 0:
    for a in range(K, N+1):
        count += N-a
if K == 0:
        for a in range(1, N+1):
            count += N-a

print(count)

Buggy submission (verdict: Runtime Error):
K = input().split()
N = int(K[0])
K = int(K[1])

count = 0
for b in range(K+1, N+1):
        count += int((N-K*(K+1)/2+(b-2)*(b-1)/2)/b)


if K != 0:
    for a in range(K, N+1):
        count += N-a
if K == 0:
        for a in range(1, N+1):
            count += N-a

print(count)

Buggy submission (verdict: Runtime Error):
sanmoji=[]
for i in range(3):
    sanmoji[i] = input()[i]
print(sanmoji)
Problem p03417 (python)

Fixed submission:
K = input().split()
N = int(K[0])
M = int(K[1])

if N >= 2 and M >= 2:
    print((N-2)*(M-2))
elif N == 1 and M >= 2:
    print(M-2)
elif N >= 2 and M == 1:
    print(N-2)
elif N == 1 and M == 1:
    print(1)

Buggy submission (verdict: Runtime Error):
import numpy as np
K = input().split()
N = int(K[0])
M = int(K[1])

hairetu = np.ones((N+2, M+2))

for i in range(M+2):
    hairetu[0][i] = 0
    hairetu[N+1][i] = 0
for i in range(N+2):
    hairetu[i][0] = 0
    hairetu[i][M+1] = 0

for i in range(1, N+1):
    for j in range(1, M+1):
        for k in range(-1, 2):
            for l in range(-1, 2):
                hairetu[i+k][j+l] = (-1) * hairetu[i+k][j+l]


count = 0

for i in range(1, N+1):
    for j in range(1, M+1):
        if hairetu[i][j] == -1:
            count += 1


print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np
K = input()
N = int(K[0])
M = int(K[1])

hairetu = np.ones((N+2, M+2))

for i in range(M+2):
    hairetu[0][i] = 0
    hairetu[N+1][i] = 0
for i in range(N+2):
    hairetu[i][0] = 0
    hairetu[i][M+1] = 0

for i in range(1, N+1):
    for j in range(1, M+1):
        for k in range(-1, 2):
            for l in range(-1, 2):
                hairetu[i+k][j+l] = (-1) * hairetu[i+k][j+l]


count = 0

for i in range(1, N+1):
    for j in range(1, M+1):
        if hairetu[i][j] == -1:
            count += 1


print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np
K = input()
print(K)
N = int(K[0])
M = int(K[1])

hairetu = np.ones((N+2, M+2))

for i in range(M+2):
    hairetu[0][i] = 0
    hairetu[N+1][i] = 0
for i in range(N+2):
    hairetu[i][0] = 0
    hairetu[i][M+1] = 0

for i in range(1, N+1):
    for j in range(1, M+1):
        for k in range(-1, 2):
            for l in range(-1, 2):
                hairetu[i+k][j+l] = (-1) * hairetu[i+k][j+l]


print(hairetu)
count = 0

for i in range(1, N+1):
    for j in range(1, M+1):
        if hairetu[i][j] == -1:
            count += 1


print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
M = int(input())

hairetu = np.ones((N+2, M+2))

for i in range(M+2):
    hairetu[0][i] = 0
    hairetu[N+1][i] = 0
for i in range(N+2):
    hairetu[i][0] = 0
    hairetu[i][M+1] = 0

for i in range(1, N+1):
    for j in range(1, M+1):
        for k in range(-1, 2):
            for l in range(-1, 2):
                hairetu[i+k][j+l] = (-1) * hairetu[i+k][j+l]


print(hairetu)
count = 0

for i in range(1, N+1):
    for j in range(1, M+1):
        if hairetu[i][j] == -1:
            count += 1


print(count)
Problem p03418 (python)

Fixed submission:
K = input().split()
N = int(K[0])
K = int(K[1])

count = 0
for b in range(K+1, N+1):
    siki1 = int((N-K)/b)
    siki2 = int((N-b+1)/b)
    if siki1 <= siki2:
        count += (b-K)*siki1
    elif siki1 > siki2:
        count += (b-K)*siki1
        count -= (b-N-1)*(siki1 - siki2)
        count -= b*(int((siki1*(siki1+1))/2) - int((siki2*(siki2+1))/2))

if K != 0:
    for a in range(K, N+1):
        count += N-a
if K == 0:
        for a in range(1, N+1):
            count += N-a

print(count)

Buggy submission (verdict: Runtime Error):
count = 0
for b in range(K+1, N+1):
        count += (b-K)*int((N-b+1)/b)


if K != 0:
    for a in range(K, N+1):
        count += N-a
if K == 0:
        for a in range(1, N+1):
            count += N-a

print(count)
Problem p03106 (python)

Fixed submission:
# coding: utf-8
a, b, k = map(int, input().split())

mi = min(a, b)
c = 0
for i in range(mi+1, 0, -1):
    if a%i == 0 and b%i == 0:
        c += 1
    if c == k:
        break
print(i)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
a, b, k = map(int, input().split())

mi = min(a, b)
c = 0
for i in range(1, mi):
    if a%i == 0 and b%i == 0:
        c += 1
    if c == k:
        break
print(i)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
a, b, k = map(int, input().split())

if a > b:
    max = a
else:
    max = b
c = 0
for i in range(1, max):
    if a%i == 0 and b%i == 0:
        print(i)
        c += 1
    if c == k:
        break
print(i)
Problem p03105 (python)

Fixed submission:
def main():
  A, B, C = map(int, input().split(" "))
  count = B // A
  print(min(count, C))
  
if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  A, B, C = input().split(" ")
  count = B // A
  return min(count, C)
  
if __name__ == '__main__':
  main()
Problem p03106 (python)

Fixed submission:
def main():
  A, B, K = map(int, input().split(" "))
 
  i = 1
  result = []
  while i <= min(A, B):
    if A % i == 0 and B % i == 0:
      result.append(i)
    i += 1
  print(result[-K])
  
if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  A, B, K = map(int, input().split(" "))
 
  i = 1
  result = []
  while i <= min(A, B):
    if A % i == 0 and B % i == 0:
      result.append(i)
    i += 1
  print(result[-K])
 
 if __name__ == '__main__':
  main()
Problem p03102 (python)

Fixed submission:
N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
A = []

cnt = 0
for _ in range(N):
    A = list(map(int, input().split()))
    score = C
    for a, b in zip(A, B):
        score += a*b
    if score > 0:
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M, C = list(map(int, input().split()))
B = np.array(list(map(int, input().split())))
A = []

cnt = 0
for _ in range(N):
    if np.array(list(map(int, input().split()))) @ B + C > 0:
        cnt += 1

print(cnt)
Problem p03773 (python)

Fixed submission:
def main():
    A, B = tuple(map(int, input().split(' ')))
    print('{}'.format((A+B)%24))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    N, M = tuple(map(int, input().split(' ')))
    man_list = []
    point_list = []
    for i in range(N):
        man_list.append(tuple(map(int, input().split(' '))))
    for i in range(M):
        point_list.append(tuple(map(int, input().split(' '))))

    result = []
    for i, man in enumerate(man_list):
        a, b = man
        min_ = float('inf')
        for j, point in enumerate(point_list):
            c, d = point
            v = abs(a-c)+ abs(b-d)
            if len(result) < i+1:
                min_ = v
                result.append(j+1)
                continue
            if v < min_:
                result[i] = j+1
                min_ = v


    for r in result:
        print('{}'.format(r))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    A, B = tuple(map(int, raw_input().split(' ')))
    print('{}'.format((A+B)%24))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    A, B = raw_input().split(' ')
    print('{}'.format((A+B)%24))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

def main():
    A, B = raw_input()
    print('{}'.format((A+B)%24))


if __name__ == '__main__':
    main()
Problem p03469 (python)

Fixed submission:
a=input()
print(a.replace("2017","2018"))

Buggy submission (verdict: Runtime Error):
2017/01/07
Problem p03671 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(input().split())
A=[a,b,c]
if a<=max(A) and b<=max(A):
    print(a+b)
elif b<=max(A) and c<=max(A):
    print(b+c)
elif c<=max(A) and a<=max(A):
    print(a+c)
Problem p03148 (python)

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

def main():
    [N, K] = list(map(int, input().split()))
    s_list = []
    for i in range(N):
        s_list.append(list(map(int, input().split())))

    s_list.sort(key = lambda v: v[1], reverse = True)
    n_set = set()
    A, B = [0], [0]
    tot_a, tot_b = 0, 0
    for td in s_list:
        if not td[0] in n_set:
            n_set.add(td[0])
            tot_a += td[1]
            A.append(tot_a)
        else:
            tot_b += td[1]
            B.append(tot_b)

    min_n = max(1, K - (len(B) - 1))
    max_n = min(K + 1, len(A))
    max_x = 0
    for i in range(min_n, max_n):
        max_x = max(max_x, A[i] + i ** 2 + B[K - i])

    print(max_x)


if __name__ == '__main__':
    main()

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

def main():
    [N, K] = list(map(int, input().split()))
    s_list = []
    for i in range(N):
        s_list.append(list(map(int, input().split())))

    s_list.sort(key = lambda v: v[1], reverse = True)
    n_set = set()
    A, B = [0], [0]
    tot_a, tot_b = 0, 0
    for td in s_list:
        if not td[0] in n_set:
            n_set.add(td[0])
            tot_a += td[1]
            A.append(tot_a)
        else:
            tot_b += td[1]
            B.append(tot_b)

    min_n = max(1, K - (len(B) - 1))
    max_x = 0
    for i in range(min_n, len(A)):
        max_x = max(max_x, A[i] +i ** 2 + B[K - i])

    print(max_x)


if __name__ == '__main__':
    main()
Problem p03249 (python)

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

sys.setrecursionlimit(101010)

def dfs(v, adj_list, depth, visited):
    visited[v] = True
    x = depth
    for w in adj_list[v]:
        if not visited[w]:
            x += dfs(w, adj_list, depth + 1, visited)

    return x


def solve(n, d):

    if n < 7:
        print(-1)
        return

    d.sort()
    w = [1] * n
    edges = []
    adj_list = [[] for _ in range(n)]
    for j in range(n - 1, 0, -1):
        di, i = d[j]
        pdi = di - n + 2 * w[i]
        p = None
        lo, hi = 0, j
        while lo < hi:
            mid = (lo + hi) // 2
            xdi, xi = d[mid]
            if xdi == pdi:
                p = xi
                break
            elif xdi < pdi:
                lo = mid + 1
            else:
                hi = mid
        if p is None:
            print(-1)
            return
        u, v = i, p
        if v < u:
            u, v = v, u
        edges.append((u + 1, v + 1))
        adj_list[u].append(v)
        adj_list[v].append(u)
        w[p] += w[i]

    d0, r = d[0]
    visited = [False] * n
    x = dfs(r, adj_list, 0, visited)
    if x != d0:
        print(-1)
        return

    edges.sort()
    for uv in edges:
        u, v = uv
        print('{} {}'.format(u, v))



def main():
    n = input()
    n = int(n)
    d = []
    for i in range(n):
        di = input()
        di = int(di)
        d.append((di, i))


    solve(n, d)


if __name__ == '__main__':
    main()

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


def dfs(v, adj_list, depth, visited):
    visited[v] = True
    x = depth
    for w in adj_list[v]:
        if not visited[w]:
            x += dfs(w, adj_list, depth + 1, visited)

    return x


def solve(n, d):

    if n < 7:
        print(-1)
        return

    d.sort()
    w = [1] * n
    edges = []
    adj_list = [[] for _ in range(n)]
    for j in range(n - 1, 0, -1):
        di, i = d[j]
        pdi = di - n + 2 * w[i]
        p = None
        lo, hi = 0, j
        while lo < hi:
            mid = (lo + hi) // 2
            xdi, xi = d[mid]
            if xdi == pdi:
                p = xi
                break
            elif xdi < pdi:
                lo = mid + 1
            else:
                hi = mid
        if p is None:
            print(-1)
            return
        u, v = i, p
        if v < u:
            u, v = v, u
        edges.append((u + 1, v + 1))
        adj_list[u].append(v)
        adj_list[v].append(u)
        w[p] += w[i]

    d0, r = d[0]
    visited = [False] * n
    x = dfs(r, adj_list, 0, visited)
    if x != d0:
        print(-1)
        return

    edges.sort()
    for uv in edges:
        u, v = uv
        print('{} {}'.format(u, v))



def main():
    n = input()
    n = int(n)
    d = []
    for i in range(n):
        di = input()
        di = int(di)
        d.append((di, i))


    solve(n, d)


if __name__ == '__main__':
    main()
Problem p03262 (python)

Fixed submission:
#!/usr/bin/env python3
from functools import reduce

def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while 0 < b:
        a, b = b, a % b
    return a


def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: abs(v - X), x))

    a = reduce(gcd, y)

    print(a)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
from functools import reduce

def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: abs(v - X), x))

    a = reduce(math.gcd, y)

    print(a)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
#from functools import reduce

def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    lmd = lambda v: abs(v - X)
    y = list(map(lmd, x))

#    g = reduce(math.gcd, y)

    a = y.pop(0)
    while 0 < len(y):
        b = y.pop(0)
        a = math.gcd(a, b)

    print(a)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
#from functools import reduce

def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: v - X, x))

#    g = reduce(math.gcd, y)

    a = y.pop(0)
    while 0 < len(y):
        b = y.pop(0)
        a = math.gcd(a, b)

    print(a)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
from functools import reduce

def main():
    na = list(map(int, input().split()))
    N, X = na[0], na[1]
    x = list(map(int, input().split()))

    y = list(map(lambda v: v - X, x))

    g = reduce(math.gcd, y)

    print(g)


if __name__ == '__main__':
    main()
Problem p03263 (python)

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

def main():
    [H, W] = list(map(int, input().split()))
    a = []
    for i in range(H):
        a.append(list(map(int, input().split())))

    moves = []

    for y in range(H):
        for x in range(W - 1):
            if a[y][x] % 2 == 1:
                a[y][x] -= 1
                a[y][x + 1] += 1
                moves.append((y + 1, x + 1, y + 1, x + 2))
        if y != H - 1:
            if a[y][W - 1] % 2 == 1:
                a[y][W - 1] -= 1
                a[y + 1][W - 1] += 1
                moves.append((y + 1, W, y + 2, W))


    print(len(moves))
    for v in moves:
        print('{} {} {} {}'.format(v[0], v[1], v[2], v[3]))


if __name__ == '__main__':
    main()

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

def main():
    [H, W] = list(map(int, input().split()))
    a = []
    for i in range(H):
        a.append(list(map(int, input().split())))

    moves = []

    for y in range(H):
        for x in range(W - 1):
            if a[y][x] % 2 == 1:
                a[y][x] -= 1
                a[y][x + 1] += 1
                moves.append((y + 1, x + 1, y + 1, x + 2))
        if y != H - 1:
            if a[y][H - 1] % 2 == 1:
                a[y][H - 1] -= 1
                a[y + 1][H - 1] += 1
                moves.append((y + 1, H, y + 2, H))


    print(len(moves))
    for v in moves:
        print('{} {} {} {}'.format(v[0], v[1], v[2], v[3]))


if __name__ == '__main__':
    main()
Problem p03310 (python)

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

def main():
    N = int(input())
    A = list(map(int, input().split()))

    B = []
    t = 0
    for a in A:
        t += a
        B.append(t)

    T = B[N - 1]

    i2 = bisect.bisect_left(B, T / 2, lo = 1, hi = N - 2)
    i1 = bisect.bisect_left(B, B[i2] / 2, hi = i2)
    i3 = bisect.bisect_left(B, (T + B[i2]) / 2, lo = i2 + 1)

    P = B[i1]
    Q = B[i2] - B[i1]
    R = B[i3] - B[i2]
    S = T - B[i3]

    min_d = max(P, Q, R, S) - min(P, Q, R, S)
    min_half = T / 2 - min_d
    max_half = T / 2 + min_d

    i2_lo = bisect.bisect_left(B, min_half, lo = 1, hi = N - 2)
    i2_hi = bisect.bisect_left(B, max_half, lo = i2_lo, hi = N - 2) + 1

    for i2 in range(i2_lo, i2_hi):
        if min_d * 2 < abs(T - 2 * B[i2]):
            continue

        i1 = bisect.bisect_left(B, B[i2] / 2, hi = i2)
        i3 = bisect.bisect_left(B, (T + B[i2]) / 2, lo = i2 + 1)
        i1_lo, i1_hi = i1, i1 + 1
        i3_lo, i3_hi = i3, i3 + 1
        if B[i1] * 2 != B[i2] and 0 < i1:
            i1_lo -= 1
        if B[i3] * 2 != T + B[i2] and i2 + 1 < i3:
            i3_lo -= 1

        for i1 in range(i1_lo, i1_hi):
            P = B[i1]
            Q = B[i2] - B[i1]
            for i3 in range(i3_lo, i3_hi):
                R = B[i3] - B[i2]
                S = T - B[i3]
                d = max(P, Q, R, S) - min(P, Q, R, S)
                if d < min_d:
                    min_d = d


    print(min_d)


if __name__ == '__main__':
    main()

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

def main():
    N = int(input())
    A = list(map(int, input().split()))

    B = []
    t = 0
    for a in A:
        t += a
        B.append(t)

    i2 = bisect.bisect_left(B, B[N - 1] / 2, lo = 1, hi = N - 1)
    i1 = bisect.bisect_left(B, B[i2] / 2, hi = i2)
    i3 = bisect.bisect_left(B, B[i2] + (B[N - 1] - B[i2]) / 2, lo = i2 + 1)

    P = B[i1]
    Q = B[i2] - B[i1]
    R = B[i3] - B[i2]
    S = B[N - 1] - B[i3]

    min_d = max(P, Q, R, S) - min(P, Q, R, S)

    for i2 in range(1, N - 1):
        if min_d * 2 < abs(B[N - 1] - 2 * B[i2]):
            continue
        s0 = min(B[i2], B[N - 1] - B[i2])
        s1 = max(B[i2], B[N - 1] - B[i2])
        i1_lo = bisect.bisect_left(B, s0 / 2, hi = i2)
        if 1 <= i1_lo:
            i1_lo -= 1
        i1_hi = bisect.bisect_right(B, s1 / 2, lo = i1_lo, hi = i2)
        i3_lo = bisect.bisect_left(B, B[i2] + s0 / 2, lo = i2 + 1, hi = N - 1)
        if i2 + 1 <= i3_lo:
            i3_lo -= 1
        i3_hi = bisect.bisect_right(B, B[i2] + s1 / 2, lo = i3_lo, hi = N - 1)
        for i1 in range(i1_lo, i1_hi + 1):
            for i3 in range(i3_lo, i3_hi + 1):
                P = B[i1]
                Q = B[i2] - B[i1]
                R = B[i3] - B[i2]
                S = B[N - 1] - B[i3]
                d = max(P, Q, R, S) - min(P, Q, R, S)
                if d < min_d:
                    min_d = d


    print(min_d)


if __name__ == '__main__':
    main()
Problem p03485 (python)

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

def main():
    sa = input().split(' ')
    a = int(sa[0])
    b = int(sa[1])

    print(int((a + b + 1) / 2))


if __name__ == '__main__':
    main()

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

def main():
    s = input()
    t = input()

    s_bytes = sorted(s.encode())
    t_bytes = sorted(t.encode(), reverse = True)

    s_len = len(s)
    t_len = len(t)

    gt = s_len < t_len

    for i in range(len(s_bytes)):
        if t_len <= i:
            gt = False
            break
        if s_bytes[i] < t_bytes[i]:
            gt = True
            break
        elif s_bytes[i] > t_bytes[i]:
            gt = False
            break

    print('Yes' if gt else 'No')


if __name__ == '__main__':
    main()

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

def main():
    s = input()
    t = input()

    s_bytes = sorted(s.encode())
    t_bytes = sorted(t.encode(), reverse = True)

    s_len = len(s)
    t_len = len(t)

    gt = s_len < t_len

    for i in range(len(s_bytes)):
        if t_len <= i:
            gt = False
            break
        if s_bytes[i] < t_bytes[i]:
            gt = True
            break
        elif s_bytes[i] > t_bytes[i]:
            gt = False
            break

    print('Yes' if gt else 'No')


if __name__ == '__main__':
    main()
Problem p03657 (python)

Fixed submission:
N, M = map(int, raw_input().split())
if (N+M) % 3 == 0:
	print  "Possible"

elif (N) % 3 == 0:
	print  "Possible"

elif (M) % 3 == 0:
	print  "Possible"

else:
	print "Impossible"

Buggy submission (verdict: Runtime Error):
N, M = map(int, raw_input().split())
if (N+M) % 3 == 0:
	print  "Possible"
	return 0

if (N) % 3 == 0:
	print  "Possible"
	return 0

if (M) % 3 == 0:
	print  "Possible"
	return 0

print "Impossible"