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

Fixed submission:
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
k=reduce(lambda x,y:x*y//gcd(x,y),a)
ans=sum(list(map(lambda x:k//x,a)))
print(ans%(10**9+7))

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
k=reduce(lambda x,y:x*y//gcd(x,y),a)
ans=sum(list(map(lambda x:k//x,a)))
print(ans%(10**9+7))

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
k=reduce(lambda x,y:x*y//gcd(x,y),a)
ans=sum(list(map(lambda x:k//x,a)))
print(ans)
Problem p02851 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(lambda x:(int(x)-1)%k,input().split()))
s=[0]
#print(a)
for i in a:
    s.append((s[-1]+i)%k)
#print(s)
mp={}
ans=0
for i in range(len(s)):
    if i-k>=0:
        mp[s[i-k]]-=1
    if s[i] in mp:
        ans+=mp[s[i]]
    if s[i] in mp:
        mp[s[i]]+=1
    else:
        mp[s[i]]=1
    #print(i,ans)
print(ans)
#ans+=sum(list(map(lambda x: x==0,s)))
#print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(lambda x:(int(x)-1)%k,input().split()))
s=[0,0]
#print(a)
for i in a:
    s.append((s[-1]+i)%k)
s.append(s[-1])
#print(s)
mp={}
ans=0
for i in range(len(s)):
    if i-k>=0:
        mp[s[i-k]]-=1
    if s[i] in mp:
        ans+=mp[s[i]]
    if i>0:
        if s[i-1] in mp:
            mp[s[i-1]]+=1
        else:
            mp[s[i-1]]=1
    #print(i,ans)
print(ans)
Problem p02859 (python)

Fixed submission:
print(int(input())**2)

Buggy submission (verdict: Runtime Error):
#include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
using namespace std;

typedef long long u64;

const int maxn = 100000 + 10;
u64 n, m, p, fac[maxn];

inline u64 Fast_Pow(u64 x, u64 k) {
    u64 ans = 1;
    while(k) {
        if( k&1 ) ans = ans * x % p;
        k >>= 1, x = x * x % p;
    }
    return ans;
}

u64 C(u64 k, u64 b) {
    if( k<b )  return 0;
    return fac[k] * Fast_Pow(fac[b] % p, p-2) % p * Fast_Pow(fac[k-b] % p, p-2) % p;
}

u64 Lucas(u64 k, u64 b) {
    if( !b )  return 1;
    return C(k%p, b%p) * Lucas(k/p, b/p) % p;
}

int main(int argc, char const *argv[])
{
    int t;  scanf("%d", &t);
    while( t-- ) {
        fac[0] = 1;
        scanf("%lld%lld%lld", &n, &m, &p);
        for(int i=1; i<=p; ++i)
            fac[i] = fac[i-1] * i % p;
        printf("%lld\n", Lucas(n+m, m));
    }
    return 0;
}
Problem p02860 (python)

Fixed submission:
n=int(input())
s=input()
print(["No","Yes"][s[:int(n/2)]==s[int(n/2):]])

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
print(["No","Yes"][s[:int(n/2)]]==s[int(n/2):])
Problem p02552 (python)

Fixed submission:
a = int(input())
if a == 0:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
print(~int(input())
Problem p02627 (python)

Fixed submission:
A=[chr(i) for i in range(ord("a"),ord("z")+1)]
a=input()
if a in A:
  print("a")
else:
  print("A")

Buggy submission (verdict: Runtime Error):
A=[ord(i) for i in range(chr(a),chr(z)+1)]
a=input()
if a in A:
  print("a")
else:
  print("A")
Problem p02659 (python)

Fixed submission:
a,b=input().split()
a=int(a)
b=float(b)*1000
b=int(b)
print(int((a*b)//1000))

Buggy submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=float(b)*1000
b=int(b)
print(int((a*b)//1000)
Problem p02711 (python)

Fixed submission:
print("Yes" if input().count("7")!=0 else "No")

Buggy submission (verdict: Runtime Error):
N=int(input())
s=input()
R=s.count("R")
G=s.count("G")
B=s.count("B")
ans=R*G*B

#全探索する
for i in range(N-2):
  a=s[i]
  for j in range(i+1,N-1):
    if a==s[j]:
      continue
    b=s[j]
    k=2*j-i
    if "R" not in a+b:
      try:
        if s[k]=="R":
          ans-=1
      except:
        pass
      
    if "G" not in a+b:
      try:
        if s[k]=="G":
          ans-=1
      except:
        pass
      
    if "B" not in a+b:
      try:
        if s[k]=="B":
          ans-=1
      except:
        pass

print(ans)
Problem p02753 (python)

Fixed submission:
N=input()
if N[0]==N[1] and N[0]==N[2]:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
from collections import deque
S=deque(input())
Q=int(input())
for i in range(Q):
  N=list(input().split())
  if N[0]=="1":
    S.reverse()
  elif N[1]=="1":#先頭にC1
    S.appendleft(N[2])
  else:#末尾にC1
    S.append(N[2])
S="".join(S)
print(S)
Problem p02754 (python)

Fixed submission:
N,B,R=map(int,input().split())
if B==0:
  print(0)
  exit()
ans=B*(N//(R+B))
if N%(R+B)>=B:
  print(ans+B)
else:
  print(ans+N%(R+B))

Buggy submission (verdict: Runtime Error):
N,B,R=map(int,input().split())
if B==0:
  print(0)
  exit()
ans=B×N//(R+B)
if N%(R+B)>=B:
  print(ans+B)
else:
  print(ans+B-N%(R+B))
Problem p02759 (python)

Fixed submission:
import math
N=int(input())
print(math.ceil(N/2))

Buggy submission (verdict: Runtime Error):
print((int(input())+1//2)
Problem p02762 (python)

Fixed submission:
class Union_Find():
    def __init__(self,n):
        self.n=n
        self.par=[-1]*n
    def root(self,x):
        if self.par[x]<0:
            return x
        else:
            self.par[x]=self.root(self.par[x])
            return self.par[x]
    def union(self,x,y):
        rx=self.root(x)
        ry=self.root(y)
        if rx==ry:
            return
        if self.par[rx]>self.par[ry]:
            rx,ry=ry,rx
        self.par[rx]+=self.par[ry]
        self.par[ry]=rx

    def size(self,x):
        return -self.par[self.root(x)]

    def same(self,x,y):
        return self.root(x)==self.root(y)
N,M,K=map(int,input().split())
deg=[0]*N
bro=[[]*N for _ in range(N)]
uf=Union_Find(N)
for i in range(M):
    a,b=map(int,input().split())
    a-=1
    b-=1
    deg[a]+=1
    deg[b]+=1
    uf.union(a,b)
for j in range(K):
    a,b=map(int,input().split())
    a-=1
    b-=1
    bro[a].append(b)
    bro[b].append(a)

for q in range(N):
    ans=uf.size(q)-deg[q]-1
    for w in bro[q]:
        if uf.same(q,w):
            ans-=1
    print(ans,end=" ")

Buggy submission (verdict: Runtime Error):
def root(x):#親のrootはマイナスのサイズ、子のrootは親のindex
  if par[x]<0:
    return x
  else:
    par[x]=root(par[x])
    return par[x]

def unit(x,y):#xとyをくっつける
  rx=root(x)
  ry=root(y)
  if rx==ry:
    return False
  if par[rx]>par[ry]:#親のサイズの大小比較
    rx,ry=ry,rx#xのサイズのほうが大きくする
  par[rx]+=par[ry]#xのサイズにyのサイズを足す(サイズの変換)
  par[ry]=x#親じゃなくなったroot(y)の値をxの根にする
  return True
 
def same(x,y):
  rx=root(x)
  ry=root(y)
  return rx==ry#真偽を返す
 
def size(x):
  return -par[root(x)]#親のrootはマイナスのサイズなため
 
N,M,K=map(int,input().split())
par=[-1]*N
deg=[0]*N
bro=[[]*N for i in range(N)]
for i in range(M):
  a,b=map(int,input().split())
  a-=1
  b-=1
  deg[a]+=1
  deg[b]+=1
  unit(a,b)
for j in range(K):
  c,d=map(int,input().split())
  c-=1
  d-=1
  bro[c].append(d)
  bro[d].append(c)

for q in range(N):
  ans=size(q)-deg[q]-1
  for w in bro[q]:
    if same(q,w):
      ans-=1
  print(ans,end=" ")

Buggy submission (verdict: Runtime Error):
def root(x):#親のrootはマイナスのサイズ、子のrootは親のindex
  if par[x]<0:
    return x
  else:
    return par[x]=root(par[x])

def unit(x,y):#xとyをくっつける
  rx=root(x)
  ry=root(y)
  if rx==ry:
    return False
  if par[rx]>par[ry]:#親のサイズの大小比較
    rx,ry=ry,rx#xのサイズのほうが大きくする
  par[rx]+=par[ry]#xのサイズにyのサイズを足す(サイズの変換)
  par[ry]=x#親じゃなくなったroot(y)の値をxの根にする
  return True

def same(x,y):
  rx=root(x)
  ry=root(y)
  return rx==ry#真偽を返す

def size(x):
  return -par[root(x)]#親のrootはマイナスのサイズなため

N,M,K=map(int,input().split())
par=[-1]*N
deg=[0]*N
bro=[[]*N for i in range(N)]
for i in range(M):
  a,b=map(int,input().split())
  a-=1
  b-=1
  deg[a]+=1
  deg[b]+=1
  unit(a,b)
for i in range(K):
  a,b=map(int,input().split())
  a-=1
  b-=1
  bro[a].append(b)
  bro[b].append(a)

for i in range(N):
  ans=size[i]-deg[i]-1
  for j in bro[i]:
    if same(i,j):
      ans-=1
  print(ans,end=" ")

Buggy submission (verdict: Runtime Error):
N,M,K=map(int,input().split())
c=[[0 for _ in range(N)]for __ in range(N)]
d=[0]*N
for ___ in range(M):
  a,b=int(input().split())
print(a)
Problem p02773 (python)

Fixed submission:
from collections import OrderedDict
N=int(input())
d=dict()
A=[]
ma=0
for i in range(N):
  s=input()
  if s not in d:
    d[s]=0
  d[s]+=1
d=OrderedDict(sorted(d.items(), key=lambda x:x[1], reverse=True))
for i in d:
  if ma<=d[i]:
    ma=d[i]
  if ma!=d[i]:
    break
  A.append(i)
print(*sorted(A),sep="\n")

Buggy submission (verdict: Runtime Error):
from collections import OrderedDict
N=int(input())
d=dict()
ma=0
for i in range(N):
  s=input()
  if s not in d:
    d[s]=0
  d[s]+=1
d=OrderedDict(sorted(d.items(), key=lambda x:x[1], reverse=True))
for i in d:
  if ma<=i:
    ma=i
  if ma!=i:
    exit()
  print(d[i])
Problem p02777 (python)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
dic={S:A,T:B}
dic[U]-=1
print(dic[S],dic[T])

Buggy submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
dic={S:A,T:B}
dict[U]-1
print(dict[S] dict[T])
Problem p02785 (python)

Fixed submission:
N,K=map(int,input().split())
H=list(map(int,input().split()))
if N==K:
  print(0)
else:
  HP=sorted(H,reverse=True)
  del HP[:K]
  print(sum(HP))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
H=list(map(int,input().split()))
HP=sorted(H)
for i in range(K):
  del HP[0]
print(sum(HP))
Problem p02819 (python)

Fixed submission:
import sys
x=int(input())
for i in range(x,2*x+1):
  for j in range(2,int(i**0.5)+1):
    if i%j==0:
      break
  else:
    print(i)
    sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
x=int(input())
for i in range(x,2*x+1):
  for j in range(2,i**0.5+1):
    if i%j==0:
      break
  else:
    print(j)
    sys.exit()
Problem p02831 (python)

Fixed submission:
import fractions as f
A,B=map(int,input().split())
print(int((A*B)/f.gcd(A,B)))

Buggy submission (verdict: Runtime Error):
N=input()
S,T=input().split()
print(*[s+t for s,t in zip(S,T)],sep="")

Buggy submission (verdict: Runtime Error):
import sys
A,B=map(int,input().split())
if A<B:
  A,B=B,A
if B%A==0:
  print(A)
  sys.exit()
L=[]
for i in range(A/2):
  if A%i==0 and B%i==0:
    L.append(i)
print((a*b)/L[-1])
Problem p02897 (python)

Fixed submission:
N=int(input())
print(0.5 if N%2==0 else ((N+1)//2)/N)

Buggy submission (verdict: Runtime Error):
N=int(input())
print(0.5 if N%2==0 else ((N+1)//2)/n)
Problem p02989 (python)

Fixed submission:
N=int(input())
d=list(map(int,input().split()))
d=sorted(d)
print(d[int(N/2)]-d[int((N/2))-1])

Buggy submission (verdict: Runtime Error):
N=int(input())
d=list(map(int,input().split()))
d=sorted(d)
print(d[N/2]-d[(N/2)-1])
Problem p03013 (python)

Fixed submission:
N,M=map(int,input().split())
broken=[0]*N
for _ in range(M):
  a=int(input())
  broken[a]=1
dp=[0]*(N+2)
dp[N]=1
for i in range(N-1,-1,-1):
  if broken[i]==1:
    dp[i]=0
  else:
    dp[i]=(dp[i+1]+dp[i+2])%1000000007
print(dp[0])

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
broken=[0]*N-1
for _ in range(M):
  a=int(input())
  broken[a]=1
dp=[0]*N+1
dp[N]=1
for i in range(N,1,-1):
  if broken[i]==1:
    dp[i]=0
  else:
    dp[i]=(dp[i+1]+dp[i+2])%1000000007
print(dp[0])

Buggy submission (verdict: Runtime Error):
from collections import deque
import sys
import functools
sys.setrecursionlimit(10000000)
@functools.lru_cache(maxsize=None)
def stairs(n):
  if n==1:
    return 1
  if n==2:
    return 2
  return stairs(n-1)+stairs(n-2)
N,M=map(int,input().split())
A=deque()
for _ in range(M):
  A.append(int(input()))
pos=0
ans=0
while A:
  x=A.popleft()-1
  if len(A)!=0:
    if x+2==A[0]:
      print(0)
      exit()
  ans+=(stairs(x-pos)-1)
  ans%=1000000007
  pos=x+2
ans+=stairs(N-pos)
print(ans+1)

Buggy submission (verdict: Runtime Error):
from collections import deque
import sys
import functools
sys.setrecursionlimit(10000000000)
@functools.lru_cache(maxsize=None)
def stairs(n):
  if n==1:
    return 1
  if n==2:
    return 2
  return stairs(n-1)+stairs(n-2)
N,M=map(int,input().split())
A=deque()
for _ in range(M):
  A.append(int(input()))
pos=0
ans=0
while A:
  x=A.popleft()-1
  if len(A)!=0:
    if x+2==A[0]:
      print(0)
      exit()
  ans+=(stairs(x-pos)-1)
  ans%=1000000007
  pos=x+2
ans+=stairs(N-pos)
print(ans+1)
Problem p03077 (python)

Fixed submission:
import math
n=int(input())
l=[int(input()) for i in range(5)]
print(math.ceil(n/min(l))+4)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
A=[int(input()) for i in range(5)]
print(math.ceil(N/min(A)+4)
Problem p03135 (python)

Fixed submission:
T,X=map(int,input().split())
print(T/X)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
L=sorted(A,reverse=True)
if L[0]<sum(L[1:]):
  print("Yes")
else:
  print("No")
Problem p03252 (python)

Fixed submission:
s=input()
t=input()
S=sorted(map(s.count,set(s)))
T=sorted(map(t.count,set(t)))
print("Yes" if S==T else "No")

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
A=[]
B=[]
c,d=0,0
for i in range(len(S)):
  if S[i]==S[i+1]:
    c+=1
  else:
    A.append(c)
    c=0

for i in range(len(T)):
  if T[i]==T[i+1]:
    d+=1
  else:
    B.append(d)
    d=0
print("Yes" if A==B else "No")
Problem p03329 (python)

Fixed submission:
N=int(input())
dp=[float("INF")]*(N+1)
dp[0]=0
six,nine=1,1
for i in range(1,N+1):
  if i==six*6:
    six*=6
  if i==nine*9:
    nine*=9
  dp[i]=min(dp[i-1],dp[i-six],dp[i-nine])+1
print(dp[N])

Buggy submission (verdict: Runtime Error):
A=[1,6,36,216,1296,7776,46656,9,81,729,6561,59049]
N=int(input())
ans=0
while N!=0:
  N-=max([a for _ in A if A<=N])
  ans+=1
print(ans)
Problem p02596 (python)

Fixed submission:
K = int(input())


if K%2==0 or K%5==0:
    count = -1
else:
    flag=0
    mod = 7
    count = 1
    while mod%K!=0:
        count += 1
        mod = (mod*10+7) % K

print(count)

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

if K%2==0:
    ans = -1
else:
    flag=0
    mod = 7
    count = 1
    while flag==0:
        if mod==0:
            flag = 1
        else:
            count += 1
            mod = (mod*10+7) % K

print(ans)
Problem p02598 (python)

Fixed submission:
def check(x, A, K):
    import math
    sumA = 0
    for a in A:
        if a > x:
            sumA += math.ceil(a / x) - 1
    if sumA <= K:
        return True
    else:
        return False


def resolve():
    _, K = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]

    ok = max(A)  # maxVal when minimize
    ng = -1  # maxVal when maximize
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if mid > 0 and check(mid, A, K):
            ok = mid
        else:
            ng = mid
    print(ok)


resolve()

Buggy submission (verdict: Runtime Error):
def check(x, A, K):
    import math
    sumA = 0
    for a in A:
        if a > x:
            sumA += math.ceil(a / x) - 1
    if sumA <= K:
        return True
    else:
        return False


def resolve():
    import bisect
    N, K = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]

    ok = max(A)  # maxVal when minimize
    ng = -1  # maxVal when maximize
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if check(mid, A, K):
            ok = mid
        else:
            ng = mid
    print(ok)


resolve()
Problem p02623 (python)

Fixed submission:
def check(A, mid, K):
    return A[mid] <= K


def binMax(A, K):
    ok = -1  # maxVal when minimize
    ng = len(A)  # maxVal when maximize
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if check(A, mid, K):
            ok = mid
        else:
            ng = mid
    return ok


def resolve():
    N, M, K = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]
    B = [int(i) for i in input().split()]
    presumA = [0 for _ in range(N + 1)]
    for i in range(N):
        presumA[i + 1] = presumA[i] + A[i]
    presumB = [0 for _ in range(M + 1)]
    for i in range(M):
        presumB[i + 1] = presumB[i] + B[i]
    startA = binMax(presumA, K)
    maxA = 0
    for ai in range(startA, -1, -1):
        maxA = max(maxA, ai + binMax(presumB, K - presumA[ai]))
    print(maxA)

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N, M, K = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]
    B = [int(i) for i in input().split()]
    sumA = 0
    ai, bi = 0, 0
    while sumA <= K:
        if ai < N and A[ai] < B[bi] and sumA + A[ai] <= K:
            sumA += A[ai]
            ai += 1
        elif bi < M and sumA + B[bi] <= K:
            sumA += B[bi]
            bi += 1
        else:
            break
    print(ai + bi)


resolve()
Problem p02629 (python)

Fixed submission:
def resolve():
    from collections import deque
    S = "abcdefghijklmnopqrstuvwxyz"
    N = int(input())
    A = deque()
    while True:
        N -= 1
        N, a = divmod(N, 26)
        A.appendleft(a)
        if N == 0:
            break
    for a in A:
        print(S[a], end="")
    print()


resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    # 1000000000000001
    from collections import deque
    S = "abcdefghijklmnopqrstuvwxyz"
    N = int(input())
    tmp = N
    A = deque()

    while True:
        N, a = divmod(N, 26)
        A.append(a)
        if N == 0:
            break
    print(N, a, file=sys.stderr)
    if tmp % 26 == 0:
        A.pop()
    for a in reversed(A):
        print(S[a - 1], end="")
    print()

resolve()
Problem p02831 (python)

Fixed submission:
# abc148_c.py
import sys
import time
import unittest
from io import StringIO
import fractions as math


def resolve():
    A, B = [int(i) for i in input().split()]
    print(int(A * B / math.gcd(A, B)))


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def setUp(self):
        self.startTime = time.time()

    def tearDown(self):
        t = time.time() - self.startTime
        print('%s: %.3f' % (self.id(), t), flush=True)

    def test_入力例_1(self):
        input = """2 3"""
        output = """6"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """123 456"""
        output = """18696"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """100000 99999"""
        output = """9999900000"""
        self.assertIO(input, output)


if __name__ == "__main__":
    if "IS_LOCAL" in locals():
        suite = unittest.TestLoader().loadTestsFromTestCase(TestClass)
        unittest.TextTestRunner(verbosity=0).run(suite)
    else:
        resolve()

Buggy submission (verdict: Runtime Error):
# abc148_c.py
import sys
import time
import unittest
from io import StringIO
import math


def resolve():
    A, B = [int(i) for i in input().split()]
    print(int(A * B / math.gcd(A, B)))


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def setUp(self):
        self.startTime = time.time()

    def tearDown(self):
        t = time.time() - self.startTime
        print('%s: %.3f' % (self.id(), t), flush=True)

    def test_入力例_1(self):
        input = """2 3"""
        output = """6"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """123 456"""
        output = """18696"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """100000 99999"""
        output = """9999900000"""
        self.assertIO(input, output)


if __name__ == "__main__":
    if "IS_LOCAL" in locals():
        suite = unittest.TestLoader().loadTestsFromTestCase(TestClass)
        unittest.TextTestRunner(verbosity=0).run(suite)
    else:
        resolve()
Problem p03013 (python)

Fixed submission:
def Fib(n, memo={}):
    if n < 2:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = Fib(n - 1, memo) + Fib(n - 2, memo)
        return memo[n]


def resolve():
    N, M = [int(i) for i in input().split()]
    aa = []
    for _ in range(M):
        aa.append(int(input()))
    fib_l = list(Fib(i) for i in range(N + 1))

    ans = 1
    now = 0
    for a in aa:
        if now == a:
            ans = 0
            break
        tmp = a - now - 1
        ans = ans * fib_l[tmp]
        now = a + 1
    else:
        ans = ans * fib_l[N - now]
    print(ans % (10**9 + 7))


resolve()

Buggy submission (verdict: Runtime Error):
def Fib(n, memo={}):
    if n < 2:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = Fib(n - 1, memo) + Fib(n - 2, memo)
        return memo[n]


def resolve():
    N, M = [int(i) for i in input().split()]
    aa = []
    for _ in range(M):
        aa.append(int(input()))
    # fib_l = list(Fib(i) for i in range(N + 1))

    ans = 1
    now = 0
    for a in aa:
        if now == a:
            ans = 0
            break
        tmp = a - now - 1
        # ans = ans * fib_l[tmp]
        ans = ans * Fib(tmp)
        now = a + 1
    else:
        # ans = ans * fib_l[N - now]
        ans = ans * Fib(N - now)
    print(ans % (10**9 + 7))


resolve()

Buggy submission (verdict: Runtime Error):
def Fib(n, memo={}):
    if n < 2:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = Fib(n - 1, memo) + Fib(n - 2, memo)
        return memo[n]


def resolve():
    N, M = [int(i) for i in input().split()]
    aa = []
    for _ in range(M):
        aa.append(int(input()))
    fib_l = list(Fib(i) for i in range(N))

    ans = 1
    now = 0
    for a in aa:
        if now == a:
            ans = 0
            break
        tmp = a - now - 1
        ans = ans * fib_l[tmp]
        now = a + 1
    else:
        ans = ans * fib_l[N - now]
    print(ans % (10**9 + 7))


resolve()
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())

if S <= W:
  print("unsafe")
else:
  print("safe")

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

if S =< W:
  print("unsafe")
else:
  print("safe")

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

if S =< W:
  print("unsafe")
print("safe")
Problem p02711 (python)

Fixed submission:
N = input()
l = [i for i in N]
if '7' in l:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = input()
l = [int(i) for i in l]
if 7 is in l:
  return 'Yes'
return 'No'
Problem p02729 (python)

Fixed submission:
def Even(x):
  return  2 * x

def Odd(x):
  return 2 * x - 1

N, M = map(int, input().split())
G = list(map(Even, range(1, N+1)))#偶数
K = list(map(Odd, range(1, M+1)))#奇数

even=list()

for n in range(0, N):
  for nm in range(n+1, N):
    even.append(G[n]+G[nm])
  
for m in range(0, M):
  for mm in range(m+1, M):
    even.append(K[m]+K[mm])

print(len(even))

Buggy submission (verdict: Runtime Error):
def Even(x):
  return  2 * x

def Odd(x):
  return 2 * x - 1

N, M = map(int, input().split())
G = list(map(Even, range(1, N+1)))#偶数
K = list(map(Odd, range(1, M+1)))#奇数

even=list()

for n in range(0, N):
  for nm in range(n+1, N):
    even.append(G[n]+G[nm])
  
for m in range(0, M):
  for mm in range(m+1, M):
    if int(G[n])+int(K[m]) %2 ==0:
      even.append(K[m]+K[mm])
print(len(even))

Buggy submission (verdict: Runtime Error):
N=int(input())
M=int(input())

for inN in N:
	inN=N*2
    
    for inM in M:
      inM=M*2-1
      sum=inN+inM
      
      if sum%2==0:
        count.append(sum)
      
      else:
        break
        
 print(len(count))