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

Fixed submission:
import itertools
import math

n = int(input())
lis = [x for x in range(1,n+1)] 
xy = [list(map(int,input().split())) for i in range(n)]
permutations_lis = itertools.permutations(lis)
l = list(permutations_lis)
ans = 0

for onecase in l: 
  s = 0
  for j in range(n-1):
    s += math.sqrt((xy[onecase[j]-1][0]-xy[onecase[j+1]-1][0])**2 + (xy[onecase[j]-1][1]-xy[onecase[j+1]-1][1])**2)
  ans += s
  
print(ans/math.factorial(n))

Buggy submission (verdict: Runtime Error):
import itertools
import math

n = int(input())
lis = [x for x in range(1,n+1)]  #順列とる数列
xy = [list(map(int,input().split())) for i in range(n)]　#座標をメモ
permutations_lis = itertools.permutations(lis)　#順列とって
l = list(permutations_lis)#全順列のリストを作る
ans = 0

for onecase in l: 
  s = 0
  for j in range(n-1):
    s += math.sqrt((xy[onecase[j]-1][0]-xy[onecase[j+1]-1][0])**2 + (xy[onecase[j]-1][1]-xy[onecase[j+1]-1][1])**2)
  ans += s
  
print(ans/math.factorial(n))
Problem p02921 (python)

Fixed submission:
s = input()
t = input()
c = 0

if s[0] == t[0]:
  c += 1

if s[1] == t[1]:
  c += 1

if s[2] == t[2]:
  c += 1
    
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
 
print(int((n+1)*n/2 - n))
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
c = 0
d = 0

for j in range(n-1):
  if h[j] >= h[j+1]:
    c += 1
  else:
    d = max(c,d)
    c = 0

d = max(c,d)
print(d)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
c = 0
d = 0

for j in range(n-1):
  for i in range(n-1):
    if h[j+i] >= h[j+i+1]:
      c += 1
    else:
      d = max(d,c)
      c = 0
      break
      
print(d)
Problem p02934 (python)

Fixed submission:
n = int(input())
m = list(map(int,input().split()))
o = []
c  = 0
for i in m:
  o.append(1/m[c])
  c += 1
s = sum(o)
print(1/s)

Buggy submission (verdict: Runtime Error):
n = int(input())
m = list(map(int,input().split()))
o = []
for i in m:
  o.append(1/a[i])
p = sum(o) 
print(1/p)
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 = input()
b = int(a[0]) + int(a[2])
c = int(a[0]) - int(a[2])
d = int(a[0]) * int(a[2])
if b >= c and b >= d:
  print(b)
elif c >= b and c >= d:
  print(c)
else:
  print(d)
Problem p02952 (python)

Fixed submission:
n = input()
l = []
for i in range(1,int(n)+1):
  if len(str(i))%2 != 0:
    l.append(i)

print(len(l))

Buggy submission (verdict: Runtime Error):
n = input()
l = []
for i in range(1,int(n)+1):
  if len(i)%2 != 0:
    l.append(i)

print(len(l))
Problem p02953 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
d = [1]+[0]*(n-1)

for i in range(n-1):
  if h[i] >= 2+ h[i+1]:
    print('No')
    exit()
  if d[i] == 1 and h[i] <= h[i+1]:
    d[i+1] = 1
  elif d[i] == 0:
    if h[i] +1 <=h[i+1]:
      d[i+1] = 1
    elif h[i] -1 == h[i+1]:
      print('No')
      exit()
      
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
 
for i in range(n-1):
  if h[i] == h[i+1]+1:
    j = i
    p = 1
    break
  elif h[i] >= h[i+1] + 2:
    p = 2
    break
  else:
    j = 0
    p = 3
 
if j == 0:
  print("Yes")
else:  
  if min(h[j:]) + 2 <= h[j] or p == 2:
    print("No")
  else:
    print("Yes")

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

for i in range(n-1):
  if h[i] == h[i+1]+1:
    j = i
    p = 1
    break
  elif h[i] >= h[i+1] + 2:
    p = 2
    break
  else:
    j = 0
    p = 3

if j == 0:
  print("Yes")
else:  
  if min(h[j:]) + 2 <= h[j] or p == 2:
  print("No")
  else:
  print("Yes")

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


