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

Fixed submission:


a,b,m = [int(x) for x in input().split()]
an = [int(x) for x in input().split()]
bn = [int(x) for x in input().split()]

ans = min(an)+min(bn)
for i in range(m):
    p, q, discount = [int(x) for x in input().split()]
    a_cost = an[p-1]
    b_cost = bn[q-1]
    total = a_cost + b_cost - discount
    ans = min(total, ans)

print(ans)

Buggy submission (verdict: Runtime Error):


a,b,m = [int(x) for x in input().split()]
an = [(int(x),i+1) for i,x in enumerate(input().split())]
bn = [(int(x),i+1) for i,x in enumerate(input().split())]

an = sorted(an)
bn = sorted(bn)

discounts = {}
discount_list = []
for i in range(m):
    x,y,c = [int(x) for x in input().split()]
    if (x,y) in discounts and discounts[(x,y)] > c:
        continue
    discounts[(x,y)] = c
    discount_list.append(c)

discount_list = sorted(discount_list,reverse=True)

i = 0
j = 0
min = an[0][0]+bn[0][0]
max_discount = max(discount_list)
len_an = len(an)
len_bn = len(bn)

# print(an)
# print(bn)
# print(min)
# print(discounts)

while True:
    a_index = an[i][1]
    b_index = bn[j][1]
    discount = 0
    if (a_index, b_index) in discounts:
        discount = discounts[(a_index, b_index)]
    total = an[i][0] + bn[j][0] - discount
    if min > total:
        min = total

    if an[i][0] + bn[j][0] - max_discount > min:
        break
    elif i == len_an-1 and j == len_bn-1:
        break
    elif i == len_an-1:
        j += 1
    elif j == len_bn-1:
        i += 1
    else:
        a_diff = an[i+1][0] - an[i][0]
        b_diff = bn[j+1][0] - an[j][0]
        if a_diff < b_diff:
            i += 1
        else:
            j += 1


print(min)
Problem p02957 (python)

Fixed submission:
A, B = [int(x) for x in input().split(" ")]

diff = abs(A - B)

if diff % 2 == 0:
    print(int((A+B)/2))
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
n = int(input())
xn = [int(x) for x in input().split()]
k = 0
for i in range(1,n+1):
	if xn[i-1] != i:k += 1
        
print("NO" if k > 2 else "YES")
Problem p02958 (python)

Fixed submission:
n = input()
list = [int(x) for x in input().split()]
end = 0
for i, num in enumerate(list):
    if num != i + 1:
        end += 1
    if end > 2:
        break

if end <= 2:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
xn = map(int,input().split())
k = 0
for i in range(1,n+1)
	if xn[i-1] != i:
    	k += 1
print("NO" if k > 2 else "YES")
Problem p02995 (python)

Fixed submission:

def gcd(m, n):
    if(n == 0):
        return m
    return gcd(n, m % n)


(a, b, c, d) = [int(i) for i in input().split()]
c_d_lcm = (c * d) // gcd(c, d)
able_c_div = b // c - (a - 1) // c
able_d_div = b // d - (a - 1) // d
able_c_d_div = b // c_d_lcm - (a - 1) // c_d_lcm
diff = b - (a - 1)
print(diff - (able_c_div + able_d_div - able_c_d_div))

Buggy submission (verdict: Runtime Error):

import math
(a, b, c, d) = [int(i) for i in input().split()]
c_d_lcm = (c * d) // math.gcd(c, d)
able_c_div = (b - a) // c
able_d_div = (b - a) // d
able_c_d_div = (b - a) // c_d_lcm
diff = b - a
print(diff - (able_c_div + able_d_div - able_c_d_div))
Problem p03076 (python)

Fixed submission:
import math

menu = [int(input()) for i in range(5)]
last_menu_index = min([[i, x % 10 ] for i, x in enumerate(menu) if x % 10 != 0 ]+[[123,123]], key=lambda x: x[1])[0]
print(sum([math.ceil(x / 10) * 10 if last_menu_index != i else menu[last_menu_index] for i, x in enumerate(menu)]))

