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

Fixed submission:
# -*- coding: utf-8 -*-
import sys
from operator import itemgetter
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy
from collections import Counter, deque, defaultdict
import heapq
from functools import reduce
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template

def divisor(n):
    ret = list()
    for i in range(1, int(sqrt(n)) + 1):
        if n % i == 0:
            ret.append(i)
            # ret.append(n // i) if i * i != n else None
    return sorted(ret)


def main():
    S = ii()
    X1, Y1 = 0, 0
    if (S <= 10 ** 9):
        print(0, 0, S, 0, 0, 1)
        sys.exit()
    for i in range(floor(sqrt(S)) - 3, floor(sqrt(S)) + 1000):
        if i * i >= S:
            if i * i == S:
                print(0, 0, i, 0, 0, i)
                sys.exit()
            if (i ** 2 - S) // divisor(i ** 2 - S)[-1] > 10**9:
                continue
            else:
                n = i
                break
    print(0, 0, n, divisor(n ** 2 - S)[-1], (n ** 2 - S) // divisor(n ** 2 - S)[-1], n)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
from operator import itemgetter
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy
from collections import Counter, deque, defaultdict
import heapq
from functools import reduce
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template

def divisor(n):
    ret = list()
    for i in range(1, int(sqrt(n)) + 1):
        if n % i == 0:
            ret.append(i)
            # ret.append(n // i) if i * i != n else None
    return sorted(ret)


def main():
    S = ii()
    X1, Y1 = 0, 0
    for i in range(floor(sqrt(S)) - 3, floor(sqrt(S)) + 1000):
        if i * i >= S:
            if (i ** 2 - S) // divisor(i ** 2 - S)[-1] > 10**9:
                continue
            else:
                n = i
                break
    print(0, 0, n, divisor(n ** 2 - S)[-1], (n ** 2 - S) // divisor(n ** 2 - S)[-1], n)

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

Fixed submission:
N=int(input())
a=[list(map(int,input().split())) for i in range(N)]
a.sort()
print(sum(a[-1]))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[list(map(int,input().split())) for i in range(N)]
a.sort()
print(sum(a[0]))
Problem p02780 (python)

Fixed submission:
n, k = map(int, input().split())
P = list(map(int, input().split()))
maxv = tempsum = sum(P[:k])
for i in range(1, n-k+1):
	tempsum = tempsum - P[i-1] + P[i+k-1]
	maxv = max(maxv, tempsum)
print((maxv + k) * 0.5)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = map(int, input().split())
P = list(map(int, input().split()))
for i in range(len(P)):
	P[i] = (P[i] + 1) * 0.5
maxv = 0
for i in range(n):
	maxv = max(maxv, sum(P[i:i+k]))
print(maxv)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = map(int, input().split())
P = np.array(list(map(int, input().split())))
# P = list(map(int, input().split()))
P = (P + 1) * 0.5
maxv = 0
for i in range(n):
	maxv = max(maxv, sum(P[i:i+k]))
print(maxv)
Problem p03102 (python)

Fixed submission:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for i in range(n) :
	a = list(map(int, input().split()))
	if sum([x * y for (x, y) in zip(a, b)]) + c > 0 :
		ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m, c = map(int, input().split())
b = np.array(list(map(int, input().split())))
ans = 0
for i in range(n) :
	a = np.array(list(map(int, input().split())))
	if np.sum(a * b) + c > 0 :
		ans += 1
print(ans)
Problem p03673 (python)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
if len(A) % 2:
	print(*(A[-1::-2] + A[1::2]))
else:
	print(*(A[-1::-2] + A[::2]))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
if len(A) % 2:
	print(*A[-1::-2], *A[1::2])
else:
	print(*A[-1::-2], *A[::2])
Problem p03032 (python)

Fixed submission:
from collections import deque
from copy import deepcopy

length,kaisu=map(int,input().split())
A=deque(map(int,input().split()))
maxhist=[0]
for left in range(kaisu+1):
  for right in range(kaisu-left+1):
    l=deepcopy(A)
    point=[]
    dropable=kaisu-left-right
    for i in range(left):
      try:
        num=l.popleft()
        point.append(num)
      except:
        pass
    for j in range(right):
      try:
        num2=l.pop()
        point.append(num2)
      except:
        pass
    droptime=0
    while(droptime<dropable):
      if point==[]:
        break
      elif min(point)>0:
        break
      else:
        try:
          point.sort(reverse=True)
          point.pop(-1)
          droptime+=1
        except:
          break
    maxhist.append(sum(point))
print(max(maxhist))

Buggy submission (verdict: Runtime Error):
from collections import deque
from copy import deepcopy

length,kaisu=map(int,input().split())
A=deque(map(int,input().split()))
maxhist=[0]
for left in range(kaisu+1):
  for right in range(kaisu-left+1):
    l=deepcopy(A)
    point=[]
    dropable=kaisu-left-right
    for i in range(left):
      num=l.popleft()
      point.append(num)
    for j in range(right):
      num2=l.pop()
      point.append(num2)
    droptime=0
    while(droptime<dropable):
      if point==[]:
        break
      elif min(point)>0:
        break
      else:
        point.sort(reverse=True)
        point.pop(-1)
        droptime+=1
    maxhist.append(sum(point))
print(max(maxhist))
Problem p03076 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
l=[a,b,c,d,e]
lastindex=0
tenmod=[a%10,b%10,c%10,d%10,e%10]
times=tenmod.count(0)
if times!=0:
  for i in range(times):
    tenmod.remove(0)
if times!=5:
  key=min(tenmod)
else:
  key=0
alltime=0
lastflag=0
for i in range(5):
  if l[i]%10==0:
    alltime+=l[i]
  elif l[i]%10==key and lastflag==0:
    alltime+=l[i]
    lastflag+=1
  else:
    alltime+=int(l[i]/10)*10+10
print(alltime)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
l=[a,b,c,d,e]
lastindex=0
tenmod=[a%10,b%10,c%10,d%10,e%10]
times=tenmod.count(0)
for i in range(times):
  tenmod.remove(0)
key=min(tenmod)
alltime=0
for i in range(5):
  if l[i]%10==0:
    alltime+=l[i]
  elif l[i]%10==key:
    alltime+=l[i]
  else:
    alltime+=int(l[i]/10)*10+10
print(alltime)
Problem p03219 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int(input().split()))
print(int(a+b/2))
Problem p03229 (python)

Fixed submission:
N=int(input())
num=[int(input()) for i in range(N)]
num.sort()

if N%2!=0: #kisu
  manaka=int(N/2)  
  sum_a=abs(num[manaka]-num[N-1])
  sum_a+=abs(num[N-1]-num[0])
  for i in range(int((N-1)/2)-1):
    sum_a+=abs(num[N-2-i]-num[i])
    sum_a+=abs(num[i+1]-num[N-2-i])
  sum_b=abs(num[manaka]-num[0])
  sum_b+=abs(num[0]-num[N-1])
  for i in range(int((N-1)/2)-1):
    sum_b+=abs(num[i+1]-num[N-1-i])
    sum_b+=abs(num[i+1]-num[N-2-i])
  print(max(sum_a,sum_b))
else:
  manaka=int(N/2)
  sum=abs(num[manaka]-num[0])
  for i in range(manaka-1):
    sum+=abs(num[i]-num[N-1-i])
    sum+=abs(num[i+1]-num[N-1-i])
  print(sum)

Buggy submission (verdict: Runtime Error):
N=int(input())
num=[int(input()) for i in range(N)]
num.sort()

if N%2!=0: #kisu
  manaka=int(N/2)
  if abs(num[manaka]-num[0])<abs(num[manaka]-num[N-1]):
    sum=abs(num[manaka]-num[N-1])
    for i in range(int((N-1)/2)):
      sum+=abs(num[N-1-i]-num[i])
      sum+=abs(num[i]-num[N-2-i])
    print(sum)     
  else:
    jun.append(manaka)
    sum=abs(num[manaka]-num[0])
    for i in range(int((N-1)/2)):
      sum+=abs(num[i]-num[N-1-i])
      sum+=abs(num[i+1]-num[N-1-i])
    print(sum)
else:
  manaka=int(N/2)
  sum=abs(num[manaka]-num[0])
  for i in range(manaka-1):
    sum+=abs(num[i]-num[N-1-i])
    sum+=abs(num[i+1]-num[N-1-i])
  print(sum)
Problem p03845 (python)

Fixed submission:
n=int(input())
t=list(map(int,input().split()))
m=int(input())
drink=[]
all=sum(t)
for i in range(m):
  drink.append(list(map(int,input().split())))
for j in range(m):
  if drink[j][0]<=n:
    print(all-t[drink[j][0]-1]+drink[j][1])
  else:
    print(all)

Buggy submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input().split()))
m=int(input())
drink=[]
all=sum(t)
for i in range(m):
  drink.append(list(map(int,input().split())))
