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

Fixed submission:
def main():
    h,w=map(int,input().split())
    a=[]
    for _ in range(h):
        a.append(input())
    now = (0, 0)
    end = (h-1, w-1)
    visited = set([now])
    while True:
        nxt = None
        #print(now)
        if now[0]+1 < len(a) and a[now[0]+1][now[1]] == "#":
            nxt = (now[0]+1, now[1])
        if now[1]+1 < len(a[now[0]]) and a[now[0]][now[1]+1] == "#":
            if nxt is not None:
                print("Impossible")
                return
            nxt = (now[0], now[1]+1)
        #print("next", nxt)
        if now[0]-1 >= 0 and a[now[0]-1][now[1]] == "#":
            if (now[0]-1,now[1]) not in visited:
                print("Impossible")
                return
        if now[1]-1 >= 0 and a[now[0]][now[1]-1] == "#":
            if (now[0],now[1]-1) not in visited:
                print("Impossible")
                return
        
        if now == end:
            break
        if nxt is None:
            print("Impossible")
            return
        now = nxt
        visited.add(nxt)
    print("Possible")
    
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    h,w=map(int,input().split())
    a=[]
    for _ in range(h):
        a.append(input())
    now = [0, 0]
    end = [h-1, w-1]
    while now != end:
        nxt = None
        if now[0]+1 < len(a) and a[now[0]+1][now[1]] == "#":
            nxt = now[:]
            nxt[0] += 1
        if now[1]+1 < len(a[now[0]]) and a[now[0]][now[1]+1] == "#":
            if nxt != None:
                print("Impossible")
                return
            nxt = now[:]
            nxt[1] += 1
        now = nxt
    print("Possible")
    
if __name__ == "__main__":
    main()
Problem p02583 (python)

Fixed submission:
import itertools

N = int(input())
L = list(map(int, input().split()))

count = 0
for a in itertools.combinations(L, 3):
    if len(set(a)) != 3:
        continue
    a = sorted(a)
    if a[2] < a[0] + a[1]:
        count += 1
print(count)

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

count = 0
for a in itertools.combinations(L, 3):
    if len(set(a)) != 3:
        continue
    a = sorted(a)
    if a[2] < a[0] + a[1]:
        count += 1
print(count)
Problem p02608 (python)

Fixed submission:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v = i*i+j*j+k*k+i*j+j*k+k*i;
            if v<10050:
            	ans[v]+=1
for i in range(n):
    print(ans[i+1])

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v = i*i+j*j+k*k+i*j+j*k+k*i;
            if v<10050:
            ans[v]+=1
for i in range(n):
    print(ans[i+1])
Problem p02639 (python)

Fixed submission:
l = list(map(int,input().split()))
print (l.index(0)+1)

Buggy submission (verdict: Runtime Error):
A = list(map(int,input().split()))
print (l.index(0)+1)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
print (l.index(0)+1)

Buggy submission (verdict: Runtime Error):
A = list(int, input().split())
print(A.index('0') + 1)

Buggy submission (verdict: Runtime Error):
A = list(int, input().split())
print(A.index(0) + 1)

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

for i in A:
  if 0 == A[i]:
    print(i + 1)
Problem p02640 (python)

Fixed submission:
X, Y = map(int, input().split())
 
ans = 'No'
for a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
 
ans = 'No'
if a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
print(ans)

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

ans = 'No'
if a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
        print('Yes')
Problem p02657 (python)

Fixed submission:
a,b=map(int,input().split())

c = a * b
print(c)

Buggy submission (verdict: Runtime Error):
A, B = input().split()

C = A * B
print(C)
Problem p02677 (python)

Fixed submission:
import math
A, B, C, D = map(int, input().split())

rad = 2 * math.pi * (((C / 12)+((5 / 60)*(D / 60))) - (D /60))

if math.cos(rad) == 1:
    print(abs(A - B))
elif math.cos(rad) == -1:
    print(A + B)
else:
    print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(rad)))

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

rad = 2 * math.pi * (((C / 12)+((5 / 60)*(D / 60))) - (D /60))

if math.cos(rad) == 1:
    print(abs(A - B))
elif math.cos(rad) == -1:
    print(A + B)
else:
    print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(rad)))

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

rad = 2 * math.pi * ((C / 12) - (D / 60))
cos = math.cos(rad)