Buggy submission (verdict: Runtime Error):
import math

menu = [int(input()) for i in range(5)]
last_menu_index = min([[i, x % 10 ] for i, x in enumerate(menu) if x % 10 != 0 ], key=lambda x: x[1])[0]
print(sum([math.ceil(x / 10) * 10 if last_menu_index != i else menu[last_menu_index] for i, x in enumerate(menu)]))
Problem p03251 (python)

Fixed submission:

i = lambda:map(int,input().split())
_,_,x,y = i()
print('No War' if len(set(range(max(i())+1,min(i())+1)).intersection(set(range(x+1,y+1)))) > 0 else 'War')

Buggy submission (verdict: Runtime Error):

i = lambda:map(int,input().split())
_,_,x,y = i()
x_sigma = list(i())
y_sigma = list(i())
print('No War' if max(*x_sigma,x) < min(*y_sigma,y) else 'War')

Buggy submission (verdict: Runtime Error):

i = lambda:map(int,input().split())
_,_,x,y = i()
print('No War' if max(*i(),x) < min(*i(),y) else 'War')
Problem p03633 (python)

Fixed submission:
from fractions import gcd

n = int(input())
tn = [int(input()) for _ in range(n)]
answer = tn[0]
for i in range(1,n):
    answer = answer * tn[i] // gcd(answer,tn[i])
print(answer)

Buggy submission (verdict: Runtime Error):
from math import gcd

n = int(input())
tn = [int(input()) for _ in range(n)]
answer = tn[0]
for i in range(1,n):
    answer = answer * tn[i] // gcd(answer,tn[i])
print(answer)
Problem p03673 (python)

Fixed submission:
n = int(input())
an = input().split()
if n == 1:
    print(an[0])
else:
    print(" ".join(list(reversed(an[1::2]))+an[::2]) if n%2==0 else " ".join(list(reversed(an[::2]))+an[1::2]))

Buggy submission (verdict: Runtime Error):
n = int(input())
an = input().split()
if n == 1:
    print(an[0])
else:
    print(" ".join(list(reversed(an[1::2]))+an[::2]) if n%2==0 else " ".join(reversed(an[::2])+an[1::2]))
Problem p03680 (python)

Fixed submission:
n = int(input())
an = [int(input()) for i in range(n)]
c, s = 1, an[0]
while s != 2 and c < n:
    c, s = c + 1, an[s - 1]
print(c if c < n else -1)

Buggy submission (verdict: Runtime Error):
n = int(input())
an = [int(input()) for i in range(n)]
c, s = 1, a[0]
while s != 2 and c < n:
    c, s = c + 1, a[s - 1]
print(c if c < n else -1)
Problem p03999 (python)

Fixed submission:
s = input()
answer = 0

if len(s) == 1:
    print(s)
else:
    for i in range(2**(len(s)-1)):
        f = s[0]
        for j,b in enumerate(str(format(i,'b').zfill(len(s)-1))):
            if b == '1':
               f += ','
            f += s[j+1]
        answer += sum(int(i) for i in f.split(','))
    print(answer)

Buggy submission (verdict: Runtime Error):
s = input()
answer = 0

if len(s) == 1:
    print(s)
for i in range(2**(len(s)-1)):
    f = s[0]
    for j,b in enumerate(str(format(i,'b').zfill(len(s)-1))):
        if b == '1':
           f += ','
        f += s[j+1]
    answer += sum(int(i) for i in f.split(','))
print(answer)

Buggy submission (verdict: Runtime Error):
s = input()
answer = 0
for i in range(2**(len(s)-1)):
    f = s[0]
    for j,b in enumerate(str(format(i,'b').zfill(len(s)-1))):
        if b == '1':
           f += ','
        f += s[j+1]
    answer += sum(int(i) for i in f.split(','))
print(answer)
Problem p02783 (python)

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


ans=0
while True:
   H -= A
   ans += 1
   if H<=0:
      break
        
print(ans)

Buggy submission (verdict: Runtime Error):
H,N=map(int,input().split())
A=map(int,input().split())
if sum(A)>=H:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
H,N=map(int,input().split())
A=[int(x) for x in input().split()]
if sum(A)>=H:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
H=int(input())
A=int(input())