for i in range(n-1):
  if h[i] == h[i+1]+1:
    j = i
    p = 1
    break
  elif h[i] >= h[i+1] + 2:
    p = 2
    break
  elif h[i] <= h[i+1]:
    j = 0
    p = 3
    
if min(h[j:]) + 2 <= h[j] or p == 2:
  print("No")
else:
  print("Yes")

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

for i in range(n-1):
  if h[i] == h[i+1]+1:
    j = i
    p = 1
    break
  elif h[i] >= h[i+1] + 2:
    p = 2
    break
  else:
    j = 0
    p = 3
    
if min(h[(j+1):]) + 2 <= h[j] or p == 2:
  print("No")
else:
  print("Yes")

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

for i in range(n-1):
  if h[i] == h[i+1]+1:
    j = i
    p = 1
    break
  elif h[i] >= h[i+1] + 2:
    p = 2
    break
  else:
    j = 0
    p = 3
    
if min(h[j:]) + 2 <= h[j] or p == 2:
  print("No")
else:
  print("Yes")
Problem p02957 (python)

Fixed submission:
a,b = map(int,input().split())
ans = (a+b)/2
 
if ans == int(ans):
  print(int(ans))
else:
  print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
N = list(range(1,n+1))
c = []
a = 0
for i in N:
  if N[i-1] != p[i-1]:
    a += 1
if a == 2 or a==0:
  print("YES")
else:
  print("NO")
Problem p02958 (python)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
N = list(range(1,n+1))
c = []
a = 0
for i in N:
  if N[i-1] != p[i-1]:
    a += 1
if a == 2 or a==0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
N = list(range(1,n+1))
for i in N:
  if N[i-1] != p[i-1]:
    j = i
    break
if N[p[i-1]] == p[i-1]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
N = list(range(1,n+1))
for i in N:
  if N[i-1] != p[i-1]:
    break
if N[p[i-1]] == p[i-1]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
N = list(range(1,n+1))
for i in N:
  if N[i-1] != p[i-1]:
    break
if N[i-1] == p[N[i-1]]:
  print("YES")
else:
  print("NO")
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
w = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n+1):
    b = 0
    for m in range(d):
      b += (w[i][m]-w[j][m])**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
x = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n):
    b = 0
    for m in range(d):
      b += (x[i][m])-x[j][m])**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
x = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n+1):
    b = 0
    for m in range(d):
      b += (int(x[i][m])-int(x[j][m]))**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
x = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n+1):
    b = 0
    for m in range(d):
      b += (int(x[i][m])-int(x[j][m]))**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)
Problem p02982 (python)

Fixed submission:
n,d = map(int,input().split())
w = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n):
    b = 0
    for m in range(d):
      b += (w[i][m]-w[j][m])**2
    if (b**0.5)==float(int(b**0.5)):
      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
w = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n+1):
    b = 0
    for m in range(d):
      b += (w[i][m]-w[j][m])**2
    if (b**0.5)==float(int(b**0.5)):
      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
w = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n):
    b = 0
    for m in range(d):
      b += (w[i][m]-w[j][m])**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
x = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n):
    b = 0
    for m in range(d):
      b += (x[i][m])-x[j][m])**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
x = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n):
    b = 0
    for m in range(d):
      b += (int(x[i][m])-int(x[j][m]))**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
x = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n+1):
    b = 0
    for m in range(d):
      b += (int(x[i][m])-int(x[j][m]))**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
x = [list(map(int,input().split())) for a in range(n)]
c = 0
 
for i in range(n-1):
  for j in range(i+1,n):
    b = 0
    for m in range(d):
      b += (x[i][m]-x[j][m])**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
x = [list(map(int,input().split())) for a in range(n)]
c = 0

for i in range(n-1):
  for j in range(i+1,n+1):
    b = 0
    for m in range(d):
      b += (x[i][m]-x[j][m])**2
    if (b**0.5)　== float(int(b**0.5)):
      c += 1
      
print(c)
Problem p02993 (python)

Fixed submission:
s = input()
for i in range(3):
  if s[i] == s[i+1]:
    print('Bad')
    exit()
    
print('Good')

Buggy submission (verdict: Runtime Error):
n,l = map(int,input().split())
li = []
for i in range(1,n+1):
  li.append(abs(l+i-1))