for j in range(m):
  if drink[j][0]<=n:
    print(all-t[drink[j][0]]+drink[j][1])
  else:
    print(all)

Buggy submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input().split()))
m=int(input())
drink=[]
all=sum(t)
for i in range(m):
  drink.append(list(map(int,input().split())))
for j in range(m):
  print(all-t[drink[j][0]]+drink[j][1])

Buggy submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input().split()))
m=int(input())
drink=[]
all=sum(t)
for i in range(m):
  drink[i]=list(map(int,input().split()))
for j in range(n):
  print(all-t[j]+drink[j][1])
Problem p03993 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
sum=0
for i in range(n):
  key=l[i]
  if l[key-1]==i+1:
    sum+=1
print(int(sum/2))

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
sum=0
for i in range(n):
  if l[l[i]]==i:
    sum+=1
print(int(sum/2))
Problem p03737 (python)

Fixed submission:
l=raw_input().split()
print l[0][0].upper()+l[1][0].upper()+l[2][0].upper()

Buggy submission (verdict: Runtime Error):
l=raw_input().split()
print l[0][0].upper()+l[1][0].upper()+l[2][0].upper()
Problem p03469 (python)

Fixed submission:
x = list(input().strip().split('/'))
x[0] = 2018

print(str(x[0])+'/'+str(x[1])+'/'+str(x[2]))