ans=0
while True:
   H -= A
   ans += 1
   if H<=0:
      break
        
print(ans)
Problem p02801 (python)

Fixed submission:
print(chr(ord(input())+1))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
 
def main():
    N, M = map(int, input().split())
 
    ac_check = [False] * N
    p_counts = [0] * N
 
    for i in range(M):
        p, s = input().strip().split()
        p = int(p) - 1
        if s == "AC":
            if not ac_check[p]:
                ac_check[p] = True
        else:
            if not ac_check[p]:# まだ正解していないならペナルティ追加
                p_counts[p] += 1
 
    ac_count = 0
    p_count = 0
    for i in range(N):
        if ac_check[i]:# 正解している問題のみ考慮
            ac_count += 1
            p_count += p_counts[i]
    print(ac_count, p_count)
 
 
if __name__ == "__main__":
    main()
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):
K,X=map(int,input().split())
if 500*K>=X:
  print(Yes)
else:
  print(No)
Problem p02817 (python)

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

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
for x in range(K):
    if A>=1:
        A-=1
    else:
        B-=1
print(A,B)
Problem p02848 (python)

Fixed submission:
N = int(input())
S = input()

ans=""
for x in S:
    nc=ord(x)
    nc+=N
    if nc>90:
        nc-=26
    ans+=chr(nc)
print(ans)

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

ans=""
for x in range(len(S)):
    nc=ord(N[x])
    nc+=N
    if nc>90:
        nc-=26
    ans+=chr(nc)
print(ans)

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

ans=''
for x in S:
    nc=ord(N[x])
    nc+=N
    if nc>90:
        nc-=26
    ans+=chr(nc)
print(ans)

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

ans=''
for x in range(len(S)):
    nc=ord(N[x])
    nc+=N
    if nc>90:
        nc-=26
    ans+=chr(nc)
print(ans)

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

ans=''
for x in S:
    nc=ord(N[x])+N
    if nc>90:
        nc-=26
    ans+=chr(nc)
print(ans)

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

ans=''
for x in range(len(S)):
    nc=ord(N[x])+N
    if nc>90:
        nc-=26
    ans+=chr(nc)
print(ans)

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

ans=''
for x in range(len(S)):
    a=ord(N[x])+N
    if a>90:
        a=a-26
    b=chr(a)
    ans+=b
print(ans)
Problem p02885 (python)

Fixed submission:
A,B=map(int,input().split())
if A-2*B>=0:
  print(A-2*B)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if (A-2*B)>=0:
  print(A-2B)
else:
  print('0')

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A-2*B>=0:
  print(A-2B)
else:
  print('0')
Problem p02887 (python)

Fixed submission:
N=int(input())
S=input()
ans=1
for i in range(N-1):
    if S[i]!=S[i+1]:
       ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
for i in range(N-1):
    if S[i]==S[i+1]:
       S= S.replace(S[i],'')
print(len(S))
Problem p02911 (python)

Fixed submission:
N,K,Q = map(int,input().split())
S=[int(input()) for i in range(Q)]
Point=[int(K-Q) for i in range(N)]
for x in range(Q):
    Point[S[x]-1]+=1

for x in range(N):
    if Point[x]<1:
        print("No")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
N,K,Q = map(int,input().split())
S=[int(input()) for i in range(Q)]
Point=[int(K-Q) for i in range(N)]
for x in range(Q):
    Point[S[x]]+=1

for x in range(N):
    if Point[x]<1:
        print("No")
    else:
        print("Yes")
Problem p02921 (python)

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

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

ans = 0
i = 0
cnt = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
       cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