m = min(li)
if l+i-1 >= 0:
  print(int((n*(l-1)+(n*(n+1)/2)-l-i+1)))
else:
  print(int((n*(l-1)+(n*(n+1)/2)+l+i-1)))
Problem p02999 (python)

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

if x<a:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D += l[i]
  if D <= x:
    c += 1
print(c)
Problem p03000 (python)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i-1]
  if D <= x:
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D +=l[i]
  if D <= x:
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
  else:
    li.append(D)
    
if max(li) > x:
  print(n+1)
else:
  print(c)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
  li.append(D)
if max(li) > x:
  print(n+1)
else:
  print(c)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
  else:
    break
print(c)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
  elif:
    break
print(c)
Problem p03086 (python)

Fixed submission:
s = input()
l = 0
lenmax = 0
 
for i in s:
  if i in "ACGT":
    l += 1
  else:
    lenmax = max(lenmax,l)
    l = 0
lenmax = max(lenmax,l)
print(lenmax)

Buggy submission (verdict: Runtime Error):
s = input()
l = 0
lenmax = 0
 
for i in s:
  if i in "ACGT":
    l += 1
  else:
    lenmax = max(lenmax,l)
    l = 0
lenmax = max(lenmax,l)
print(lenmaax)
Problem p03087 (python)

Fixed submission:
#累積和的な

n,q = map(int,input().split())
s = input() + 'A' 
li = [0]*(n+1)

for i in range(n):
  li[i+1] = li[i] + (1 if s[i] + s[i+1] == 'AC' else 0)
  