Buggy submission (verdict: Runtime Error):
N, H = input().strip().split(' ')
N, H =[int(N),int(H)]
L =list()
for i in range(0,N):
    X, Y = input().strip().split(' ')
    X, Y =[int(X), int(Y)]
    L.append([X,Y])

L0 = list()
for i in range(0,N):
    L0.append(L[i][0])

L1 = list()
for i in range(0,N):
    L1.append(L[i][1])

M = max(L0)
L2 = list()

for i in range(0,N):
    if L1[i] > M:
        L2.append(L1[i])

L2 = sorted(L2)

count = 0

for i in range(0,len(L2)):
    H -= L2[i]
    count += 1
    if H <= 0:
        print(count)
        break

if H > 0:
    if H % M ==0:
        count += H//M
        print(count)
    else:
        count += H//M + 1
        print(count)
Problem p03061 (python)

Fixed submission:
from functools import reduce

def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a

def solve(N, As):
    Lgcd = [0 for _ in range(len(As) + 1)]
    Rgcd = [0 for _ in range(len(As) + 1)]
    for i in range(len(As)):
        Lgcd[i + 1] = gcd(Lgcd[i], As[i])
    for i in reversed(range(len(As))):
        Rgcd[i] = gcd(Rgcd[i + 1], As[i])
    ans = 1
    for i in range(len(As)):
        ans = max(ans, gcd(Lgcd[i], Rgcd[i + 1]))
    print(ans)


if __name__ == '__main__':
    N = int(input()) # ignore
    As = list(map(int, input().split()))
    solve(N, As)

Buggy submission (verdict: Runtime Error):
from functools import reduce

def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a