ans = max(ans, cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
ans=0
for i in range(3):
if S[i]==T[i]:
  ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
ans=0
for i in range(3)
if S[i]==T[i]:
  ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
ans=0
for x in range(3)
if S[i]==T[i]:
  ans+=1
print(ans)
Problem p02923 (python)

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
 
ans = 0
i = 0
cnt = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
       cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
ans = max(ans, cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
H=list(map(int,input().split()))
 
ans = 0
i = 0
cnt = 0
for i in range(N):
    if H[i] >= H[i+1]:
       cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
ans = max(ans, cnt)
print(ans)

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

ans = 0
i = 0
cnt = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
       cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
ans = max(ans, cnt)
print(ans)
Problem p02945 (python)

Fixed submission:
A,B=map(int,input().split())
print(max(A+B,A-B,A*B))

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
print(max(A+B,A-B,A*B))

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
print(max(A+B,A-B,A*B))

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
print(max(A+B,A-B,A*B))

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if (A+B)>(A-B) and (A+B)>(A*B):
  print(A+B)
elif (A-B)>(A+B) and (A-B)>(A*B):
  print(A-B)
else (A*B)>(A+B) and (A*B)>(A-B):
  print(A*B)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if (A+B)>=(A-B) and (A+B)>=(A*B):
  print(A+B)
elif (A-B)>=(A+B) and (A-B)>=(A*B):
  print(A-B)
else (A*B)>=(A+B) and (A*B)>=(A-B):
  print(A*B)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A+B>=A-B and A+B>=A*B:
  print(A+B)
elif A-B>=A+B and A-B>=A*B:
  print(A-B)
else A*B>=A+B and A*B>=A-B:
  print(A*B)
Problem p02937 (python)

Fixed submission:
s = input() # これを繰り返しまくる
t = input() # これを探す

# 判定
s_set = set(s)
s_len = len(s)

if all((t_ in s_set) for t_ in t):
    ans = 0
    ss = s + s
    found_index_old = -1

    for t_ in t:
        found_index = ss.find(t_, found_index_old + 1)
        # print(ss, found_index_old + 1, found_index, found_index + 1 - (found_index_old + 1))
        ans += found_index - found_index_old # found_index + 1 - (found_index_old + 1)
        found_index_old = found_index % s_len
    print(ans)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
s = input() # これを繰り返しまくる
t = input() # これを探す

s_set = set(s)
ss = s * len(t)

if all((t_ in s_set) for t_ in t):
    current_index = 0

    for t_ in t:
        current_index = ss.find(t_, current_index) + 1
    print(current_index)
else:
    print(-1)
Problem p03448 (python)

Fixed submission:
# -*- coding: utf-8 -*-

a = int(input()) # 500
b = int(input()) # 100
c = int(input()) # 50
x = int(input())

ans = 0

for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if 500 * i + 100 * j + 50 * k == x:
                ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
A = int(input()) # num of 500 coins
B = int(input()) # num of 100 coins
C = int(input()) # num of  50 coins
X = int(input()) # amount of payment

ans = 0

Bmax = B * 100
Cmax = C * 50

for a in range(A+1):
    rest = X - 500 * a
    if rest < 0:
        break
    if rest > Bmax + Cmax:
        continue
    if rest = 0:
        ans += 1
        continue
    else: # 0 < rest <= Bmax + Cmax
        for b in range(B+1):
            rest = rest - 100 * b
            if rest < 0:
                break
            if rest > Cmax:
                continue
            else:
                ans += 1

print(ans)
Problem p03854 (python)

Fixed submission:
import sys

S = input()
S_ = S[::-1]

# words = 'dream dreamer erase eraser'.split()
# words_ = {w[::-1] for w in words}

index = 0
index_max = len(S)

while True:
    if index == index_max:
        print('YES')
        sys.exit()
    elif S_[index:].startswith('maerd'):
        index += 5
        continue
    elif S_[index:].startswith('remaerd'):
        index += 7
        continue
    elif S_[index:].startswith('esare'):
        index += 5
        continue
    elif S_[index:].startswith('resare'):
        index += 6
        continue
    else:
        print('NO')
        sys.exit()

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

words = {'dream', 'dreamer', 'erase', 'eraser'}

def is_prefix_daydream(s, prefix):
    if s == prefix:
        return True
    elif s.startswith(prefix):
        return is_daydream(s[len(prefix):])
    else:
        return False

def is_daydream(s):
    if s == '':
        return True
    else:
        return any(is_prefix_daydream(s, w) for w in words)

if is_daydream(s):
    print('YES')
else:
    print('NO')

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

words = {'dream', 'dreamer', 'erase', 'eraser'}

def is_prefix_daydream(s, prefix):
    if s == prefix:
        return True
    elif s.startswith(prefix):
        return is_daydream(s[len(prefix):])
    else:
        return False

def is_daydream(s):
    if s == '':
        return True
    else:
        return any(is_prefix_daydream(s, w) for w in words)

if is_daydream(s):
    print('YES')
else:
    print('NO')
Problem p02741 (python)

Fixed submission:
A=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K=int(input())

print(A[K-1])

Buggy submission (verdict: Runtime Error):
A=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K=int(input())

print(A[K]-1)
Problem p02743 (python)

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

if c-a-b>0 and 4*a*b<(c-b-a)*(c-a-b):
    print('Yes')
else:
    print('No')

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

from decila import Decimal

if Decimal.sqrt(a)+Decimal.sqrt(b)<Decimal.sqrt(c):
    print('Yes')
else:
    print('No')
Problem p02945 (python)

Fixed submission:
x=input().split()

for i in range(2):
    x[i]=int(x[i])

y=[0]*3
y[0]=x[0]+x[1]
y[1]=x[0]-x[1]
y[2]=x[0]*x[1]
 
print(max(y))

Buggy submission (verdict: Runtime Error):
I=int(input().split())
x=int(input().split())
y=int(input().split())

if (min(y,I[3])-max(x,I[2]))>0:
    print('No War')
    
else :
    print('War')

Buggy submission (verdict: Runtime Error):
x=input().split()

y=[0]*3
y[0]=x[0]+x[1]
y[1]=x[0]-x[1]
y[2]=x[0]*x[1]
 
print(max(y))

Buggy submission (verdict: Runtime Error):
import sys
 
argv=sys.argv
 
x=[0]*2
for i in range(2):
	x[i]=(int)(argv[i+1])
    
y=[0]*3
y[0]=x[0]+x[1]
y[1]=x[0]-x[1]
y[2]=x[0]*x[1]
 
print(max(y))

Buggy submission (verdict: Runtime Error):
import sys
 
argv=sys.argv
 
x=[0]*2
for i in range(2):
	x[i]=(int)(argv[i+1])
    
y=[0]*3
y[0]=x[0]+x[1]
y[1]=x[0]-x[1]
y[2]=x[0]*x[1]
 
print(max(y))

Buggy submission (verdict: Runtime Error):
import sys

argv=sys.argv

x=[0]*2
for i in range(2):
	x[i]=(int)(argv[i+1])
    
y=[0]*3
y[0]=x[0]+x[1]
y[1]=x[0]-x[1]
y[2]=x[0]*x[1]

print(max(y))

Buggy submission (verdict: Runtime Error):
argv=sys.argv

x=[0]*2
for i in range(10):
	x[i]=(int)(argv[i+1])
    
MAX=x[0]+x[1]
MIN=x[0]-x[1]
MUL=x[0]*x[1]

print(max(MAX,MIN,MUL))
Problem p02958 (python)

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

P=sorted(p)
flag=0

for i in range(0,N):
    if p[i]!=P[i]:
        flag+=1

if flag==2:
    print('YES')
elif flag==0:
    print('YES')
else :
    print('NO')

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

P=sorted(p)
print(p)
print(P)
flag=0

for i in range(0,5):
    if p[i]!=P[i]:
        flag+=1

if (flag==2)or(flag==0):
    print('YES')
else :
    print('NO')

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

P=sorted(p)

flag=0

for i in range(0,5):
    if p[i]!=P[i]:
        flag+=1

if flag==2:
    print('YES')
else :
    print('NO')
Problem p02969 (python)

Fixed submission:
r=input()

print(3*int(r)*int(r))

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

print(3*int(r)*int(r)
Problem p03238 (python)

Fixed submission:
N=int(input())

if N==1:
    print('Hello World')

elif N==2:
    A=int(input())
    B=int(input())
    print(A+B)

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

if N==1:
    print('Hello World')
else : 
    print(A+B)
Problem p03251 (python)

Fixed submission:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))

x.append(X)
y.append(Y)

if (min(y)-max(x))>0:
    print('No War')
    
else :
    print('War')

Buggy submission (verdict: Runtime Error):
I=int(input().split())
x=int(input().split())
y=int(input().split())

if (min(y,I[3])-max(x,I[2]))>0:
    print('No War')
    
else :
    print('War')

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

if (min(y,Y)-max(x,X))>0:
    print('No War')
    
else :
    print('War')

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

if (min(y,Y)-max(x,X))>0:
    print('No War')
    
else :
    print('War')

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

if (min(y,Y)-max(x,X))>0:
    print('No War')
    
else :
    print('War')
Problem p03260 (python)

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


if (A*B)%2==0:
    print('No')
else :
    print('Yes')

Buggy submission (verdict: Runtime Error):
if A*B%2==0:
    print('No')
else :
    print('Yes')
Problem p03280 (python)

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

print(A*B-A-B+1)

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

print(A*B-A-B+1)
Problem p03284 (python)

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

if N%K==0:
    print(0)
else:
    print(int(N/K)+1-int(N/K))

Buggy submission (verdict: Runtime Error):
if N/K==1:
    print(0)
else:
    print(int(N/K)+1-int(N/K))
Problem p03399 (python)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())

