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

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

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
L = []
a = 0
for i in range(a,N-1):
    n = 0
    for j in range(i,N):
        if j == N-1:
            L.append(n)
            break
        elif H[j] >= H[j+1]:
            n += 1
        else:
            L.append(n)
            a += n+1
            break
print(max(L))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
L = []
for i in range(N-1):
    n = 0
    for j in range(i,N-1):
        if H[j] >= H[j+1]:
            n += 1
        else:
            break
    L.append(n)
print(max(L))
Problem p02995 (python)

Fixed submission:
import fractions
A,B,C,D = map(int,input().split())
K = B-A+1
E = (C*D)//fractions.gcd(C,D)
c = B//C - (A-1)//C
d = B//D - (A-1)//D
e = B//E - (A-1)//E
print(K-c-d+e)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
K = B-A+1
E = (C*D)//math.gcd(C,D)
c = B//C - (A-1)//C
d = B//D - (A-1)//D
e = B//E - (A-1)//E
print(K-c-d+e)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
K = B-A+1
E = (C*D)//math.gcd(C,D)
c = B//C - (A-1)//C
d = B//D - (A-1)//D
e = B//E - (A-1)//E
print(K-c-d+e)
Problem p03014 (python)

Fixed submission:
H,W = map(int,input().split())
S = []
for i in range(H):
    S.append(list(input()))
L = [[0 for _ in range(W)] for _ in range(H)]
R = [[0 for _ in range(W)] for _ in range(H)]
D = [[0 for _ in range(W)] for _ in range(H)]
U = [[0 for _ in range(W)] for _ in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        elif j == 0:
            L[i][j] += 1
        else:
            L[i][j] += L[i][j-1] + 1
for i in range(H):
    for j in range(-1,-W-1,-1):
        if S[i][j] == '#':
            continue
        elif j == -1:
            R[i][j] += 1
        else:
            R[i][j] += R[i][j+1] + 1
for i in range(W):
    for j in range(H):
        if S[j][i] == '#':
            continue
        elif j == 0:
            U[j][i] += 1
        else:
            U[j][i] += U[j-1][i] + 1
for i in range(W):
    for j in range(-1,-H-1,-1):
        if S[j][i] == '#':
            continue
        elif j == -1:
            D[j][i] += 1
        else:
            D[j][i] += D[j+1][i] + 1
ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans,U[i][j]+D[i][j]+L[i][j]+R[i][j]-3)
print(ans)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
S = []
for i in range(H):
    S.append(list(input()))
L = [[] for _ in range(H)]
R = L.copy
D = L.copy
U = L.copy
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            L[i].append(0)
        elif j == 0:
            L[i].append(1)
        else:
            L[i].append(L[i][-1] + 1)
for i in range(H):
    for j in range(-1,-W-1,-1):
        if S[i][j] == '#':
            R[i].insert(0,0)
        elif j == -1:
            R[i].append(1)
        else:
            R[i].insert(0,R[i][0] + 1)
for i in range(W):
    for j in range(H):
        if S[j][i] == '#':
            U[j].append(0)
        elif j == 0:
            U[j].append(1)
        else:
            U[j].append(U[j-1][-1] + 1)
for i in range(W):
    for j in range(-1,-H-1,-1):
        if S[j][i] == '#':
            D[j].append(0)
        elif j == -1:
            D[j].append(1)
        else:
            D[j].append(D[j+1][-1] + 1)
ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans,U[i][j]+D[i][j]+L[i][j]+R[i][j]-3)
print(ans)
Problem p02642 (python)

Fixed submission:
import sys
input = sys.stdin.readline

#n = int(input())
#l = list(map(int, input().split()))

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''
def cal(n,li):
    lis=[True]*(n+1)
    for item in li:
        if lis[item]:
            for i in range(item*2,n+1,item):
                lis[i]=False
    return lis
from collections import Counter

