Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def solution(n, k, l_list):
    l_list.sort(reverse=True)
    result = sum(l_list[:k])
    return result


N, K = [int(value) for value in input().split(' ')]
l_list = [int(value) for value in input().split(' ')]
print(solution(n, k, l_list))

Fixed submission:
def solution(n, k, l_list):
    l_list.sort(reverse=True)
    result = sum(l_list[:k])
    return result


N, K = [int(value) for value in input().split(' ')]
l_list = [int(value) for value in input().split(' ')]
print(solution(N, K, l_list))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
t = ''
abc = [chr(i) for i in range(65, 65+26)]
for i in s:
  m = abc.index(i)
  if m+n <= 25:
    t += abc[m+n]
  else:
    t += abc[m+n-25]
print(t)

Fixed submission:
n = int(input())
s = input()
t = ''
abc = [chr(i) for i in range(65, 65+26)]
for i in s:
  m = abc.index(i)
  if m+n <= 25:
    t += abc[m+n]
  else:
    t += abc[m+n-26]
print(t)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
m = n/2
if n%2==0:
  if s[:m]==s[m:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Fixed submission:
n = int(input())
s = input()
m = int(n/2)
if n%2==0:
  if s[:m]==s[m:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
if n%2==0:
  if s[:n]=s[n:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Fixed submission:
n = int(input())
s = input()
m = int(n/2)
if n%2==0:
  if s[:m]==s[m:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())/2
s = input()
if s[:n]=s[n:]:
  print('Yes')
else:
  print('No')

Fixed submission:
n = int(input())
s = input()
m = int(n/2)
if n%2==0:
  if s[:m]==s[m:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
taste_list = list(map(int, input().split()))
taste_sum = 0
for i in range(n):
  for j in range(n):
    taste = taste_list[i]*taste_list[j]
    taste_sum += taste
for i in range(len(taste_list)):
  taste_sum -= taste_list[i]**2
print(taste_sum/2)

Fixed submission:
a, b = input().split()
num_a = int(a)
num_b = int(b)
dif = num_a - num_b*2
if dif >= 0:
  print(dif)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
num_a = int(A)
num_b = int(B)
dif = num_a - num_b*2
if dif >= 0:
  print(dif)
else:
  print(0)

Fixed submission:
a, b = input().split()
num_a = int(a)
num_b = int(b)
dif = num_a - num_b*2
if dif >= 0:
  print(dif)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
a, b = input()
num_a = int(a)
num_b = int(b)
dif = num_a - num_b*2
if dif >= 0:
  print(dif)
else:
  print(0)

Fixed submission:
a, b = input().split()
num_a = int(a)
num_b = int(b)
dif = num_a - num_b*2
if dif >= 0:
  print(dif)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
a, b = input()
num_a = int(a)
num_b = int(b)
dif = num_a >= num_b*2
if dif >= 0:
  print(dif)
else:
  print(0)


Fixed submission:
a, b = input().split()
num_a = int(a)
num_b = int(b)
dif = num_a - num_b*2
if dif >= 0:
  print(dif)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
a, b = input()
if a >= 2*b:
  print(a-2*b)
else:
  print(0)

Fixed submission:
a, b = input().split()
num_a = int(a)
num_b = int(b)
dif = num_a - num_b*2
if dif >= 0:
  print(dif)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = input()
b = ''
for i in range(n):
  if b[-1] != i:
    b += i
print(len(b))


Fixed submission:
n = int(input())
a = input()
b = '1'
for i in range(n):
  if a[i] != b[-1]:
    b += a[i]
print(len(b)-1)
Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
    
    
N = int(input())
ss = []
for i in range(N):
	ss.append("".join(sorted(list(input()))))
	
dicS = {}
for s in ss:
	if s not in dicS:
		dicS[s] = 1
	else:
		dicS[s] += 1
		
ans = 0
for v in dicS.values():
	ans += cmb(v, 2)
	
print(ans)

Fixed submission:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
    
    
N = int(input())
ss = []
for i in range(N):
	ss.append("".join(sorted(list(input()))))
	
dicS = {}
for s in ss:
	if s not in dicS:
		dicS[s] = 1
	else:
		dicS[s] += 1
		
#print(dicS)
		
ans = 0
for v in dicS.values():
	if v != 1:
		ans += cmb(v, 2)
	
print(ans)

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb

N = int(input())
ss = []
for i in range(N):
	ss.append("".join(sorted(list(input()))))
	
dicS = {}
for s in ss:
	if s not in dicS:
		dicS[s] = 1
	else:
		dicS[s] += 1
		
ans = 0
for v in dicS.values():
	ans += comb(v, 2, exact=True)
	
print(ans)

Fixed submission:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
    
    
N = int(input())
ss = []
for i in range(N):
	ss.append("".join(sorted(list(input()))))
	
dicS = {}
for s in ss:
	if s not in dicS:
		dicS[s] = 1
	else:
		dicS[s] += 1
		
#print(dicS)
		
ans = 0
for v in dicS.values():
	if v != 1:
		ans += cmb(v, 2)
	
print(ans)

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

def combinations_count(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N = int(input())
ss = []
for i in range(N):
	ss.append("".join(sorted(list(input()))))
	
dicS = {}
for s in ss:
	if s not in dicS:
		dicS[s] = 1
	else:
		dicS[s] += 1
		
ans = 0
for v in dicS.values():
	ans += combinations_count(v,2)
	
print(ans)

Fixed submission:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
    
    
N = int(input())
ss = []
for i in range(N):
	ss.append("".join(sorted(list(input()))))
	
dicS = {}
for s in ss:
	if s not in dicS:
		dicS[s] = 1
	else:
		dicS[s] += 1
		
#print(dicS)
		
ans = 0
for v in dicS.values():
	if v != 1:
		ans += cmb(v, 2)
	
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

R,G,B,N = map(int,input().split())

maxRBox = math.ceil(3000/R)
maxGBox = math.ceil(3000/G)
maxBBox = math.ceil(3000/B)

ans = 0
for ri in range(maxRBox+1):
	if N < ri*R:
		break
	for gi in range(maxGBox+1):
		if N < ri*R+gi*G:
			break
			
		if (N - (ri*R+gi*G)) % B == 0:
			bi = (N - (ri*R+gi*G)) // B
			if ri*R+gi*G+bi*B == N:
				ans +=1
				#print(ri,gi,bi,ri*R+gi*G+bi*B)
				
print(ans)

Fixed submission:
import math
 
R,G,B,N = map(int,input().split())
 
maxRBox = math.ceil(3000/R)
maxGBox = math.ceil(3000/G)
maxBBox = math.ceil(3000/B)
 
ans = 0
for ri in range(maxRBox+1):
	if N < ri*R:
		break
	for gi in range(maxGBox+1):
		if N < ri*R+gi*G:
			break
			
		if (N - (ri*R+gi*G)) % B == 0:
			bi = (N - (ri*R+gi*G)) // B
			if ri*R+gi*G+bi*B == N:
				ans +=1
				#print(ri,gi,bi,ri*R+gi*G+bi*B)
				
print(ans)
Buggy python submission (verdict: Runtime Error):
def ceil(v):
	if v % 10 == 0:
		return v
	else:
		return (v // 10+1) *10

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

times = [A,B,C,D,E]

minMod = 9
last = -1
for time in times:
	if minMod > (time+9) % 10:
		minMod = (time+9) % 10
		last = time
		
times.remove(last)

for i,time in enumerate(times):
	times[i] = ceil(time)
	
times.append(last)

print(sum(times))

Fixed submission:
def ceil(v):
	if v % 10 == 0:
		return v
	else:
		return (v // 10+1) *10

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

times = [A,B,C,D,E]

minMod = 9
last = times[0]
for time in times:
	if minMod > (time+9) % 10:
		minMod = (time+9) % 10
		last = time
		
times.remove(last)

for i,time in enumerate(times):
	times[i] = ceil(time)
	
times.append(last)

print(sum(times))

Buggy python submission (verdict: Runtime Error):
def ceil(v):
	if v % 10 == 0:
		return v
	else:
		return (v // 10+1) *10

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

times = [A,B,C,D,E]

minMod = 9
last = -1
for time in times:
	if minMod > (time+9) % 10:
		minMod = (time+9) % 10
		last = time
		
times.remove(last)

for i,time in enumerate(times):
	times[i] = ceil(time)
	
times.append(last)

print(times)
print(sum(times))

Fixed submission:
def ceil(v):
	if v % 10 == 0:
		return v
	else:
		return (v // 10+1) *10

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

times = [A,B,C,D,E]

minMod = 9
last = times[0]
for time in times:
	if minMod > (time+9) % 10:
		minMod = (time+9) % 10
		last = time
		
times.remove(last)

for i,time in enumerate(times):
	times[i] = ceil(time)
	
times.append(last)

print(sum(times))
Buggy python submission (verdict: Time Limit Exceeded):
A,B = map(int,input().split())

ans = A
for n in range(A+1,B+1):
	ans ^= n
	
print(ans)

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

def f0n(y):
	if y % 4 == 0:
		return y
	elif y % 4 == 2:
		return 1^y
	elif y % 4 == 3:
		return 0
	else:
		return 1
				
print(f0n(A-1)^f0n(B))
Buggy python submission (verdict: Runtime Error):
from datetime import datetime

S = input()

nowDate = datetime.strptime(S, '%Y/%m/%d')
lastDate =datetime.strptime('2019/04/30', '%Y/%m/%d')

if lastDate < nowTime:
	print("TBD")
else:
	print("Heisei")

Fixed submission:
from datetime import datetime

S = input()

nowDate = datetime.strptime(S, '%Y/%m/%d')
lastDate =datetime.strptime('2019/04/30', '%Y/%m/%d')

if lastDate < nowDate:
	print("TBD")
else:
	print("Heisei")
Buggy python submission (verdict: Runtime Error):
N = int(input())
ANs = list(map(int,input().split()))
 
def lcm_base(x, y):
	return (x * y) // gcd(x, y)
	
lcmNum = ANs[0]
for a in ANs[1:]:
	lcmNum = lcm_base(lcmNum,a)
	
#print(lcmNum)
 
f = 0
for a in ANs:
	f += (lcmNum-1)%a
print(f)

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

m_1 = 0
for a in ANs:
	m_1 += a-1
	
print(m_1)

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

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

def lcm_base(x, y):
	return (x * y) // math.gcd(x, y)
	
lcmNum = ANs[0]
for a in ANs[1:]:
	lcmNum = lcm_base(lcmNum,a)
	
#print(lcmNum)

f = 0
for a in ANs:
	f += (lcmNum-1)%a
print(f)

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

m_1 = 0
for a in ANs:
	m_1 += a-1
	
print(m_1)

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

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

def lcm_base(x, y):
	return (x * y) // math.gcd(x, y)
	
lcmNum = ANs[0]
for a in ANs[1:]:
	lcmNum = lcm_base(lcmNum,a)
	
#print(lcmNum)

f = 0
for a in ANs:
	f += (lcmNum-1)%a
print(f)

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

m_1 = 0
for a in ANs:
	m_1 += a-1
	
print(m_1)

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

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

def lcm_base(x, y):
	return (x * y) // math.gcd(x, y)
	
def lcm_list(numbers):
	return reduce(lcm_base, numbers, 1)
	
lcmNum = lcm_list(ANs)
#print(lcmNum)
#print(lcmList)

f = 0
for a in ANs:
	f += (lcmNum-1)%a
print(f)

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

m_1 = 0
for a in ANs:
	m_1 += a-1
	
print(m_1)

Buggy python submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-

import sympy
import math
from functools import reduce

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

def lcm_base(x, y):
	return (x * y) // math.gcd(x, y)
	
def lcm_list(numbers):
	return reduce(lcm_base, numbers, 1)
	
lcmNum = lcm_list(ANs)
lcmList = sympy.factorint(lcmNum)
#print(lcmNum)
#print(lcmList)


anss = []
f = 0
for a in ANs:
	f += (lcmNum-1)%a
print(f)

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

m_1 = 0
for a in ANs:
	m_1 += a-1
	
print(m_1)
Buggy python submission (verdict: Runtime Error):
n,y = map(int,input().split())
	
for s1 in range(n+1):
	for s2 in range(n-s1+1):
		if y== s1*10000+s2*5000+(n-s1-s2)*1000:
			print("{} {} {}".format(s1,s2,s3))
else:
	print("{} {} {}".format(-1,-1,-1))


Fixed submission:
n,y = map(int,input().split())
	
for s1 in range(n+1):
	for s2 in range(n-s1+1):
		if y== s1*10000+s2*5000+(n-s1-s2)*1000:
			print("{} {} {}".format(s1,s2,n-s1-s2))
			exit()
else:
	print("{} {} {}".format(-1,-1,-1))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

afters = []
for ai in range(N):
	for sign in [-1,0,1]:
		afters.append(A[ai]+sign)
		
uniq = set(afters)

counts = []
for u in list(uniq):
	counts.append(afters.count(u))
	
print(max(counts))

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

afters = []
for ai in range(N):
	for sign in [-1,0,1]:
		afters.append(A[ai]+sign)
		
uniq = set(afters)

countDic = {}
sas = sorted(afters)
for a in sas:
	if a in countDic.keys():
		countDic[a] += 1
	else:
		countDic[a] = 1
	
print(max(countDic.values()))
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())

anss = []
for n in range(1,math.ceil(N**0.5)):
	if N % n == 0:
		anss.append(max(len(str(n)),len(str(N//n))))
		
print(min(anss))

Fixed submission:
import math

N = int(input())

anss = []
for n in range(1,math.ceil(N**0.5)+1):
	if N % n == 0:
		anss.append(max(len(str(n)),len(str(N//n))))

if len(anss) == 0:
	anss.append(1)
		
print(min(anss))
Buggy python submission (verdict: Runtime Error):
N,C,K = map(int,input().split())
Ts = sorted([int(input()) for _ in range(N)])

#print(Ts)

ans = 0
firstFlag = True
passenger = []	#firstTime lastNum
for i in range(N):
	if firstFlag:
		passenger = [Ts[i],C-1]
		firstFlag = False
		#print("first",str(passenger),Ts[i],ans)
	elif i+1 != N -1:
		if passenger[0] + K <= Ts[i+1]:
			#print("time over",str(passenger),Ts[i],ans)
			ans += 1
			firstFlag = True
	elif passenger[1] == 1:
		#print("full",str(passenger),Ts[i],ans)
		ans += 1
		firstFlag = True
	else:
		#print("other",str(passenger),Ts[i],ans)
		passenger[1] -= 1
else:
	#print("close",str(passenger),ans)
	if not firstFlag:
		ans += 1

print(ans)

Fixed submission:
N,C,K = map(int,input().split())
Ts = sorted([int(input()) for _ in range(N)])

#print(Ts)

ans = 0
firstFlag = True
passenger = []	#limit lastNum
for i in range(N):
	if firstFlag:
		passenger = [Ts[i] + K,C-1]
		firstFlag = False
		ans += 1
		#print("first",str(passenger),Ts[i],ans)
	
	if passenger[1] <= 0:
		#print("full",str(passenger),Ts[i],ans)
		firstFlag = True
	elif i+1 < N and passenger[0] < Ts[i+1]:
		#print("time over",str(passenger),Ts[i],ans)
		firstFlag = True
	else:
		#print("other",str(passenger),Ts[i],ans)
		passenger[1] -= 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())

count = 0
for x in range(k+1):
	for y in range(k+1):
		for z in range(k+1):
			if x+y + z == s:
				count+=1
				
print(count)

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

count = 0
for x in range(k+1):
	for y in range(k+1):
		if 0 <= s - (x + y) <= k:
			count+=1
				
print(count)
Buggy python submission (verdict: Runtime Error):

#include <bits/stdc++.h>

using namespace std;

#define rep(i, x)   for (__typeof(x) i = 0; i < x; i++)
#define mp             make_pair
#define pb             push_back
#define fi             first
#define se             second
#define sz(x)          (int)((x).size())
#define all(x)         (x).begin(), (x).end()
#define sci(x)         int x;       scanf("%d", &x);
#define scii(x, y)     int x, y;    scanf("%d %d", &x, &y);
#define sciii(x, y, z) int x, y, z; scanf("%d %d %d", &x, &y, &z);
#define TC(x)          sci(x); while(x --)
#define eprintf(...)   fprintf(stderr, __VA_ARGS__)
#define debug(x)       { cerr << #x << " = " << x << endl; }
#define repi(i, x)  for (__typeof(x) i = x-1; i >= 0; i --)
#define fore(itr, x)   for (__typeof(x.begin()) itr = x.begin(); itr != x.end(); itr ++)
#define forei(itr, x)  for (__typeof(x.end()) itr = x.end() - 1; itr != x.begin() - 1; itr --)
typedef long long      ll;
typedef pair<int, int> ii;
typedef pair<ii, int>  iii;
typedef vector<int>    vi;
typedef vector<ii>     vii;
typedef vector<iii>    viii;
typedef vector<vector<int> > vvi;
typedef pair<ll, ll>   pairl;
typedef vector<ll>     vl;
typedef vector<ll>     vll;
typedef vector<vector<ll> > vvl;
const   int            infi = numeric_limits<int>::max();
const   ll             infl = numeric_limits<ll>::max();
const   double         eps = 0;
const   int            ms  = 0;



int main()
{
    ios::sync_with_stdio(false);//endl->"\n"
    cin.tie(0);
    string s;
    cin >> s;
    string a[] = {"SUN", "MON" , "TUE", "WED", "THU", "FRI", "SAT"};
    for(int i = 1; i <= 6; i++){
        if(s == a[i]){
            cout << 7-i << endl;
            return 0;
        }
    }
    cout << 7 << endl;
    return 0;
}

Fixed submission:
a = ["SUN", "MON" , "TUE", "WED", "THU", "FRI", "SAT"]

s = input()

for i in range(7):
    if s == a[i]:
        print(7-i)
Buggy python submission (verdict: Runtime Error):
from itertools import accumulate
import math

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

ans = 10**10

sum_list_aaa =list(accumulate(list_aaa))

for i in range(N):
    zen = sum_list_aaa[i]
    go = sum_list_aaa[-1]-sum_list_aaa[i]
    ans = min(ans,abs(zen-go)

print(ans)


Fixed submission:
from itertools import accumulate
import math

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

ans = 10**10

sum_list_aaa =list(accumulate(list_aaa))

for i in range(N):
    zen = sum_list_aaa[i]
    go = sum_list_aaa[-1]-sum_list_aaa[i]
    ans = min(ans,abs(zen-go))

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
B_list = list(map(int,input().split()))
A_list = [0 for i in range(N)]

A_list[0] = B_list[0]

for i in range(1,N-1):
    A_list[i] = min(B_list[i],B_list[i-1])

A_list[-1] = B_list[-1]
print(sum(A_list)

Fixed submission:
N = int(input())
B = list(map(int, input().split()))
res = B[0]
for i in range(1, N-1):
    res += min(B[i - 1], B[i])
res += B[-1]
print(res)
Buggy python submission (verdict: Runtime Error):

# N個のマス
N = int(input())

# タイルの高さ（H）のリスト
H_list = int(input().split())

Judge = True

# 最初のマスは,単調非現象にするには必ず１低くするのが最適
H_list(0)-=1

for i in range(N-1):
    # 右側i+1のマスが高ければ必ず１低くする
    if H_list(i) < H_list(i+1):
        H_list(i+1)-=1
    elif H_list(i) > H_list(i+1):
    # 左側が高くなれば　単調非現象は成立しない
        Judge = False

if Judge == True:
    print('Yes')
else:
    print('No')

Fixed submission:

# N個のマス
N = int(input())

# タイルの高さ（H）のリスト
H_list = list(map(int,input().split()))

Judge = True

# 最初のマスは,単調非現象にするには必ず１低くするのが最適
H_list[0]-=1

for i in range(N-1):
    # 右側i+1のマスが高ければ必ず１低くする
    if H_list[i] < H_list[i+1]:
        H_list[i+1]-=1
    elif H_list[i] > H_list[i+1]:
    # 左側が高くなれば　単調非現象は成立しない
        Judge = False

if Judge == True:
    print('Yes')
elif Judge == False:
    print('No')

Buggy python submission (verdict: Runtime Error):

# N個のマス
N = int(input())

# タイルの高さ（H）のリスト
H_list = int(input().split())

Judge = True

for i in H_list:
    if H_list(i) > H_list(i+1):
        H_list(i)-1
    elif:
        pass
    else :
        Judge = False

if Judge == True:
    print('Yes')
else:
    print('No')



Fixed submission:

# N個のマス
N = int(input())

# タイルの高さ（H）のリスト
H_list = list(map(int,input().split()))

Judge = True

# 最初のマスは,単調非現象にするには必ず１低くするのが最適
H_list[0]-=1

for i in range(N-1):
    # 右側i+1のマスが高ければ必ず１低くする
    if H_list[i] < H_list[i+1]:
        H_list[i+1]-=1
    elif H_list[i] > H_list[i+1]:
    # 左側が高くなれば　単調非現象は成立しない
        Judge = False

if Judge == True:
    print('Yes')
elif Judge == False:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = []
for i in range(1,N+1):
    A = int(input())
    A_list.append([i,A])

pop_que =[]

for i in range(1,N+1):
    pop_que =A_list.pop(0)
    pop_que.append(max(A_list,key=lambda x:x[1]))
    A_list.append(pop_que)
    print(A_list[-1][2][1])

#for i in range(N):
#    print(A_list[i][2][1])


Fixed submission:
N = int(input())
A_list = []
for i in range(1,N+1):
    A = int(input())
    A_list.append(A)
A_list_sort = sorted(A_list)

max_a = A_list_sort[-1]
max_b = A_list_sort[-2]


for i in range(N):
    if A_list[i] == max_a:
        print(max_b)
    else:
        print(max_a)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = []
for i in range(1,N+1):
    A = int(input())
    A_list.append([i,A])

pop_que =[]

for i in range(N):
    pop_que =A_list.pop(0)
    pop_que.append(max(A_list,key=lambda x:x[1]))
    A_list.append(pop_que)

for i in range(N):
    print(A_list[i][2][1])


Fixed submission:
N = int(input())
A_list = []
for i in range(1,N+1):
    A = int(input())
    A_list.append(A)
A_list_sort = sorted(A_list)

max_a = A_list_sort[-1]
max_b = A_list_sort[-2]


for i in range(N):
    if A_list[i] == max_a:
        print(max_b)
    else:
        print(max_a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A_list = []
for i in range(1,N+1):
    A = int(input())
    A_list.append([i,A])

pop_que =[]

for i in range(N):
    pop_que =A_list.pop(0)
    pop_que.append(max(A_list,key=lambda x:x[1]))
    A_list.append(pop_que)

for i in range(N):
    print(f"{A_list[i][2][1]}")


Fixed submission:
N = int(input())
A_list = []
for i in range(1,N+1):
    A = int(input())
    A_list.append(A)
A_list_sort = sorted(A_list)

max_a = A_list_sort[-1]
max_b = A_list_sort[-2]


for i in range(N):
    if A_list[i] == max_a:
        print(max_b)
    else:
        print(max_a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A_list = []
for i in range(1,N+1):
    A = int(input())
    A_list.append([i,A])

pop_que =[]
ans_list= []

print(f"A_list:{A_list}")

for i in range(N):
    pop_que =A_list.pop(0)
    pop_que.append(max(A_list,key=lambda x:x[1]))
    A_list.append(pop_que)

#print(f"A_list[0]:{A_list[0]}")
#print(f"A_list[0][0]:{A_list[0][0]}")
#print(f"A_list[0][2][0]:{A_list[0][2][0]}")

for i in range(N):
    print(f"{A_list[i][2][1]}")

Fixed submission:
N = int(input())
A_list = []
for i in range(1,N+1):
    A = int(input())
    A_list.append(A)
A_list_sort = sorted(A_list)

max_a = A_list_sort[-1]
max_b = A_list_sort[-2]


for i in range(N):
    if A_list[i] == max_a:
        print(max_b)
    else:
        print(max_a)
Buggy python submission (verdict: Time Limit Exceeded):
# TLE
L,R = map(int,input().split())
list_LR = range(L,R+1)

list_aaa =[]

ans = 2019

for i in range(L,R+1):
    for j in range(i+1,R+1):
        ans = min(ans,(i*j)%2019)

print(ans)



Fixed submission:
L,R = map(int,input().split())
list_LR = range(L,R+1)

list_aaa =[]

ans = 2019
l=min(L+2019, R+1)

for i in range(L,l):
    for j in range(i+1,l):
        ans = min(ans,(i*j)%2019)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
L,R = map(int,input().split())
list_LR = range(L,R+1)

list_aaa =[]

for i in range(L,R+1):
    for j in range(i+1,R+1):
        list_aaa.append((i*j)%2019)


print(min(list_aaa))


Fixed submission:
L,R = map(int,input().split())
list_LR = range(L,R+1)

list_aaa =[]

ans = 2019
l=min(L+2019, R+1)

for i in range(L,l):
    for j in range(i+1,l):
        ans = min(ans,(i*j)%2019)

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

N_list = [ i for i in range(1,N+1)]

aaa_list = []

for i in range(1,N+1):
    aaa_list.append(L+i-1)

print(sum(aaa_list)-min(list_aaa,key=lambda x: abs(x)))


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

N_list = [ i for i in range(1,N+1)]

aaa_list = []

for i in range(1,N+1):
    aaa_list.append(L+i-1)

print(sum(aaa_list)-min(aaa_list,key=lambda x: abs(x)))