print(min(A,B)+min(C,D))

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

print(min(A,B)+min(C,D))
Problem p03469 (python)

Fixed submission:
S=str(input())

S_changed=S[:3]+'8'+S[4:]

print(S_changed)

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

S[3]=8

print(S)
Problem p03543 (python)

Fixed submission:
N=input()

if N[0]==N[1] and N[1]==N[2]:
    print('Yes')
elif N[1]==N[2] and N[2]==N[3]:
    print('Yes')
else :
    print('No')

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

if N[0]==N[1] and N[1]==N[2]:
    print('Yes')
elif N[1]==N[2] and N[2]==N[3]:
    print('Yes')
elif N[2]==N[3] and N[3]==N[0]:
    print('Yes')
elif N[0]==N[2] and N[31]==N[3]:
    print('Yes')
else :
    print('No')
Problem p03605 (python)

Fixed submission:
N=list(input())
flag=0

for i in range(0,2):
    if int(N[i])==9:
        flag+=1
    
if flag==0:
    print('No')
else :
    print('Yes')

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

flag=0

for i in N:
    if N[i]==9:
        flag+=1
    
if flag==0:
    print('No')
else :
    print('Yes')
Problem p03729 (python)

Fixed submission:
A,B,C=input().split()

if A[-1]==B[0] and B[-1]==C[0]:
    print('YES')