n=int(input())
a=list(map(int,input().split()))
a.sort()
l=cal(a[-1],a)
ll=Counter(a)
#print(l,ll)
ans=0
for i in range(n):
    if ll[a[i]]==1:
        if l[a[i]]:
            ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
#import sys
input = sys.stdin.readline
#n = int(input())
#l = list(map(int, input().split()))
'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)
    b.append(B)'''

def yakusuu(n):
    #約数リスト生成,バラバラに出るので.sort()を使う必要あるかも
    #PyPy推奨
    yakusuu_list = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            yakusuu_list.append(i)
            if i != n // i:
                yakusuu_list.append(n//i)
    return yakusuu_list

def ok(wa,waaa,item,bl):
    m=yakusuu(item)
    #print(m)
    if waaa[item-1]==True:
        bl.append(item-1)
        return

    waaa[item-1]=True

    for jtem in m:
        if jtem!=item and waaa[jtem-1]==True:
            bl.append(item-1)
            return

    waaa[item-1]=True
    #print(item,waaa[:25])
    return

def main():
    n=int(input())
    a=list(map(int, input().split()))
    #print(sorted(a))
    a.sort()
    wa=[a[0]]
    waaa=[False]*(a[-1])
    bl=[]

    for item in a:
        ok(wa,waaa,item,bl)

    #import collections
    print(waaa.count(True)-len(set(bl)))
    return
    #print(max(0,len(wa)-len(set(bl))))

if __name__ == "__main__":
    main()
Problem p02684 (python)

Fixed submission:
import sys
input = sys.stdin.readline
#n = int(input())
#l = list(map(int, input().split()))
'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

n, k = map(int, input().split())
a = list(map(int, input().split()))

cnt=0
now=1
cyc=0
visited=[0]*n
flg=False
for i in range(k):
    cnt+=1
    now=a[now-1]
    visited[now-1]+=1
    if visited[now-1]==2:
        cyc+=1
        #print(cyc)
    if visited[now-1]==3:
        flg=True
        #print(visited,cyc,now)
        #cyc-=1
        break
    #print(visited,now)
#print(cyc, cnt, now, (k-cnt+2*cyc) % cyc)
if flg:
    for i in range((k-cnt+2*cyc)%cyc):
        now=a[now-1]
    print(now)
else:
    print(now)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
#n = int(input())
#l = list(map(int, input().split()))
'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

n, k = map(int, input().split())
a = list(map(int, input().split()))

cnt=0
now=1
cyc=0
visited=[0]*n
flg=False
for i in range(k):
    cnt+=1
    now=a[now-1]
    visited[now-1]+=1
    if visited[now-1]==1:
        cyc+=1
        #print(cyc)
    if visited[now-1]==2:
        flg=True
        cyc-=1
        break
    #print(visited)
#print(cyc,cnt,now,k-cnt+cyc)
if flg:
    for i in range((k-cnt+cyc)%cyc):
        now=a[now-1]
    print(now)
else:
    print(now)
Problem p02761 (python)

Fixed submission:
import sys
input = sys.stdin.readline
#n = int(input())
#l = list(map(int, input().split()))
'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

n,m=map(int, input().split())
s = []
c = []
if m!=0:
    for i in range(m):
        a, b = map(int, input().split())
        s.append(a)
        c.append(b)

    if n==1:
        if c[0]==0:
            print(0)
            sys.exit()
    def ok(num,m,s,c):
        for i in range(m):
            if str(num)[s[i]-1] != str(c[i]):
                return False
        return True
        
    for num in range(10**(n-1),10**n):
        if ok(num,m,s,c):
            print(num)
            sys.exit()

    print(-1)
else:
    if n==1:
        print(0)
    else:
        print(10**(n-1))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
#n = int(input())
#l = list(map(int, input().split()))
'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

n,m=map(int, input().split())
s = []
c = []
for i in range(m):
    a, b = map(int, input().split())
    s.append(a)
    c.append(b)

if n==1:
    if c[0]==0:
        print(0)
        sys.exit()
def ok(num,m,s,c):
    for i in range(m):
        if str(num)[s[i]-1] != str(c[i]):
            return False
    return True
    
for num in range(10**(n-1),10**n):
    if ok(num,m,s,c):
        print(num)
        sys.exit()

print(-1)
Problem p02791 (python)

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

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''


n = int(input())
p = list(map(int, input().split()))

mi = 1000000000
cnt = 0
for i in range(n):
    if p[i] <= mi:
        cnt += 1
    if mi > p[i]:
        mi = p[i]

print(cnt)

Buggy submission (verdict: Runtime Error):
#include<stdio.h>

int con(int a,int b){
    if(a>b){
       return b; 
    }else{
        return a;
    }
}

int main(void){
    int n;
    int count=0;
    int a[200000];
    int min=__INT_MAX__;

    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }

    for(int i=0;i<n;i++){
        min=con(min,a[i]);
        if(min==a[i]){
            count++;
        }
    }

    printf("%d",count);
}
Problem p02802 (python)

Fixed submission:
#n = int(input())
#L = list(map(int, input().split()))
#import math
#import sys
#import heapq
#import fractions
#import bisect
#import numpy




NM = list(map(int, input().split()))
ps = [list(input().split()) for i in range(NM[1])]
a=[0]*NM[0]
flg = [True]*NM[0]
for i in range(NM[1]):
    ps[i][0] = int(ps[i][0])

ans = [0]*NM[0]
ac = 0
for i in range(NM[1]):
    if ps[i][1] == "AC" and flg[ps[i][0]-1]:
        flg[ps[i][0]-1] = False
        ans[ps[i][0]-1] = a[ps[i][0]-1]
    if ps[i][1] == "WA" and flg[ps[i][0]-1]:
        a[ps[i][0]-1] += 1

for i in range(NM[0]):
    if flg[i]== False:
        ac += 1
print(ac,sum(ans))

Buggy submission (verdict: Runtime Error):
#n = int(input())
#L = list(map(int, input().split()))
#import math
#import sys
#import heapq
#import fractions
#import bisect
#import numpy




NM = list(map(int, input().split()))
ps = [list(input().split()) for i in range(NM[1])]
a=[0]*NM[0]
flg = [True]*NM[0]
for i in range(NM[1]):
    ps[i][0] = int(ps[i][0])

ans = [0]*NM[0]
ac = 0
for i in range(NM[1]):
    if ps[i][1] == "AC":
        flg[ps[i][0]-1] = False
        ans[ps[i][0]-1] = a[ps[i][0]-1]
    if ps[i][1] == "WA" and flg[ps[i][0]-1]:
        a[ps[i][0]-1] += 1

for i in range(NM[0]):
    if flg[i]== False:
        ac += 1
print(ac,sum(ans))#n = int(input())
#L = list(map(int, input().split()))
#import math
#import sys
#import heapq
#import fractions
#import bisect
#import numpy




NM = list(map(int, input().split()))
ps = [list(input().split()) for i in range(NM[1])]
a=[0]*NM[0]
flg = [True]*NM[0]
for i in range(NM[1]):
    ps[i][0] = int(ps[i][0])

ans = [0]*NM[0]
ac = 0
for i in range(NM[1]):
    if ps[i][1] == "AC":
        flg[ps[i][0]-1] = False
        ans[ps[i][0]-1] = a[ps[i][0]-1]+1
    if ps[i][1] == "WA" and flg[ps[i][0]-1]:
        a[ps[i][0]-1] += 1

for i in range(NM[0]):
    if flg[i]== False:
        ac += 1
print(ac,sum(ans)-ac)
Problem p02803 (python)

Fixed submission:
import sys
input = sys.stdin.readline
#n = int(input())
#l = list(map(int, input().split()))
'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''


def bfs(h, w, m, start):

    import queue
    d = [[0 for i in range(w)]for i in range(h)]
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]
    flg = False

    a = queue.Queue()
    a.put(start)
    #print(start)
    while not a.empty():
        hh, ww = map(int, a.get())
        for i in range(4):
            nx, ny = ww+dx[i], hh+dy[i]
            if 0 <= ny < h and 0 <= nx < w and m[ny][nx] != "#" and d[ny][nx] == 0 and [ny,nx]!=start:
                a.put([ny, nx])
                d[ny][nx] = d[hh][ww]+1
    #print(d)
    return d[hh][ww]



h, w = map(int, input().split())
m = [[]for i in range(h)]
for i in range(h):
    m[i] = list(input().rstrip())

ans=[]
for i in range(h):
    for j in range(w):
        if m[i][j]!="#":
            start=[i,j]
            ans.append(bfs(h,w,m,start))
            #print(ans)

print(max(ans))

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

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''
import queue
import numpy as np

def sol(h,w,s,start):
    dx = [1, 0, -1, 0]
    dy=[0,1,0,-1]
    inf = -1000000000
    d=np.array([[inf for i in range(w)] for i in range(h)])
    q=queue.Queue()
    q.put(start)
    d[start[1]][start[0]]=0
    while not q.empty():
        p = q.get()
        for i in range(4):
            nx=p[0]+dx[i]
            ny=p[1]+dy[i]
            if 0<=nx<w and 0<=ny<h:
                S = s[ny][0]
                if d[nx][ny]==inf:
                    
                    if S[nx]=='.':
                        q.put([nx,ny])
                        d[nx][ny]=d[p[0]][p[1]]+1
    return np.max(d)


def main():
    import sys
    input = sys.stdin.readline
    h,w = map(int, input().split())
    s = []
    for i in range(h):
        SS = list(map(str, input().split()))
        s.append(SS)
    ans=[]
    for i in range(w):
        for j in range(h):
            start = [i,j]
            ans.append(sol(h,w,s,start))
    print(max(ans))
        


if __name__ == "__main__":
    main()
Problem p02899 (python)

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

M = []

for i in range(len(L)):
    l = (L[i], i+1)
    M.append(l)

M = sorted(M)

for x in M:
    print(x[1])

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

M = []

for i in range(len(L)):
    l = (L[i], i+1)
    M.append(l)

M = sorted(M)

for x in M:
    print(M[1])
Problem p02924 (python)

Fixed submission:
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import fractions
N = int(input())
print(N*(N-1)//2)

Buggy submission (verdict: Runtime Error):
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import fractions
N = int(input())
if N >1:
    sum = N*(N-1)/2
elif N = 1:
    sum = 1
else:
    sum = 0
sum = int(sum)
print(sum)
Problem p02934 (python)

Fixed submission:

N = int(input())
#s = input()
#S = []
#for i in range(N):
S = input().split(" ")
SUM = 0
for i in range(N):
    temp = int(S[i])
    temtem = 1 / temp
    SUM += temtem
Ans = 1 / SUM
print(Ans)

Buggy submission (verdict: Runtime Error):

N = int(input())
#s = input()
#S = []
#for i in range(N):
S = input().split(" ")
SUM = 0
for i in range(N):
    temp = S[i]
    temtem = 1 / temp
    SUM += temtem
Ans = 1 / SUM
print(Ans)
Problem p02945 (python)

Fixed submission:

S = input().split()
X = int(S[0])+int(S[1])
Y = int(S[0])-int(S[1])
Z = int(S[0])*int(S[1])
if X >= Y:
    if X >= Z:
        print(X)
    else:
        print(Z)
else:
    if Y >= Z:
        print(Y)
    else:
        print(Z)

Buggy submission (verdict: Runtime Error):

S = input().split()
X = int(S[0])+int(S[1])
Y = int(S[0])-int(S[1])
Z = int(S[0])*int(S[1])
intS[0] = ss
intS[1] = dd
if X >= Y:
    if X >= Z:
        print(X)
    else:
        print(Z)
else:
    if Y >= Z:
        print(Y)
    else:
        print(Z)

Buggy submission (verdict: Runtime Error):
X = int(S[0])+int(S[1])
Y = int(S[0])-int(S[1])
Z = int(S[0])*int(S[1])
intS[0] = ss
intS[1] = dd
if X >= Y:
    if X >= Z:
        print(X)
    else:
        print(Z)
else:
    if Y >= Z:
        print(Y)
    else:
        print(Z)

Buggy submission (verdict: Runtime Error):
S = int(input().split())
print(max(S))

Buggy submission (verdict: Runtime Error):
S = int(input()).split()
print(max(S))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
X = A + B
Y = A - B
Z = A * B
if X >= Y:
    if X >= Z:
        print('',X)
    else:
        print('',Z)
else:
    if Y >= Z:
        print('',Y)
    else:
        print('',Z)

Buggy submission (verdict: Runtime Error):

A = int(input())
B = int(input())
X = A + B
Y = A - B
Z = A * B
if X >= Y:
    if X >= Z:
        print(X)
    else:
        print(Z)
else:
    if Y >= Z:
        print(Y)
    else:
        print(Z)

Buggy submission (verdict: Runtime Error):
from sys import stdin

#Slist = list(S)
#A = list(map(int, input().split()))
chinpo = True
A = int(input())
B = int(input())
X = A + B
Y = A - B
Z = A * B
listo = []
listo.append(X)
listo.append(Y)
listo.append(Z)
print(max(listo))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
X = A + B
Y = A - B
Z = A * B
listo = []
listo.append(X)
listo.append(Y)
listo.append(Z)
print(max(listo))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
X = A + B
Y = A - B
Z = A * B
listo = []
listo.append(X)
listo.append(Y)
listo.append(Z)
print(max(listo))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
X = A + B
Y = A - B
Z = A * B

print(max([X, Y, Z]))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
X = A + B
Y = A - B
Z = A * B

chinchin = [X, Y, Z]
print(max(chinchin))
Problem p02946 (python)

Fixed submission:
S = input().split()
K = int(S[0])
X = int(S[1])
s = X-K+1
e = X+K-1
for i in range(s, e):
    print(str(i)+' ')
print(e)

Buggy submission (verdict: Runtime Error):

K = int(input())
X = int(input())
s = X-K+1
for i in range(2*K -1):
    A = s+i
    print(str(A)+' ')

Buggy submission (verdict: Runtime Error):
K = int(input())
X = int(input())
s = X-K+1
e = X+K-1
for i in range(s,e):
    print(str(i)+' ')

Buggy submission (verdict: Runtime Error):
K = int(input())
X = int(input())
s = X-K+1
e = X+K-1
for i in range(s,e):
    print(i)
Problem p02952 (python)

Fixed submission:
a = int(input())
unchi = 0
while a>=1:
    if 99999 >= a >= 10000:
        unchi += 1
    elif 999 >= a >= 100:
        unchi += 1
    elif 9 >= a >= 1:
        unchi += 1
    a -= 1
print(unchi)

Buggy submission (verdict: Runtime Error):
a = map(int,input().split())
unchi = 0
while a>=1:
    a -=1
    if 99999 >= a >= 10000:
        unchi += 1
    elif 999 >= a >= 100:
        unchi += 1
    elif 9 >= a >= 1:
        unchi += 1
print(unchi)
Problem p02953 (python)

Fixed submission:
N = int(input())
H = []
H = input().split(" ")
for i in range(N):
    H[i] = int(H[i])-1

ochinchin = True
for i in range(1, N):
    if H[i] < H[i-1]:
        H[i] += 1
        if H[i] < H[i-1]:
            ochinchin = False
            break
            

if ochinchin:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

N = int(input())
H = input().split()
for i in range(N):
    H[i] = int(H[i])

ochinchin = True
for i in range(N):
    if H[i+1]<H[i]:
        H[i] -= 1
        if H[i+1]<H[i]:
            ochinchin = False
            break

if ochinchin:
    print("Yes")
else:
    print("No")

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

for i in range(N):

    if A[i] > A[i+1]:
        A[i] -= 1
        if A[i] <= A[i+1]:
            chinpo += 1
    else:
        chinpo += 1

if chinpo == N-1:
    print("Yes")
else:
    print("No")

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

for i in range(N-1):

    if A[i+1] > A[i+2]:
        A[i+1] -= 1
        if A[i+2] >= A[i+1]:
            chinpo += 1
    else:
        chinpo += 1

if chinpo == N-1:
    print("Yes")
else:
    print("No")

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

for i in range(N-1):

    if A[i] > A[i+1]:
        A[i] -= 1
        if A[i+1] >= A[i]:
            chinpo += 1
    else:
        chinpo += 1

if chinpo == N-1:
    print("Yes")
else:
    print("No")
Problem p02971 (python)

Fixed submission:
import copy

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

chinpo = max(A)
B = copy.copy(A)
B.remove(max(A))
chinchin = max(B)

for i in range(A.index(max(A))):
    print(chinpo)
print(chinchin)
for i in range(A.index(max(A))+1,N):
    print(chinpo)

Buggy submission (verdict: Runtime Error):
import copy

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

chinpo = max(A)
B = copy.copy(A)
B.remove(max(A))
chinchin = max(B)

for i in range(N):
    if i == A.index("max(A)"):
        print(chinpo)
    else:
        print(chinchin)

Buggy submission (verdict: Runtime Error):

import copy

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

chinpo = max(A)
B = copy.copy(A)
while max(A) in B:
    B.remove(max(A))
chinchin = max(B)

for i in range(N):
    if chinpo > A[i]:
        print(chinpo)
    else:
        print(chinchin)
Problem p02983 (python)

Fixed submission:

LR = input().split()
L = int(LR[0])
R = int(LR[1])
S = []

if R - L >= 2019:
    print("0")
else:
    for i in range(L,R):
        for j in range(i+1,R+1):
            S.append(i * j % 2019)
    print(min(S))

Buggy submission (verdict: Runtime Error):

LR = input().split()
L = int(LR[0])
R = int(LR[1])
S = []

if R - L >= 2019:
    print("0")
else:
    for i in range(L+1,R):
        for j in range(i+1,R+1):
            S.append(i * j % 2019)
    print(min(S))

Buggy submission (verdict: Runtime Error):

LR = input().split()
L = int(LR[0])
R = int(LR[1])
S = []

if R - L > 2019:
    print("0")
else:
    for i in range(L,R-1):
        for j in range(i-1,R):
            S.append(i * j % 2019)
    print(min(S))
Problem p02996 (python)

Fixed submission:
#m = imt(imput())
#L = list(map(imt, imput().split()))
import math
import sys

N = int(input())
AB = [list(map(int, input().split())) for i in range(N)]
AB.sort(key=lambda x: x[1])

def aa(N,AB):
    clk = 0
    flg = True
    for i in range(N):
        clk += AB[i][0]
        if clk > AB[i][1]:
            flg = False
            break
    if flg:
        return "Yes"
    else:
        return "No"
print(aa(N,AB))

Buggy submission (verdict: Runtime Error):
#m = imt(imput())
#L = list(map(imt, imput().split()))
import math
import sys

N = int(input())
AB = [list(map(int, input().split())) for i in range(N)]


def aa(N,AB):
    AB.sort(key=lambda x: x[1])
    for i in range(N-1):
        clk += AB[i][0]
        if clk >= AB[i][1]:
            flg = False
            break
    if flg:
        return "Yes"
    else:
        return "No"
print(aa(N,AB))

Buggy submission (verdict: Runtime Error):
#m = imt(imput())
#L = list(map(imt, imput().split()))
import math
import sys

N = int(input())
AB = [list(map(int, input().split())) for i in range(N)]


def aa(N,AB):
    AB.sort(key=lambda x: x[1])
    for i in range(N-1):
        clk += AB[i][0]
        if clk >= AB[i][1]:
            flg = False
            break
    if flg:
        return "Yes"
    else:
        return "No"
print(aa())