for j in range(q):
  l,r = map(int,input().split())
  print(li[r-1] - li[l-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = list(input())
lis = [0]*(len(s))

for i in range(len(s)-1):
  if s[i]+s[i+1] == 'AC':
    lis[i],lis[i+1] = 0.5,0.5
    

for j in range(q):
  l,r = map(int,input().split())
  su = sum(lis[l-1:r])
  if lis[l-1] == 0.5 and lis[l-2] == 0.5 and lis[r-1] == 0.5 and lis[r]==0.5:
    su -= 1
  print(int(su))
Problem p03103 (python)

Fixed submission:
n,m = map(int,input().split())
dict = {}
su = 0
kounyu = 0
 
for i in range(n):
  A,B = map(int,input().split())
  if A in dict:
    dict[A] += B  #同じAがありうる！！！！！！
  else:
    dict[A] = B
  

d = sorted(dict.items())
 
for i in range(10**99):
  if d[i][1] >= m - kounyu:
    print(su + d[i][0]*(m - kounyu))
    exit()
    
  kounyu += d[i][1]
  su += d[i][1]*d[i][0]

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
dict = {}
su = 0
kounyu = 0

for i in range(n):
  A,B = map(int,input().split())
  dict[A] = B

d = sorted(dict.items())

for i in range(10**12):
  if d[i][1] >= m - kounyu:
    print(su + d[i][0]*(m - kounyu))
    exit()
    
  kounyu += d[i][1]
  su += d[i][1]*d[i][0]

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
dict = {}
sum = 0
kounyu = 0

for i in range(n):
  A,B = map(int,input().split())
  dict[A] = B

d = sorted(dict.items())

for i in range(10**12):
  if d[i][1] >= m - kounyu:
    print(sum + d[i][0]*(m - kounyu))
    exit()
    
  kounyu += d[i][1]
  sum += d[i][1]*d[i][0]

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
dict = {}
sum = 0
kounyu = 0

for i in range(n):
  A,B = map(int,input().split())
  dict[A] = B

d = sorted(dict.items())

for i in range(n):
  if d[i][1] >= m - kounyu:
    print(sum + d[i][0]*(m - kounyu))
    exit()
    
  kounyu += d[i][1]
  sum += d[i][1]*d[i][0]
Problem p03105 (python)

Fixed submission:
a,b,c = map(int,input().split())
if b//a >= c:
  print(c)
else:
  print(b//a)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
lst = []
for i in range(1,101):
  if a%i==0 and b%i==0:
    lst.append(i)
print(sorted(lst)[len(lst)-k])
Problem p03110 (python)

Fixed submission:
n = int(input())
xu = [list(input().split()) for i in range(n)]
sigma = 0

for j in range(n):
  if xu[j][1] == "BTC":
    sigma = sigma + float(xu[j][0])*380000
  else:
    sigma = sigma + float(xu[j][0])
    
print(sigma)

Buggy submission (verdict: Runtime Error):
n = int(input())
xu = [list(int,input().split()) for i in range(n)]
sigma = 0

for j in range(n):
  if xu[j][1] == "BTC":
    sigma = sigma + int(xu[j][0])*380000
  else:
    sigma = sigma + int(xu[j][0])
    
print(sigma)

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

for j in range(n):
  if xu[j][1] == "BTC":
    sigma = sigma + xu[j][0]*380000
  else:
    sigma = sigma + xu[j][0]
    
print(sigma)
Problem p03147 (python)

Fixed submission:
import itertools
 
n = int(input())
H = list(map(int, input().split()))
 
count = 0
h_max = max(H)
for i in range(1, h_max + 1): #これが水位を上げる役割をしているのか
    watering = [(1 if h >= i else 0) for h in H] #これ以上いらないなら0　いるなら1
 
    itrs = itertools.groupby(watering)
    watering_group = [k for k, v in itrs if sum(list(v)) > 0] #ｋは要素の数字そのもの，連続するｋの並び
    count += sum(watering_group)

print(count)

Buggy submission (verdict: Runtime Error):
多分再帰使うんだろうね
Problem p03211 (python)

Fixed submission:
s = list(input())
lst = []
lst2 = []

for i in range(len(s)-2):
  lst.append(int(s[i]+s[i+1]+s[i+2]))
  lst2.append(abs(753-lst[i]))
  
print(min(lst2))

Buggy submission (verdict: Runtime Error):
s = list(input())
lst = []
lst2 = []

for i in range(7):
  lst.append(int(s[i]+s[i+1]+s[i+2]))
  lst2.append(abs(753-lst[i]))
  
print(min(lst2))
Problem p03219 (python)

Fixed submission:
x,y = map(int,input().split())
print(int(x + y/2))

Buggy submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
minabs = 10**10

for i in range(n):
  if abs(a-(t-h[i]*0.006)) < minabs:
    minabs = abs(a-(t-h[i]*0.006))
    j = i

print(j+1)
Problem p03238 (python)

Fixed submission:
n = int(input())
if n == 1:
  print("Hello World")
else:
  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")
elif n == 2:
  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)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = int(input())
B = int(input())
print("Hello World" if n==1 else A + B)
Problem p03239 (python)

Fixed submission:
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
T = []

for h in range(n):
  T.append(ct[h][1])
  
if min(T) > t:
  print("TLE")
  exit()
else:
  for j in range(n):
    if ct[j][1] <= t:
      c = ct[j][0]
      k = j
      break
 

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)

Buggy submission (verdict: Runtime Error):
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
T = []

for h in range(n):
  T.append(ct[i][1])
  
if min(T) > t:
  print("TLE")
  exit()
else:
  for j in range(n):
    if ct[j][1] <= t:
    c = ct[j][0]
    k = j
    break
 

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)

Buggy submission (verdict: Runtime Error):
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]

for j in range(n):
  if ct[j][1] <= t:
    c = ct[j][0]
    k = j
    break

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)

Buggy submission (verdict: Runtime Error):
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]

for j in range(n):
  if ct[j][1] <= t:
    c = ct[j][0]
    k = j
    break

for i in range(k+1,n):
  if ct[i][1] < t:
    c = min(c,ct[i][0])
    
print(c)

Buggy submission (verdict: Runtime Error):
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
C = []
T1 = []

for i in range(n):
  C.append(ct[i][0])
  T1.append(ct[i][1])

if min(T1) >= t:
  print("TLE")

for i in range(n):
  mc = min(C)
  if ct[C.index(min(C))][1] >= t:
    C.remove(min(C))
    ct.remove(ct[C.index(min(C))])
  else:
    break
    
print(min(C))

Buggy submission (verdict: Runtime Error):
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
C = []
T1 = []

for i in range(n):
  C.append(ct[i][0])
  T1.append(ct[i][1])

if min(T1) > t:
  print("TLE")

for i in range(n):
  mc = min(C)
  if ct[C.index(min(C))][1] > t:
    C.remove(min(C))
    ct.remove(ct[C.index(min(C))])
  else:
    break
    