if math.cos(rad) == 1:
    print(abs(A - B))
elif math.cos(rad) == -1:
    print(A + B)
else:
    print(math.sqrt(A**2 + B**2 - 2*A*B*cos))
Problem p02772 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
c = 0
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] %3 != 0 :
            if A[i] %5 != 0:
                c = 1
                break
if c == 0:
    print("APPROVED")
else:
    print("DENIED")

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

for i in range(N):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0:
      if a[i] % 5 != 0:
     	b = 1
      	break
if b == 0:
  print("APPROVED")
else:
  print("DENIED")

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

for i in range(N):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0:
      if a[i] % 5 != 0:
     	b = 1
      	break
if b == 0:
  print("APPROVED")
else:
  print("DENIED")

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

for i in range(N):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 and a[i] % 5 != 0:
      b = 1
      break
if b == 0:
  print("APPROVED")
else:
  print("DENIED")

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

for i in range(N):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 or a[i] % 5 != 0:
      b = 1
      break
if b == 0:
  print("APPROVED")
else:
  print("DENIED")

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

for i in range(N):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 or a[i] % 5 != 0:
      b = 1
      break
if b == 0:
  print("APPROVED")
else:
  print("DENIDED")

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

for i in range(N):
  if a[i] % != 2:
    if a[i] % != 3 or a[i] % != 5:
      b = 1
      break
if b == 0:
  print("APPROVED")
else:
  print("DENIDED")

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

for i in range(N):
  if a[i] % != 2:
    if a[i] % != 3 and a[i] % != 5:
      b = 1
      break
if b == 0:
  print("APPROVED")
else:
  print("DNIDED")

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

for i in range(n):
  if  a[i] % 2 == 0 and (a[i] % 3 == 0 or a[i] % 5 == 0):
    print("APPROVED")
    exit()
else:
  print("DENIDE")

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

for i in range(n):
  if not a[i] % 2 == 0 and (a[i] % 3 == 0 or a[i] % 5 == 0):
    print("DNIDED")
    exit()
else:
  print("APPROVED")

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

for i in range(n):
  if not a[i] %= 2 and (a[i] %= 3 or a[i] %= 5):
    print("DNIDED")
    exite()
else:
  print("APPROVED")
Problem p02789 (python)

Fixed submission:
N,M = map(int,input().split())

if M == N:
  print("Yes")
else:
  print("No")

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

if M == N:
  print(Yes)
else:
  print(No)
Problem p02811 (python)

Fixed submission:
K,X = map(int,input().split())

if 500*K >= X:
  print('Yes')
else:
  print('No')

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

ans = []
l = range(1, N + 1)
import itertools


for v in itertools.permutations(l, N):
    if list(v) == P:
      a = v.index(P)
        
    if list(v) == Q:
      b = v.index(Q)  
    

print(abs(b - a))

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

if 500*K => X:
  print('Yes')
else:
  print('No')

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

if 500*K =>X:
  print('Yes')
else:
  print('No')
Problem p02813 (python)

Fixed submission:
import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

permutations = list(itertools.permutations(range(1, N+1)))
p = permutations.index(P)
q = permutations.index(Q)
print(abs(p-q))

Buggy submission (verdict: Runtime Error):
import itertools
N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

permutations = list(itertools.permutations(range(1, N+1)))
p = permutations.index(P)
q = permutations.index(Q)
print(abs(p-q))

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

ans = []
l = range(1, N + 1)
import itertools


for v in itertools.permutations(l, N):
    if list(v) == P:
      a = list(v).index(P)
        
    if list(v) == Q:
      b = list(v).index(Q)
    

print(abs(b - a))

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

ans = []
l = range(1, N + 1)
import itertools


for v in itertools.permutations(l, N):
    if list(v) == P:
      a = v.index(P)
        
    if list(v) == Q:
      b = v.index(Q)  
    

print(abs(b - a))
Problem p02957 (python)