else :
    print('NO')

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

if A[2]==B[0] and B[2]==C[0]:
    print('YES')
else :
    print('NO')

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

if A[2]==B[0] and B[2]==C[0]:
    print('YES')
else :
    print('NO')
Problem p03238 (python)

Fixed submission:
n = int(input())
if n==1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(int(a+b))

Buggy submission (verdict: Runtime Error):
n = int(input())
if n==1:
  	print("Hello World")
else:
  	a,b = map(int,input().split())
    print(int(a+b))

Buggy submission (verdict: Runtime Error):
n = int(input())
if n==1:
  print("Hello World")
else:
  a,b = map(int,input().split())
  print(int(a+b))
Problem p03289 (python)

Fixed submission:
s = input()
ans = "AC"
if s[0] != 'A':
    ans = "WA"
cnt = 0
for i in range(1,len(s)):
    if s[i].isupper():
        if i == 1 or s[i]!= "C" or i==len(s)-1:
            ans = "WA"
        cnt+=1
if cnt!=1:
    ans="WA"
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = "AC"
if s[0] != 'A':
    ans = "WA"
cnt = 0
for i in s[2:-1]:
    if i.isupper() and i!='C':
        ans ="WA"
    elif i=='C':
        cnt +=1

if cnt!=1:
    flag=False
print("AC"if flag else "WA")