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

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

List = [a,b,c,d,e]
if max(List) - min(List) <= k:
	print("Yay!")
else:
	print(":(")

Buggy submission (verdict: Runtime Error):
a = map(int,input())
b = map(int,input())
c = map(int,input())
d = map(int,input())
e = map(int,input())
k = map(int,input())

List = list(a,b,c,d,d,e)
if max(List)-min(List) <= k:
	print("Yay!")
else<
	print(":(")
Problem p03077 (python)

Fixed submission:
lis = [int(input()) for _ in range(6)]
if lis[0] % min(lis[1:]) == 0:
  print(lis[0]//min(lis[1:])+4)
else:
  print(lis[0]//min(lis[1:])+5)

Buggy submission (verdict: Runtime Error):
lis = [int(input()) for _ in range(6)]
print(lis(0)//min(lis[1:])+5)
Problem p03013 (python)

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

a=[1,1]
for i in range(2,100001):
    a.append((a[i-1]+a[i-2])%1000000007)

bad=[]
for i in range(m):
    bad.append(int(input()))
num=[]
before=0
bad_flag=0

if m!=0:
    for i in range(len(bad)):
        nxt=bad[i]-before-1
        if nxt==-1:
            bad_flag=1
            break
        num.append(nxt)
        before=bad[i]+1
    num.append(n-bad[len(bad)-1]-1)
else:
    num.append(n)
if bad_flag:
    print(0)
else:
    ans=0
    last=1
    for i in num:
        ans=a[i]*last
        last=ans%1000000007
    print(last)

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

a=[1,1]
for i in range(2,10001):
    a.append((a[i-1]+a[i-2])%1000000007)

bad=[]
for i in range(m):
    bad.append(int(input()))
num=[]
before=0
bad_flag=0

if m!=0:
    for i in range(len(bad)):
        nxt=bad[i]-before-1
        if nxt==-1:
            bad_flag=1
            break
        num.append(nxt)
        before=bad[i]+1
    num.append(n-bad[len(bad)-1]-1)
else:
    num.append(n)
if bad_flag:
    print(0)
else:
    ans=0
    last=1
    for i in num:
        ans=a[i]*last
        last=ans%1000000007
    print(last)

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

a=[1,1]
for i in range(2,10000):
    a.append((a[i-1]+a[i-2])%1000000007)

bad=[]
for i in range(m):
    bad.append(int(input()))
num=[]
before=0
bad_flag=0

if m!=0:
    for i in range(len(bad)):
        nxt=bad[i]-before-1
        if nxt==-1:
            bad_flag=1
            break
        num.append(nxt)
        before=bad[i]+1
    num.append(n-bad[len(bad)-1]-1)
else:
    num.append(n)
if bad_flag:
    print(0)
else:
    ans=0
    last=1
    for i in num:
        ans=a[i]*last
        last=ans%1000000007
    print(last)

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

a=[1,1]
for i in range(2,10000):
    a.append((a[i-1]+a[i-2])%1000000007)
bad=[]
for i in range(m):
    bad.append(int(input()))
num=[]
before=0
bad_flag=0
# print(bad)
for i in range(len(bad)):
    nxt=bad[i]-before-1
    if nxt==-1:
        bad_flag=1
        break
    num.append(nxt)
    before=bad[i]+1
num.append(n-bad[len(bad)-1]-1)
if bad_flag:
    print(0)
else:
    ans=0
    last=1
    for i in num:
        # print(num,a[i])
        ans=a[i]*last
        last=ans%1000000007
    print(last)
Problem p03038 (python)

Fixed submission:
from collections import deque

a,b = map(int,input().split()) 
a=sorted(list(map(int,input().split())))
di = {}
for i in range(b):
    x,y = map(int,input().split()) 
    if y in di:
        di[y] += x
    else:
        di[y] = x
keys = sorted(list(di.keys()))
keys.reverse()
# print(keys)
ichi = 0
# print(a)
for i in range(len(a)):
    try:
        if keys[ichi] > a[i]:
            a[i] = keys[ichi]
            di[keys[ichi]] -= 1
        else:
            break
        if di[keys[ichi]] == 0:
            ichi += 1
    except:
        pass
# print(a)
print(sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
li_a = []
b=0
for i in range(n):
    temp = input()
    if temp == "2":
        li_a.sort()
        if len(li_a)%2 == 0:
            ans_a = li_a[len(li_a)//2-1]
        else:
            ans_a = li_a[(len(li_a)-1)//2]
        ans_b = 0
        for a in li_a:
            ans_b += abs(a-ans_a)
        ans_b += b
        print(ans_a,ans_b)
    else:
        z,aa,bb=temp.split(" ")
        li_a.append(int(aa))
        b+=int(bb)
Problem p02629 (python)

Fixed submission:
i = int(input())
nexti = 0
nextii = 0
ans = str()
nextans = str()


while i > 0:
  nexti = i // 26
  mod = i % 26
  if mod == 0:
    nextans = "z" + ans
    nextii = nexti-1
    nexti = nextii
  elif mod == 1:
    nextans = "a" + ans
  elif mod == 2:
    nextans = "b" + ans
  elif mod == 3:
    nextans = "c" + ans
  elif mod == 4:
    nextans = "d" + ans
  elif mod == 5:
    nextans = "e" + ans
  elif mod == 6:
    nextans = "f" + ans
  elif mod == 7:
    nextans = "g" + ans
  elif mod == 8:
    nextans = "h" + ans
  elif mod == 9:
    nextans = "i" + ans
  elif mod == 10:
    nextans = "j" + ans
  elif mod == 11:
    nextans = "k" + ans
  elif mod == 12:
    nextans = "l" + ans
  elif mod == 13:
    nextans = "m" + ans
  elif mod == 14:
    nextans = "n" + ans
  elif mod == 15:
    nextans = "o" + ans
  elif mod == 16:
    nextans = "p" + ans
  elif mod == 17:
    nextans = "q" + ans
  elif mod == 18:
    nextans = "r" + ans
  elif mod == 19:
    nextans = "s" + ans
  elif mod == 20:
    nextans = "t" + ans
  elif mod == 21:
    nextans = "u" + ans
  elif mod == 22:
    nextans = "v" + ans
  elif mod == 23:
    nextans = "w" + ans
  elif mod == 24:
    nextans = "x" + ans
  elif mod == 25:
    nextans = "y" + ans
  ans = nextans
  i = nexti
print(ans)

Buggy submission (verdict: Runtime Error):
i = input()
ans = ""

while i = 0:
	nexti = i // 26
	mod = i % 26
    if mod = 0:
		nextans = "z" + ans
		nextii = nexti - 1
        nexti = nextii
    elif mod = 1:
		nextans = "a" + ans
    elif mod = 2:
		nextans = "b" + ans
    elif mod = 3:
		nextans = "c" + ans
    elif mod = 4:
		nextans = "d" + ans
    elif mod = 5:
		nextans = "e" + ans
    elif mod = 6:
		nextans = "f" + ans
    elif mod = 7:
		nextans = "g" + ans
    elif mod = 8:
		nextans = "h" + ans
    elif mod = 9:
		nextans = "i" + ans
    elif mod = 10:
		nextans = "j" + ans
    elif mod = 11:
		nextans = "k" + ans
    elif mod = 12:
		nextans = "l" + ans
    elif mod = 13:
		nextans = "m" + ans
    elif mod = 14:
		nextans = "n" + ans
    elif mod = 15:
		nextans = "o" + ans
    elif mod = 16:
		nextans = "p" + ans
    elif mod = 17:
		nextans = "q" + ans
    elif mod = 18:
		nextans = "r" + ans
    elif mod = 19:
		nextans = "s" + ans
    elif mod = 20:
		nextans = "t" + ans
    elif mod = 21:
		nextans = "u" + ans
    elif mod = 22:
		nextans = "v" + ans
    elif mod = 23:
		nextans = "w" + ans
    elif mod = 24:
		nextans = "x" + ans
    elif mod = 25:
		nextans = "y" + ans
	ans = nextans
	i = nexti
print(ans)
Problem p02754 (python)

Fixed submission:
inp = input().split(" ")
N, A, B = (int(inp[0]), int(inp[1]), int(inp[2]))
if int(N % (A + B)) <= A:
    print(int(N / (A + B)) * A + int(N % (A + B)))
else:
    print(int(N / (A + B)) * A + A)

Buggy submission (verdict: Runtime Error):
inp = input().split(" ")
N,A,B = inp
if (N%(A+B)) <= A:
  print((N/(A+B))*A + (N%(A+B)))
else:
  print((N/(A+B))*A + A)
Problem p02833 (python)

Fixed submission:
from decimal import getcontext, Decimal
getcontext().prec = 1

N = int(input())
if N % 2 == 1:
	print(0)
else:
	ans = 0
	if N <= 9:
		pass
	else:
		ans += N//10
		N //= 10
		while N >= 5:
			ans += N//5
			N //= 5
	print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N % 2 == 1:
	print(0)
else:
	ans = 0
	if N <= 9:
		pass
	else:
		ans += N//10
		N = int(N/10)
		while N >= 5:
			ans += N//5
			N = int(N/5)
print(ans)
Problem p03013 (python)

Fixed submission:
import sys
sys.setrecursionlimit(200000)

mod = int(1e9+7)

def dfs(i,dp,bad):
    if i == 0:
      return 1
    if i in dp:
      return dp[i]
    dp[i] = 0
    for d in (1,2):
      x = i-d;
      if 0 <= x and x not in bad:
        dp[i] += dfs(x,dp,bad)
        dp[i] %= mod
    return dp[i]

n,m = [int(a) for a in input().split()]
bad = set()
for _ in range(m):
  a = int(input())
  bad.add(a)
print(dfs(n,dict(),bad))

Buggy submission (verdict: Runtime Error):
import resource
import sys


# Will segfault without this line.
resource.setrlimit(resource.RLIMIT_STACK, [0x10000000, resource.RLIM_INFINITY])
sys.setrecursionlimit(0x100000)

mod = int(1e9+7)

def dfs(i,dp,bad):
    if i == 0:
      return 1
    if i in dp:
      return dp[i]
    dp[i] = 0
    for d in (1,2):
      x = i-d;
      if 0 <= x and x not in bad:
        dp[i] += dfs(x,dp,bad)
        dp[i] %= mod
    return dp[i]

n,m = [int(a) for a in input().split()]
bad = set()
for _ in range(m):
  a = int(input())
  bad.add(a)
print(dfs(n,dict(),bad))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(11000)

mod = int(1e9+7)

def dfs(i,dp,bad):
    if i == 0:
      return 1
    if i in dp:
      return dp[i]
    dp[i] = 0
    for d in (1,2):
      x = i-d;
      if 0 <= x and x not in bad:
        dp[i] += dfs(x,dp,bad)
        dp[i] %= mod
    return dp[i]

n,m = [int(a) for a in input().split()]
bad = set()
for _ in range(m):
  a = int(input())
  bad.add(a)
print(dfs(n,dict(),bad))

Buggy submission (verdict: Runtime Error):
import sys

mod = int(1e9+7)

def dfs(i,dp,bad):
    if i == 0:
      return 1
    if i in dp:
      return dp[i]
    dp[i] = 0
    for d in (1,2):
      x = i-d;
      if 0 <= x and x not in bad:
        dp[i] += dfs(x,dp,bad)
        dp[i] %= mod
    return dp[i]

n,m = [int(a) for a in input().split()]
bad = set()
for _ in range(m):
  a = int(input())
  bad.add(a)
print(dfs(n,dict(),bad))

Buggy submission (verdict: Runtime Error):
import sys

mod = int(1e9+7)

def dfs(i,dp,bad):
    if i == 0:
      return 1
    if i in dp:
      return dp[i]
    dp[i] = 0
    for d in (1,2):
      x = i-d;
      if 0 <= x and x not in bad:
        dp[i] += dfs(x)
        dp[i] %= mod
    return dp[i]

n,m = (int(a) for a in input().split())
bad = set()
for _ in range(m):
  a = int(input())
  bas.add(a)
print(dfs(n,dict(),bad))

Buggy submission (verdict: Runtime Error):
import sys

mod = int(1e9+7)

def dfs(i,dp,bad):
  	if i == 0:
      return 1
    if i in dp:
      return dp[i]
	dp[i] = 0;
    for d in (1,2):
      x = i-d;
      if 0 <= x and x not in bad:
        dp[i] += dfs(x)
        dp[i] %= mod
	return dp[i]
  
n = int(sys.stdin.next())
m = int(sys.stdin.next())
bad = set()
for _ in range(m):
  a = int(sys.stdin.next())
  bas.add(a)
print(dfs(n,dict(),bad))
Problem p02777 (python)

Fixed submission:
def resolve():
    s, t = input().split()
    a, b = map(int, input().split())
    u = input()

    if u == s:
        print(a - 1, b)

    if u == t:
        print(a, b - 1)

resolve()

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

if u == s:
  print(a-1, b)

if u == t:
  print(a, b-1)
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())

l = [1,2,3]
l.remove(a)
l.remove(b)

print(l[0])

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

print(set([1,2,3]) - a - b)
Problem p02916 (python)

Fixed submission:
n = int(input())

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

ans = 0
for i in range(n):
  ai = a[i] -1
  pre_ai = -10
  if i != 0:
    pre_ai = a[i-1] -1
    
  ans += b[ai]
  if ai - pre_ai == 1:
    ans += c[pre_ai]
    
print (ans)

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

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

ans = 0
for i in range(n):
  ai = a[i]
  pre_ai = 0
  if i != 0:
    pre_ai = a[i-1]
    
  ans += b[ai]
  if ai - pre_ai = 1:
    ans += c[pre_ai]
    
print (ans)
Problem p03013 (python)

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy submission (verdict: Runtime Error):
def resolve():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]
    dp = [-1] * (n + 1)

    for i in a:
        dp[i] = 0

    print(i_step(n, a, dp) % 1000000007)

# i段目にたどり着くまでの移動方法の総数
def i_step(i, a, dp):
    if i < 0:
        return 0

    if i == 0:
        return 1

    ret = 0
    if dp[i - 1] != -1:
        ret += dp[i - 1]
    else:
        ret += i_step(i - 1, a, dp)

    if i == 1:
        return ret

    if dp[i - 2] != -1:
        ret += dp[i - 2]
    else:
        ret += i_step(i - 2, a, dp)

    dp[i] = ret
    return ret
  
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n, m = map(int, input().split())
    li_broken = [int(input()) for _ in range(m)]
    dp = [0] * (n + 2)

    for i in reversed(range(n + 1)):

        if i == n:
            dp[i] = 1
            continue

        if i in li_broken:
            dp[i] = 0
            continue

        dp[i] = dp[i+1] + dp[i+2]

    print(dp[0] % 1000000007)（）
    
resolve()
Problem p03326 (python)

Fixed submission:
import heapq
from itertools import product
def resolve():
    n, m = map(int, input().split())
    cakes = [list(map(int, input().split())) for _ in range(n)]

    ans = 0

    if m == 0:
        print(0)
        return 

    for i in product([1, -1], repeat=3):
        hq = []
        heapq.heapify(hq)
        for x, y, z in cakes:
            point = i[0] * x + i[1] * y + i[2] * z
            if len(hq) != m:
                heapq.heappush(hq, point)
            elif hq[0] < point:
                heapq.heapreplace(hq, point)

        ans = max(ans, sum(hq))

    print(ans)
    
resolve()

Buggy submission (verdict: Runtime Error):
import heapq
from itertools import product
def resolve():
    n, m = map(int, input().split())
    cakes = [list(map(int, input().split())) for _ in range(n)]

    ans = 0

    for i in product([1, -1], repeat=3):
        hq = []
        heapq.heapify(hq)
        for x, y, z in cakes:
            point = i[0] * x + i[1] * y + i[2] * z
            if len(hq) != m:
                heapq.heappush(hq, point)
            elif hq[0] < point:
                heapq.heapreplace(hq, point)

        ans = max(ans, sum(hq))

    print(ans)
    
resolve()

Buggy submission (verdict: Runtime Error):
import heapq
from itertools import product
def resolve():
    n, m = map(int, input().split())
    cakes = [list(map(int, input().split())) for _ in range(n)]

    ans = 0

    for i in product([1, -1], repeat=3):
        hq = []
        heapq.heapify(hq)
        for x, y, z in cakes:
            point = i[0] * x + i[1] * y + i[2] * z
            if len(hq) != m:
                heapq.heappush(hq, point)
            elif hq[0] < point:
                heapq.heapreplace(hq, point)

        ans = max(ans, sum(hq))

    print(ans)
    
resolve()
Problem p03835 (python)

Fixed submission:
k, s = map(int, input().split())
res = 0
for a in range(k + 1):
  for b in range(k + 1):
    z = s - a - b
    if z >= 0 and z <= k:
        res += 1
        
print(res)

Buggy submission (verdict: Runtime Error):
k, s = map(int, input().split())
res = 0
for a in range(k + 1):
  for b in range(k + 1):
    for c in range(k + 1):
      if a + b + c == s:
        res += 1
        break:
        
print(res)
Problem p03631 (python)

Fixed submission:
a = input()
i = 0
n = 1
time = len(a)
ans = "Yes"
while i < time:
    if a[i] == a[-n]:
        pass
    else:
        ans = "No"
    i += 1
    n += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a = input().split()
ast = int(a[0])
aen = int(a[1])
bst = int(a[2])
ben = int(a[3])
if ast > ben or bst > aen:
    print("0")
elif ast < bst and aen < ben:
    print(aen - bst)
elif ast < bst and aen > ben:
    print(ben - bst)
elif bst < ast and ben < aen:
    print(ben -ast)
elif bst < ast and ben > aen:
    print(aen - ast)
elif ast == bst and aen < ben:
    print(aen - ast)
elif ast == bst and aen > ben:
    print(ben - ast)
elif ast < bst and aen == ben:
    print(ben - bst)
elif ast > bst and aen == ben:
    print(aen - ast)
elif ast == bst and aen == ben:
    print(aen - ast)
else:
    print("0")
Problem p03805 (python)

Fixed submission:
import numpy as np
n, m = map(int, input().split())
if m == 0:
    print(0)
    exit()
r = [[] for i in range(n)]
for i in range(m):
    f, s = map(int, input().split())
    r[f-1].append(s - 1)
    r[s-1].append(f - 1)
ans = []
def dfs(now, visited = []):
    global ans
    if len(visited) == n:
        ans.append([visited])
        return
    for j in r[now]:
        if j not in visited:
            dfs(j, visited + [j])
dfs(0, [0])
print(len(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = map(int, input().split())
if m == 0:
    print(0)
    exit()
r = [[] for i in range(m)]
for i in range(m):
    f, s = map(int, input().split())
    r[f-1].append(s - 1)
    r[s-1].append(f - 1)
ans = []
def dfs(now, visited = []):
    global ans
    if len(visited) == n:
        ans.append([visited])
        return
    for j in r[now]:
        if j not in visited:
            dfs(j, visited + [j])
dfs(0, [0])
print(len(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = map(int, input().split())
r = [[] for i in range(m)]
for i in range(m):
    f, s = map(int, input().split())
    r[f-1].append(s - 1)
    r[s-1].append(f - 1)
ans = []
def dfs(now, visited = []):
    try:
        global ans
        if len(visited) == n:
            ans.append([visited])
            return
        for j in r[now]:
            if j not in visited:
                dfs(j, visited + [j])
    except:
        return
dfs(0, [0])
print(len(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = map(int, input().split())
r = [[] for i in range(m)]
for i in range(m):
    f, s = map(int, input().split())
    r[f-1].append(s - 1)
    r[s-1].append(f - 1)
ans = []
def dfs(now, visited = []):
    global ans
    if len(visited) == n:
        ans.append([visited])
        return
    for j in r[now]:
        if j not in visited:
            dfs(j, visited + [j])
dfs(0, [0])
print(len(ans))
Problem p02771 (python)

Fixed submission:
# For sys.std*, sys.argv etc...
import sys

# For cases when input tokens are spread unevenly over many lines.
# This provides methods for reading tokens of various types.
class BufferedTokenizer:
    pass

def read_ints():
    return [int(token) for token in input().split()]

def read_tokens():
    return input().split()

def main():
    print("Yes" if len(set(read_ints())) == 2 else "No")

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# Useful data structures
from collections import Counter, defaultdict, deque, namedtuple

# Most useful math functions
from math import gcd

# For sys.std*, sys.argv etc...
import sys

# For cases when input tokens are spread unevenly over many lines.
# This provides methods for reading tokens of various types.
class BufferedTokenizer:
    pass

def read_ints():
    return [int(token) for token in input().split()]

def read_tokens():
    return input().split()

def main():
    print("Yes" if len(set(read_ints())) == 2 else "No")

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

Fixed submission:
X = int(input())
import random

def is_prime3(q,k=50):
    q = abs(q)
    #計算するまでもなく判定できるものははじく
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*dとし（但しaは整数、dは奇数)、dを求める
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    #判定をk回繰り返す
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]の範囲すべてをチェック
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True
  
i = X
cnt = 0
flg = is_prime3(i)
if flg == False:
    while flg==False:
        i += 1
        cnt = i
        flg = is_prime3(i)
    print(cnt)
else:
    print(i)

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

def is_prime3(q,k=50):
    q = abs(q)
    #計算するまでもなく判定できるものははじく
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*dとし（但しaは整数、dは奇数)、dを求める
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    #判定をk回繰り返す
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]の範囲すべてをチェック
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True
 i = X
cnt = 0
flg = is_prime3(i)
if flg == False:
    while flg==False:
        i += 1
        cnt = i
        flg = is_prime3(i)
    print(cnt)
else:
    print(i)
Problem p03042 (python)

Fixed submission:
def solve():
    S= input()
    ue = int(S[:2])
    sita = int(S[2:])

    ueok = 1 <= ue <= 12
    sitaok = 1 <= sita <= 12
    if ueok and sitaok:
        print("AMBIGUOUS")
    elif not ueok and sitaok:
        print("YYMM")
    elif ueok and not sitaok:
        print("MMYY")
    else:
        print("NA")

if __name__ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
def solve():
    S= input()
    ue = int(S[:2])
    sita = int(S[2:])

    if 1 <= sita <= 12 and not(1 <= ue <= 12):
        print("YYMM")
    elif (not (1 <= ue <= 12)) and 1 <= sita <= 12:
        print("MMYY")
    elif (not (1 <= ue <= 12)) and (not (1 <= sita <= 12)):
        print("NA")
    elif 1 <= sita <= 12 and (1 <= ue <= 12):
        print("AMBIGUOUS")
    else:
        raise "ERROR"
if __name__ == "__main__":
    solve()