print(min(C))
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()))
if max(max(x),X) < min(min(y),Y):
  print("No War")
else:
  print("War")

Buggy submission (verdict: Runtime Error):
N,M,X,Y = map(int,input().split())
x = list(input())
y = list(input())
print(x)
if X >= Y:
  print("War")
  exit()
else:
  Z = Y
  
if int(max(x)) < Z and int(min(y)) >= Z:
  print("No War")
else:
  print("War")
Problem p03264 (python)

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

Buggy submission (verdict: Runtime Error):
k = input()
if k % 2 == 0:
  print(k*k/4)
else:
  print((k//2)*((k//2)+1))
Problem p03273 (python)

Fixed submission:
import numpy as np

h,w = map(int,input().split())
a = [list(input()) for i in range(h)]
ans1 = []
ans2 = []

for i in a:
  if '#' in i:
    ans1.append(i)
    
gyouretu = np.array(ans1)
gyouretuT = gyouretu.T

for i in gyouretuT:
  if '#' in i:
    ans2.append(i)
    
ans = np.array(ans2)
answer = ans.T

for i in answer:
  print(''.join(i))

Buggy submission (verdict: Runtime Error):
import numpy as np
h,w = map(int,input().split())
a = [input() for i in range(h)]
d = "."
c = 0

for i in range(h):
  if len(set(a[i])) == 1 and a[i][0] == d:
    a.remove(a[i])

at = np.array(a)
tr = at.T

for i in range(w):
  if len(set(tr[i])) == 1 and tr[i][0] == d:
    a.remove(tr[i])
    
att = np.array(tr)
trr = att.T

for j in range(len(trr)):
  print("".join(trr[j]))
Problem p03282 (python)

Fixed submission:
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(1)
  exit()
elif s[0] != '1':
  print(s[0])
  exit()

if k > 100:
  for i in s:
    if i != '1':
      print(i)
      exit()
  print(1)
  
else:
  for i in s[:k]:
    if i != '1':
      print(i)
      exit()
  print(1)
  exit()

Buggy submission (verdict: Runtime Error):
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(s[0])
elif s[0] == '1' and s[:k] == ['1']*k and len(s) != 1:
  print(s[1])
elif s[0] == '1' and s[1] != '1':
  print(s[1])
elif s[0]!='1':
  print(s[0])

Buggy submission (verdict: Runtime Error):
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(s[0])
if s[0] == '1' and s[:k] == ['1']*k and len(s) != 1:
  print(s[1])
elif s[0]!='1':
  print(s[0])

Buggy submission (verdict: Runtime Error):
s = list(input())
k = int(input())

if s[0] == '1' and len(s) == 1:
  print(s[0])
if s[0] == '1' and s[:k] == ['1']*k:
  print(s[1])
elif s[0]!='1':
  print(s[0])

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

if s[0] == '1':
  print(s[1])
else:
  print(s[0])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
sumtmp = 0

for i in s:
  sumlen += int(i)**(5 * (10)**15)
  if sumtmp >= k:
    print(i)
Problem p03284 (python)

Fixed submission:
n,k = map(int,input().split())
if n%k ==0:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n%k ==0:
  print(0)
elif n < k:
  print((1)
else:
  print((n//k) - 1)
Problem p03292 (python)

Fixed submission:
a = sorted(list(map(int,input().split())))
print(a[2] - a[0])

Buggy submission (verdict: Runtime Error):
a = sorted(list(map(int,input()split())))
print(a[2] - a[0])
Problem p03294 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
print(sum(a)-n)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
  a.append(int(input())-1)
  
print(sum(a))
Problem p03316 (python)

Fixed submission:
n = input()
tmp = 0
 
for i in range(len(n)):
  tmp += int(n[i])
 
if int(n)%tmp == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = input()
tmp = 0

for i in range(len(n)):
  tmp += int(n[i])

if n%tmp == 0:
  print("Yes")
else:
  print("No")

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

tmp = int(n[0])+int(n[1])+int(n[2])

if int(n)%tmp == 0:
  print("Yes")
else:
  print("No")

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

tmp = n[0]+n[1]+n[2]

if n%tmp == 0:
  print("Yes")
else:
  print("No")