Fixed submission:
A, B = map(int,input().split())
if (A+B) % 2 == 0:
    print((A+B)//2)
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
A, B = map(int(input()))
if (A+B) % 2 == 0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
A, B = int(input())
if (A+B) % 2 == 0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')
Problem p02958 (python)

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

cnt = 0
for i in range(N):
    if i + 1 == p[i]:
        cnt += 1

if cnt >= N - 2:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(map(int, input().split()))
Min_S = min(S)
Min_idx = S.index(Min_S)


S[0], S[Min_idx] = S[Min_idx], S[0]
if S == Sort_S:
    print('YES')
else:
    print('NO')

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

Max_S = max(S)
Max_idx = S.index(Max_S)
Min_S = min(S)
Min_idx = S.index(Max_S)
Sort_S = sorted(S)

S[Max_idx], S[Min_idx] = S[Min_idx], S[Max_idx]
if S == Sort_S:
    print('YES')
else:
    print('NO')
Problem p02988 (python)

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


count = 0
for i in range(1,n-1):
    if min(L[i-1],L[i+1]) < L[i] < max(L[i-1], L[i+1]):
        count += 1
            
print(count)

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


count = 0
for i in range(n):
        if min(L[i],L[i+2]) < L[i+1] < max(L[i], L[i+2]):
            count += 1
            if i+2 == n - 1:
                break
print(count)
Problem p02995 (python)

Fixed submission:
from fractions import gcd

A, B, C, D = map(int, input().split())
l = C * D // gcd(C, D)
x = (A - 1) - (A - 1) // C - (A - 1) // D + (A - 1) // l
y = B - B // C - B // D + B // l
print(y - x)

Buggy submission (verdict: Runtime Error):
import numpy as np
import fractions
 
A,B,C,D = map(int,input().split())
BA = np.arange(A, B+1)
BA_C = BA % C
BA_D = BA % D
BA_CD = BA % (C * D//fractions.gcd(C, D))
 
C_count = np.count_nonzero(BA_C == 0)
D_count = np.count_nonzero(BA_D == 0)
CD_count = np.count_nonzero(BA_CD == 0)
 
print(len(BA)-(C_count+D_count-CD_count))

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

A,B,C,D = map(int,input().split())
BA = np.arange(A, B+1)
BA_C = BA % C
BA_D = BA % D
BA_CD = BA % (C * D//math.gcd(C, D))

C_count = np.count_nonzero(BA_C == 0)
D_count = np.count_nonzero(BA_D == 0)
CD_count = np.count_nonzero(BA_CD == 0)

print(len(BA)-(C_count+D_count-CD_count))

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

A, B, C, D = map(int, input().split())

BA = np.arange(A, B+1)
BA_C = BA % C
BA_D = BA % D
BA_CD = BA % (C * D//math.gcd(C, D))

C_count = np.count_nonzero(BA_C == 0)
D_count = np.count_nonzero(BA_D == 0)
CD_count = np.count_nonzero(BA_CD == 0)

print(len(BA)-(C_count+D_count-CD_count))
Problem p03030 (python)

Fixed submission:
N = int(input())
my_list = []
for i in range(1,N+1):
    l = list((input().split()))
    l.append(i)
    my_list.append(l)
 
my_list2 = sorted(my_list, key=lambda x:(x[0],-int(x[1])))
for i in my_list2:
  print(i[2])

Buggy submission (verdict: Runtime Error):
my_list = []
for i in range(1,N+1):
    l = list((input().split()))
    l.append(i)
    my_list.append(l)

my_list2 = sorted(my_list, key=lambda x:(x[0],-int(x[1])))
for i in my_list2:
  print(i[2])
Problem p03031 (python)

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

q = []
for i in range(m):
    q.append(list(map(int,input().split())))
p = list(map(int,input().split()))


for s in range(2**n): 
    judge = True
    for i in range(m):
        cnt = 0
        for j in range(1,len(q[i])):
            w = q[i][j]
            if s >> (w-1) & 1:
                cnt += 1
        if cnt % 2 != p[i]:
            judge = False
    if judge:
        res += 1
print(res)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
s2 = []
for _ in range(M):
    s = list(map(int, input().split()))
    del s[0]
    s2.append(s)
p = list(map(int, input().split()))
 
ans = 0
for i in range(2**N):
    judge = True
    for g in range(len(s2)):
        for j in range(M-1):
            count = 0
            s3 = s2[g][j]
            if i >> (s3-1) & 1:
                count += 1
            if count % 2 != p[g]:
                judge = False
    if judge:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
s2 = []
for _ in range(M):
    s = list(map(int, input().split()))
    del s[0]
    s2.append(s)
p = list(map(int, input().split()))

ans = 0
for i in range(2**N):
    judge = True
    for g in range(len(s2)):
        for j in range(M-1):
            count = 0
            s3 = s2[g][j]
            if i >> (s3-1) & 1:
                count += 1
            if count % 2 != p[g]:
                judge = False
    if judge:
        ans += 1
print(ans)
Problem p04043 (python)

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

if sorted(ABC) == [5,5,7]:
  print("YES")
else:
  print("NO")

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

if
Problem p02607 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
 
ans=0
for i in range(0,N,2):
    if a[i]%2!=0:
        ans+=1
        
print(ans)

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

ans=0
for i in range(0,N+1,2):
    print(a[i])
    if a[i]%2!=0:
        ans+=1
        
print(ans)

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

ans=0
for i in range(N):
    if i%2!=0 and a[i]%2!=0:
        ans+=1
        
print(ans)
Problem p02640 (python)

Fixed submission:
X,Y = map(int, input().split())

ans = 0

#つるをi

for i in range(Y):
  for j in range(Y):
      if 2*i + 4*j == Y and i + j == X:
          ans +=1
        
    
if ans > 0:
  print('Yes') 
else:
  print('No')

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


#つるをi

for i in range(X):
  if 2*i ==  4*X - Y and i != 0:
      ans +=1
  elif 2*(i+1) == Y:
      ans +=1
  elif 4*(X-i) == Y:
      ans +=1


if ans > 0:
  print('Yes') 
else:
  print('No')
Problem p02677 (python)

Fixed submission:
A,B,H,M=map(int, input().split())
import math

angle = abs(30*H-5.5*M)
angle = min(angle, 360-angle)*math.pi/180
 
c=A**2 + B**2 -2*A*B* math.cos(angle)
c=c**0.5
 
print(c)

Buggy submission (verdict: Runtime Error):
A,B,H,M=map(int, input().split())

angle = abs(30*H-5.5*M)
angle = min(angle, 360-angle)*math.pi/180

c=A**2 + B**2 -2*A*B* math.cos(angle)
c=c**0.5

print(c)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
print("Yes" if S == T[:-1] else "No")

Buggy submission (verdict: Runtime Error):
S, T = input().split()
print("Yes" if "S" == "T[:-2]" else "No")

Buggy submission (verdict: Runtime Error):
S, T = input().split()
print("Yes" if S == T[:-1] else "No")

Buggy submission (verdict: Runtime Error):
S, T = input().split()
print("Yes" if S == T[:-2] else "No")
Problem p02717 (python)

Fixed submission:
x, y, z = map(int, input().split())
print(z, x, y)

Buggy submission (verdict: Runtime Error):
x, y, z = map(int, input()split())
print(z, x, y)
Problem p02791 (python)

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

cnt=1

if N==1:
    print(1)
elif N==2:
    if P[1] < P[0]:
        print(2)
    else:
        print(1)
else:
    tmp = P[0]
    if P[1] <= P[0]:
        cnt +=1
    for i in range(2,N):
        tmp = min(P[i-1],tmp)
        if P[i] <= tmp:
            cnt+=1
    print(cnt)

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

cnt=1

if N==1:
    print(1)
elif N==2:
    if P[1] < P[0]:
        print(2)
    else:
        print(1)
else:
    tmp = P[i-2]
    for i in range(2,N):
        if P[i] < min(P[i-1],tmp):
            tmp = min(P[i-1],tmp)
            cnt+=1
    print(cnt)
Problem p02817 (python)

Fixed submission:
S, T = input().split()
print(T + S)

Buggy submission (verdict: Runtime Error):
S, T = int.split()
print(T + S)
Problem p02899 (python)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
B=[0]*N
C=''
 
for i in range(N):
    B[A[i]-1]=i+1
 
for i in range(N):
    C+=str(B[i])+' '
 
print(C[0:-1])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=map(int, input().split())
B=[0]*N
C=''

for i in range(N):
    B[A[i]-1]=i+1

for i in range(N):
    C+=str(B[i])+' '

print(C[0:-1])
Problem p02921 (python)

Fixed submission:
S = input()
T = input()
x = 0
 
for i in range(3):
  if S[i] == T[i]:
  	x = x + 1
  else:
  	x = x
print(x)

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

for i in range(3):
  if S[i] == T[i]
  	x = x +1
  else:
  	x = x

print(x)
Problem p02922 (python)

Fixed submission:
import math
A, B = map(int, input().split())
print(math.ceil((B-1)/(A-1)))

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
print(math.ceil((B-1)/(A-1))
Problem p02923 (python)

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

H.reverse()
ans = 0
val = 0
for i in range(N-1):
    if H[i] <= H[i+1]:
        val +=1
        ans = max(ans,val)
        #print(ans)
    else:
        ans = max(ans,val)
        val = 0
        #print(ans)

#print(H)
print(ans)

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

H.reverse()
ans = [0 for i in range(N-1)]
val = 0
for i in range(N-2):
  if H[i] <= H[i+1]:
    val +=1
  else:
    ans[i] = val
    val = 0

print(max(ans))
Problem p02952 (python)

Fixed submission:
N = int(input())
 
cnt=0
 
for i in range(1,N+1):
    if len(str(i)) %2 != 0:
        cnt+=1
print(cnt)

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

cnt=0

for i in range(1,N+1):
    if len(str(i)) %2 != 0:
        cnt+=1
print(cnt)
Problem p03031 (python)

Fixed submission:
n,m = map(int,input().split())
q = [list(map(int, input().split())) for i in range(m)]
p= list(map(int, input().split()))
ans = 0
 
for s in range(2**n): #スイッチのon/offの状態の総当たり（2**n通り）
    judge = True
    for i in range(m): #電球1つずつに対して
        cnt=0
        for j in range(1,len(q[i])): #sの総当たりでqに当てはまるものを探す。kはforを1からにすれば無視できる。
            w=q[i][j]
            if s >> (w-1) &1 ==1: #sをw-1回シフトさせて(w-1)個目のスイッチがonか判定
                cnt+=1 #onになっているスイッチの個数をカウント
        if cnt % 2 != p[i]: #スイッチの個数を2で割った余りがpiに等しいか判定
            judge = False
    if judge:
        ans += 1
 
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
q = [list(map(int, input().split())) for i in range(m)]
ans = 0

for s in range(2**n): #スイッチのon/offの状態の総当たり（2**n通り）
    judge = True
    for i in range(m): #電球1つずつに対して
        cnt=0
        for j in range(1,len(q[i])): #sの総当たりでqに当てはまるものを探す。kはforを1からにすれば無視できる。
            w=q[i][j]
            if s >> (w-1) &1 ==1: #sをw-1回シフトさせて(w-1)個目のスイッチがonか判定
                cnt+=1 #onになっているスイッチの個数をカウント
        if cnt % 2 != p[i]: #スイッチの個数を2で割った余りがpiに等しいか判定
            judge = False
    if judge:
        ans += 1

print(ans)
Problem p03037 (python)

Fixed submission:
N,M=map(int, input().split())
L = []
R = []
for i in range(M):
    l, r = input().split()
    L.append(int(l))
    R.append(int(r))


x = min(R)-max(L)


print(0 if x <0 else x+1)

Buggy submission (verdict: Runtime Error):
N,M=map(int, input().split())
L = []
R = []
for i in range(M):
    l, r = input().split()
    L.append(int(l))
    R.append(r)


x = min(R)-max(L)


print(0 if x <0 else x+1)
Problem p03047 (python)

Fixed submission:
N,K =map(int, input().split())
 
print(N-K+1)

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

print(N-K+1)
Problem p03136 (python)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
x = sorted(L)
Lmax = max(L)
y = x[0:-1]
ysum = sum(y)
print("Yes" if Lmax < ysum else "No")

Buggy submission (verdict: Runtime Error):
N = input()
L = map(int, input().split())
x = sorted(L)
Lmax = max(L)
y = x[0:-1]
ysum = sum(y)
print("Yes" if Lmax < ysum else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
L = map(int, input().split())
x = sorted(L)
Lmax = max(L)
y = x[0:-1]
ysum = sum(y)
print("Yes" if Lmax < ysum else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
L = map(int, input().split())
x = sorted(L)
Lmax = max(L)
y = x[0:-1]
z = 0
for i in range(N-1):
    z = z + y[i]
print("Yes" if Lmax < z else "No")
Problem p03260 (python)

Fixed submission:
A,B = map(int, input().split())
 
print('Yes' if A%2 !=0 and B%2 !=0 else 'No')

Buggy submission (verdict: Runtime Error):
A,B = map(int, input().input())

print('Yes' if A%2 !=0 and B%2 !=0 else 'No')