def solve(N, As):
    init_gcd = reduce(gcd, As, 0)
    Bs = list(map(lambda x: x // init_gcd, As))
    x = 1

    if N == 2:
        print(max(As[0], As[1]))
        raise "hoge"
    else:
        for idx, (b1, b2) in enumerate(zip(Bs, Bs[1:])):
            if gcd(b1, b2) == 1:
                gcd1 = reduce(gcd, Bs[:idx] + [b2] + Bs[idx + 1:], 0)
                gcd2 = reduce(gcd, Bs[:idx + 1] + [b1] + Bs[idx + 2:], 0)
                x = max(gcd1, gcd2)
                break
        print(init_gcd * x)
        return


if __name__ == '__main__':
    N = int(input()) # ignore
    As = list(map(int, input().split()))
    solve(N, As)
Problem p02934 (python)

Fixed submission:
sum = 0.00
s = 0 
N = int(input()) 
numlist = list(input().split())
for i in range(N):
	s = int(numlist[i])
	sum = sum+(1/s)
print(1/sum)

Buggy submission (verdict: Runtime Error):
sum = 0
N = input() 
for i in range(int(N)):
	s = float(input())
	sum = sum+(1/s)
print(sum)

Buggy submission (verdict: Runtime Error):
sum = 0
N = input() 
for i in range(N):
	s = input()
	sum += 1/s
print(sum)

Buggy submission (verdict: Runtime Error):
int N
float sum = 0
N = input() 
for i in range(N)
	s = input()
	sum = (float)1/s
print(sum)

Buggy submission (verdict: Runtime Error):
int N
float sum = 0
N = input() 
for i in N
	s = input()
	sum = (float)1/s
print(sum)
Problem p02761 (python)

Fixed submission:
#import pysnooper
#import numpy
#import os,re,sys,operator
#from collections import Counter,deque
#from operator import itemgetter,mul
#from itertools import accumulate,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from bisect import bisect_left,bisect_right
#from copy import deepcopy
#import heapq
#import math
#import string
#from time import time
#from functools import lru_cache,reduce
#from math import factorial,hypot
#import sys
#from fractions import gcd
setrecursionlimit(10**6+1)
input=stdin.readline

n,m=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(m)]
for i in range(1000):
    now=str(i)
    if len(now)!=n:
        continue
    ch=True
    for j in range(m):
        #print(now[a[j][0]-1],a[j][1])
        if int(now[a[j][0]-1])!=a[j][1]:
            ch=False
            break
    if ch:
        print(i)
        exit()
print(-1)

Buggy submission (verdict: Runtime Error):
#import pysnooper
#import numpy
#import os,re,sys,operator
#from collections import Counter,deque
#from operator import itemgetter,mul
#from itertools import accumulate,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from bisect import bisect_left,bisect_right
#from copy import deepcopy
#import heapq
#import math
#import string
#from time import time
#from functools import lru_cache,reduce
#from math import factorial,hypot
#import sys
#from fractions import gcd
setrecursionlimit(10**6+1)
input=stdin.readline

n,m=map(int,input().split())
ans=["" for _ in range(n)]
for _ in range(m):
    s,c=map(int,input().split())
    if ans[s-1]==c:
        continue
    elif ans[s-1]=="":
        ans[s-1]=c
    else:
        print(-1)
        exit()
if ans[0]==0:
    print(-1)
    exit()
for i in range(n):
    if ans[i]=="":
        ans[i]=1
print("".join(ans)
Problem p02789 (python)

Fixed submission:
n,m=map(int,input().split())
print("Yes" if n==m else "No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
print("Yes" if n=m else "No")
Problem p02939 (python)

Fixed submission:
import os,re,sys,operator,math
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy
import heapq


setrecursionlimit(10**6)
s=stdin.readline().rstrip()
lens=len(s)
loop1=1
loop2=lens-2
t2=list(s[-1])
t1=list(s[0])
now=0
z=""
while loop1<lens:
    z=str(s[loop1])
    ch=False
    while loop1<lens:
        if z!=t1[now]:
            t1.append(z)
            ch=True
            now+=1
            break
        else:
            loop1+=1
            if loop1<lens:
                z+=s[loop1]
    if not ch:
        t1[-1]+=z
    loop1+=1
z=""
now=0
while loop2>-1:
    z=str(s[loop2])
    ch=False
    while loop2>-1:
        if z!=t2[now]:
            t2.append(z)
            ch=True
            now+=1
            break
        else:
            loop2-=1
            if loop2>-1:
                z+=s[loop2]
    if not ch:
        t2[-1]+=z
    loop2-=1
print(max(len(t1),len(t2)))

Buggy submission (verdict: Runtime Error):
import os,re,sys,operator,math
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy
import heapq
import numpy as np

setrecursionlimit(10**6)
s=stdin.readline().rstrip()
lens=len(s)
loop1=1
loop2=lens-2
t2=list(s[-1])
t1=list(s[0])
now=0
z=""
while loop1<lens:
    z=str(s[loop1])
    ch=False
    while loop1<lens:
        if z!=t1[now]:
            t1.append(z)
            ch=True
            now+=1
            break
        else:
            loop1+=1
            if loop1<lens:
                z+=s[loop1]
    if not ch:
        t1[-1]+=z
    loop1+=1
z=""
now=0
while loop2>-1:
    z=str(s[loop2])
    ch=False
    while loop2>-1:
        if z!=t2[now]:
            t2.append(z)
            ch=True
            now+=1
            break
        else:
            loop2-=1
            if loop2>-1:
                z+=s[loop2]
    if not ch:
        t2[-1]+=z
    loop2-=1
print(max(len(t1),len(t2)))
Problem p02957 (python)

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

if(a < b):
  swap = b
  b = a
  a = swap

k = (a + b) // 2

if ((((a + b) % 2) == 0) and (a >= k) and (k >= b)) :
    print(k)
else:
    print("IMPOSSIBLE")

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

if ((a + b) % 2) == 0:
    print((a + b) / 2)
else:
    print("IMPOSSIBLE")

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

if ((a + b) % 2) == 0:
    print((a + b) / 2)
else:
    print("IMPOSSIBLE")

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

if ((a + b) % 2) == 0:
    print((a + b) / 2)
else:
    print("IMPOSSIBLE")

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

if (a + b) % 2 == 0:
    print((a + b) % 2)
else:
    print("IMPOSSIBLE")
Problem p03043 (python)

Fixed submission:
import sys
import math
 
a,b=map(int, input().split())
 
probablity = 0.0
 
for i in range(a):
  ceil = math.ceil(math.log2(b / (i + 1)))
  if(ceil < 0):
    ceil = 0
    
  probablity = probablity + 1 / (a * 2 ** ceil)
  
print(probablity)

Buggy submission (verdict: Runtime Error):
import sys
import math
 
a,b=map(int, input().split())
 
probablity = 0.0
 
for i in range(a + 1):
  ceil = math.ceil(math.log2(b / (i + 1)))
  if(ceil < 0):
    ceil = 0
  elif(ceil < 1):
    ceil = 1
    
  probablity = probablity + 1 / (a * 2 ** ceil)
  
print(probablity)
import sys
import math
 
a,b=map(int, input().split())
 
probablity = 0.0
 
for i in range(a + 1):
  ceil = math.ceil(math.log2(b / (i + 1)))
  if(ceil < 0):
    ceil = 0
  elif(ceil < 1):
    ceil = 1
    
  probablity = probablity + 1 / (a * 2 ** ceil)
  
print(probablity)
import sys
import math
 
a,b=map(int, input().split())
 
probablity = 0.0
 
for i in range(a + 1):
  ceil = math.ceil(math.log2(b / (i + 1)))
  if(ceil < 0):
    ceil = 0
  elif(ceil < 1):
    ceil = 1
    
  probablity = probablity + 1 / (a * 2 ** ceil)
  
print(probablity)
import sys
import math
 
a,b=map(int, input().split())
 
probablity = 0.0
 
for i in range(a + 1):
  ceil = math.ceil(math.log2(b / (i + 1)))
  if(ceil < 0):
    ceil = 0
    
  probablity = probablity + 1 / (a * 2 ** ceil)
  
print(probablity)

Buggy submission (verdict: Runtime Error):
import sys
import math
 
a,b=map(int, input().split())
 
probablity = 0.0
 
for i in range(a + 1):
  ceil = math.ceil(math.log2(b / (i + 1)))
  if(ceil < 0):
    ceil = 0
  elif(ceil < 1):
    ceil = 1
    
  probablity = probablity + 1 / (a * 2 ** ceil)
  
print(probablity)
import sys
import math
 
a,b=map(int, input().split())
 
probablity = 0.0
 
for i in range(a + 1):
  ceil = math.ceil(math.log2(b / (i + 1)))
  if(ceil < 0):
    ceil = 0
  elif(ceil < 1):
    ceil = 1
    
  probablity = probablity + 1 / (a * 2 ** ceil)
  
print(probablity)
Problem p02830 (python)

Fixed submission:
n = input()
s, t = input().split()
print("".join("{}{}".format(a, b) for a, b in zip(s, t)))

Buggy submission (verdict: Runtime Error):
n = input()
s, t = input().split()
print("".join(f"{a}{b}" for a, b in zip(s, t)))
Problem p02999 (python)

Fixed submission:
X, A = map(int, input().split())
print(0 if X < A else 10)

Buggy submission (verdict: Runtime Error):
X, A = map(int, input().split())
print(0 if X < a else 10)
Problem p03245 (python)

Fixed submission:
import sys

N = int(input())
XY = list()
for i in range(N):
    XY.append(list(map(int, input().split(" "))))

eo = sum(XY[0]) % 2
for xy in XY:
    if (sum(xy) % 2 != eo):
        print(-1)
        sys.exit()

m = 40 - eo
print(m)
D = [2 ** i for i in range(38, -1, -1)]
if eo == 0:
    D.append(1)

print(" ".join(map(str, D)))
for x, y in XY:
    w = ""
    for i in range(m):
        if 0 <= x - y and 0 <= x + y:
            w += "R"
            x -= D[i]
        elif 0 > x - y and 0 <= x + y:
            w += "U"
            y -= D[i]
        elif 0 <= x - y and 0 > x + y:
            w += "D"
            y += D[i]
        else:
            w += "L"
            x += D[i]
    print(w)

Buggy submission (verdict: Runtime Error):
import sys

N = int(input())
XY = list()
for i in range(N):
    XY.append(list(map(int, input().split(" "))))

eo = sum(XY[0]) % 2
for xy in XY:
    if (sum(xy) % 2 != eo):
        print(-1)
        os.exit()

m = 40 - eo
print(m)
D = [2 ** i for i in range(38, -1, -1)]
if eo == 0:
    D.append(1)

print(" ".join(map(str, D)))
for x, y in XY:
    w = ""
    for i in range(m):
        if 0 <= x - y and 0 <= x + y:
            w += "R"
            x -= D[i]
        elif 0 > x - y and 0 <= x + y:
            w += "U"
            y -= D[i]
        elif 0 <= x - y and 0 > x + y:
            w += "D"
            y += D[i]
        else:
            w += "L"
            x += D[i]
    print(w)
Problem p02923 (python)

Fixed submission:
"""
左右一列にN個のマスが並んでいます。
左からi番目のマスの高さはH(i)
あなたは好きなマスに降り立ち、右隣のマスの高さが今居るマスの高さ以下である限り右隣のマスへ移動し続けます。
最大で何回移動できるでしょうか。
"""
 
import numpy as np
 
n = int(input())
h = list(map(int, input().split()))
tmp = []
ans = 0

if n != 1:
  for i in range(n-1):
    if h[i] < h[i+1]:
      tmp.append(1)
    else:
      tmp.append(0)
    
box = []   
for i in tmp:
  if i == 0:
    ans += 1
  else:
    ans = 0
  box.append(ans)
    
# print(ans)
# print(box)

if n != 1:
  rslt = max(box)
else:
  rslt = 0
  
print(rslt)

Buggy submission (verdict: Runtime Error):
"""
左右一列にN個のマスが並んでいます。
左からi番目のマスの高さはH(i)
あなたは好きなマスに降り立ち、右隣のマスの高さが今居るマスの高さ以下である限り右隣のマスへ移動し続けます。
最大で何回移動できるでしょうか。
"""
 
import numpy as np
 
n = int(input())
h = list(map(int, input().split()))
tmp = []
ans = 0
 
for i in range(n-1):
  if h[i] < h[i+1]:
    tmp.append(1)
  else:
    tmp.append(0)
    
box = []   
for i in tmp:
  if i == 0:
    ans += 1
  else:
    ans = 0
  box.append(ans)
    
# print(ans)
# print(box)
print(max(box))

Buggy submission (verdict: Runtime Error):
"""
左右一列にN個のマスが並んでいます。
左からi番目のマスの高さはH(i)
あなたは好きなマスに降り立ち、右隣のマスの高さが今居るマスの高さ以下である限り右隣のマスへ移動し続けます。
最大で何回移動できるでしょうか。
"""
 
import numpy as np
 
n = int(input())
h = list(map(int, input().split()))
tmp = []
ans = 0
 
for i in range(n-1):
  if h[i] < h[i+1]:
    tmp.append(1)
  else:
    tmp.append(0)
    
box = []   
for i in tmp:
  if i == 0:
    ans += 1
  else:
    ans = 0
  box.append(ans)
    
# print(ans)
# print(box)
print(max(box))

Buggy submission (verdict: Runtime Error):
"""
左右一列にN個のマスが並んでいます。
左からi番目のマスの高さはH(i)
あなたは好きなマスに降り立ち、右隣のマスの高さが今居るマスの高さ以下である限り右隣のマスへ移動し続けます。
最大で何回移動できるでしょうか。
"""

import numpy as np

n = int(input())
h = list(map(int, input().split()))
tmp = []
ans = 0

for i in range(n-1):
  if h[i] < h[i+1]:
    tmp.append(1)
  else:
    tmp.append(0)
    
# print(tmp)
tmp_box = []
for i in tmp:
  tmp_box.append(ans)
  if i == 0:
    ans += 1
  else:
    ans == 0
    
    
print(max(tmp_box))