TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):

n = int(input())
x = list(map(int, input().split()))
max_X = max(x)
mini = 0
maximum = 1000000

# Calculating the minimum total of stamina
for i in range(0, max_X) :
    for j in range(n) :
        mini += (x[j] - i) ** 2
    if mini < maximum :
        maximum = mini

print(maximum)

# Check out my Youtube channel! https://www.youtube.com/channel/UCMOKVyAbTZOpKikTrX5dy_A


n = int(input())
x = list(map(int, input().split()))
max_X = max(x)
maximum = 0

for i in range(0, max_X):
  for j in range(n):
    maxi += (x[j] - i) ** 2
  if maxi > maximum:
    maximum = maxi

print(maximum)


people = int(input())
coordinates = list(map(int, input().split()))
max_ = max(coordinates)
min_ = min(coordinates)
ans = 0

# Calculating the minimum total of stamina
for i in range(min_, max_ + 1):
    currentMin = 0
    for j in range(people):
        currentMin += (coordinates[j] - i) ** 2
        print("coordinates[j]: " + str(coordinates[j]))
        print("J loop currentMin: " + str(currentMin))
        print("J: " + str(j))
        print("i in J loop:" + str(i))
        print()
    print("CurrentMin: " + str(currentMin))
    if i == min_:
        ans = currentMin
        print("if i == min_: " + str(ans))
        print()
    elif currentMin < ans:
        ans = currentMin
        print("elif currentMin < ans: " + str(ans))
        print()

print(ans)

# Check out my Youtube channel! https://www.youtube.com/channel/UCMOKVyAbTZOpKikTrX5dy_A




people = int(input())
coordinates = list(map(int, input().split()))
max_ = max(coordinates)
min_ = min(coordinates)
ans = 0

# Calculating the minimum total of stamina
for i in range(min_, max_ + 1):
    currentMin = 0
    for j in range(people):
        currentMin += (coordinates[j] - i) ** 2
    if i == min_:
        ans = currentMin
    elif currentMin < ans:
        ans = currentMin
        
print(ans)

# Check out my Youtube channel! https://www.youtube.com/channel/UCMOKVyAbTZOpKikTrX5dy_A



Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
import os

def main():
        num = int(input())
        dict_list = {}
        for i in range(num):
                strings = input()
                if strings in dict_list.keys():
                        dict_list[strings] += 1
                else:
                        dict_list[strings] = 1 

        max_num = max(dict_list.values())
        result = []
        
        for k,v in dict_list.items():
                if v == max_num:
                        result.append(k)
        result.sort()
        for i in result:
                print(i)

if __name__ == "__main__":
        main()



import os

def main():
    count = int(input())
    int_list = list(map(int, input().split()))
    int_min,int_max = min(int_list),max(int_list)
    score = 0

    int_avg = int(sum(int_list) / len(int_list)) + 1
    print(int_avg)
    for i in int_list:
        score += (i - int_avg)**2
    print(score)

if __name__ == "__main__":
    main()

import os

def main():
    count = int(input())
    int_list = list(map(int, input().split()))
    int_min,int_max = min(int_list),max(int_list)
    score = 0

    int_avg = int_max // 2
    print(int_avg)
    for i in int_list:
        score += (i - int_avg)**2
    print(score)

if __name__ == "__main__":
    main()

import os

def main():
    count = int(input())
    int_list = list(map(int, input().split()))
    int_min,int_max = min(int_list),max(int_list)
    score = 0

    int_avg = int(sum(int_list) / len(int_list)) + 1
    print(int_avg)
    for i in int_list:
        score += (i - int_avg)**2
    print(score)

if __name__ == "__main__":
    main()

import os

def main():
    count = int(input())
    int_list = list(map(int, input().split()))
    int_min,int_max = min(int_list),max(int_list)
    score = 0

    int_avg = int(sum(int_list) / len(int_list)) 
    print(int_avg)
    for i in int_list:
        score += (i - int_avg)**2
    print(score)

if __name__ == "__main__":
    main()

import os
import math

def main():
    num = int(input())
    x_list = list(map(int, input().split()))
    min_num = 10**10    
    for i in range(100):
        result = 0  
        for j in x_list:
            result += pow((i - j), 2)
        
        if result < min_num:
            min_num = result
    print(min_num)

if __name__ == "__main__":
    main()

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
n = int(input())
x = list(map(int, input().split()))
x.sort()
sigmaList = list()
for p in range(x[0], x[n]):
    sigma = 0
    for i in range(n):
        sigma += (x[i] - p) ** 2
    sigmaList.append(sigma)

print(min(sigmaList))


n = int(input())
x = list(map(int, input().split()))
x.sort()
sigmaList = list()
for p in range(x[0], x[n - 1] + 1):
    sigma = 0
    for i in range(n):
        sigma += (x[i] - p) ** 2
    sigmaList.append(sigma)
print(min(sigmaList))


Verdicts: Runtime Error

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
N = int(input())
X = list(map(int,input().split()))
tmp = 0
mi =100000000000
for i in range(1,101):
  for k in range(N):
    tmp = (X[k] - i)**2
  if tmp < mi:
    mi = tmp
print(mi)

N = int(input())
X = list(map(int,input().split()))
tmp = 0
mi =100000000000
for i in range(1,101):
  for k in range(N):
    tmp += (X[k] - i)**2
  if tmp < mi:
    mi = tmp
  tmp = 0
print(mi)


Verdicts: Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
s = map(int,input().split())
m = 10000000
for p in s:
  t = 0
  for x in s:
    t+=(x-p)**2
   m = min(t,m)
print(m)
    
  

n = input()
s = map(int,input().split())
m = 10000000
for p in range(0,101):
  t = 0
  for x in s:
    t+=(x-p)**2
  m = min(t,m)
print(m)

s = map(int,input().split())
m = 10000000
for p in s:
  t = 0
  for x in s:
    t+=(x-p)**2
  m = min(t,m)
print(m)
    

n = input()
s = map(int,input().split())
m = 10000000
for p in s:
  t = 0
  for x in s:
    t+=(x-p)**2
  m = min(t,m)
print(m)
    

n = input()
s = list(map(int,input().split()))
m = 10000000
for p in range(0,101):
  t = 0
  for x in s:
    t+=(x-p)**2
  m = min(t,m)
print(m)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
import math

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

s = sum(x)

ans = 0
a = round(s/n)

for i in x:
  ans += (i - a) ** 2

print(a)
print(ans)

import math

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

s = sum(x)

ans = 0
a = round(s/n)

for i in x:
  ans += (i - a) ** 2

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
= int(input())
spot = input().split()
ans = []
for i in spot:
    spot.append(int(spot[0]))
    del spot[0]
if n == 1:
    print(0)
else:
    if max(spot)==min(spot):
        ans.append(0)
    for s in range(min(spot),max(spot)):
        x = 0
        for t in spot:
            x += (s-t)**2
        ans.append(x)
if n != 1:
    ans.sort(reverse=True)
    print(ans[0])

n= int(input())
spot = input().split()
ans = []
for i in spot:
    spot.append(int(spot[0]))
    del spot[0]
if n == 1:
    print(0)
else:
    if max(spot)==1:
        ans.sppend(0)
    for s in range(min(spot),max(spot)):
        x = 0
        for t in spot:
            x += (s-t)**2
        ans.append(x)
if n != 1:
    ans.sort(reverse=True)
    print(ans[0])

n= int(input())
spot = input().split()
ans = []
for i in spot:
    spot.append(int(spot[0]))
    del spot[0]
if n == 1:
    print(0)
else:
    for s in range(min(spot),max(spot)):
        x = 0
        for t in spot:
            x += (s-t)**2
        ans.append(x)
if n != 1:
    ans.sort(reverse=True)
    print(ans[0])

n= int(input())
spot = input().split()
cnt = 0
ans = []
for i in spot:
    spot.append(int(i))
    del spot[cnt]
    cnt += 1
for s in range(min(spot),max(spot)):
    x = 0
    for t in spot:
        x += (t-s)**2
    ans.append(x)
print(min(ans))

n= int(input())
spot = input().split()
ans = []
for i in spot:
    spot.append(int(spot[0]))
    del spot[0]
if n == 1:
    print(0)
else:
    if max(spot)==min(spot):
        ans.append(0)
    for s in range(min(spot),max(spot)):
        x = 0
        for t in spot:
            x += (s-t)**2
        ans.append(x)
if n != 1:
    ans.sort(reverse=False)
    print(ans[0])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
def main():
    print("solve abc156 C")
    n = int(input())
    x = [int(i) for i in input().split()]
    min_x = round(sum(x) / n)
    ans = sum([(min_x - i)**2 for i in x])
    print(ans)

if __name__ == "__main__":
    main()


def main():
    n = int(input())
    x = [int(i) for i in input().split()]
    min_x = round(sum(x) / n)
    ans = sum([(min_x - i)**2 for i in x])
    print(ans)

if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
import statistics

N = int(input())
X = [int(i) for i in input().split()]
X.sort()
mid = statistics.mean(X)
ans = 0
ans1 = 0
ans2 = 0
print(mid)
for i in range(N):
    ans1 += (X[i] - int(mid)) ** 2
    ans2 += (X[i] - int(mid) - 1) ** 2
ans = min(ans1, ans2)

print(ans)

import statistics

N = int(input())
X = [int(i) for i in input().split()]
X.sort()
mid = statistics.mean(X)
ans = 0
ans1 = 0
ans2 = 0

for i in range(N):
    ans1 += (X[i] - int(mid)) ** 2
    ans2 += (X[i] - int(mid) - 1) ** 2
ans = min(ans1, ans2)

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
n = int(input())
x = list(map(int, input().split()))
l1 = min(x)
l2 = max(x)
ans,sum = 0,0
for i in range(l1, l2+1):
    for j in x:
        sum += (i-j)**2
    if sum < ans:
        ans = sum
print(ans)

n = int(input())
x = list(map(int, input().split()))
l1 = min(x)
l2 = max(x)
ans = 0
for i in range(l1, l2+1):
    for j in x:
        sum += (i-j)**2
    if sum > ans:
        ans = sum
print(ans)

n = int(input())
x = list(map(int, input().split()))
l1 = min(x)
l2 = max(x)
ans, sum = 0, 0
for i in range(l1, l2+1):
    for j in x:
        sum += (i-j) * (i-j)
    if sum > ans:
        ans = sum
print(ans)

n = int(input())
x = list(map(int, input().split()))
l1 = min(x)
l2 = max(x)
ans,sum = 100000000,0
for i in range(l1, l2+1):
    for j in x:
        sum += (i-j)**2
    if sum < ans:
        ans = sum
print(ans)

n = int(input())
x = list(map(int, input().split()))
l1 = min(x)
l2 = max(x)
ans = 100000000
for i in range(l1, l2+1):
    sum = 0
    for j in x:
        sum += (i-j)**2
    if sum < ans:
        ans = sum
print(ans)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
from numpy import average

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

p=int(average(x))

ans=0
for i in range(x):
	ans+=((i-p)**2)

print(ans)


from numpy import average
from decimal import Decimal, ROUND_HALF_UP
 
n=int(input())
x=list(map(int,input().split()))
 
p=Decimal(str(average(x))).quantize(Decimal('1'),rounding=ROUND_HALF_UP)
 
ans=0
for i in x:
	ans+=((i-p)**2)

print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
N = int(input())
X = list(map(int, input().strip().split()))
total = 0
points = 0 
for i in X:
  total += i
avg = int(round(total/N))
for i in X:
  points += (a-avg)^^2
print(points)

N = int(input())
X = list(map(int, input().strip().split()))
total = 0
points = 0
for i in X:
  total += i
avg = int(round(total/N))
for i in X:
  points += (i-avg)**2
print(points)

Verdicts: Runtime Error

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
n = int(input().strip())
L = list(map(int, input().strip().split()))
ans=10**6+1
for p in range(max(L[-1])+1):
    tmp=0
    for x in L:
        tmp+=(x-p)**2
    ans=min(ans,tmp)
print(ans)

n = int(input().strip())
L = list(map(int, input().strip().split()))
ans=10**6+1
for p in range(max(L)+1):
    tmp=0
    for x in L:
        tmp+=(x-p)**2
    ans=min(ans,tmp)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
import numpy as np

N = int(input())
X = np.array(list(map(int, input().split())))
cost = float("inf")
for i in range(101):
    cost = min(np.sum((X - i) ** 2))
print(cost)

N = int(input())
X = sorted(list(map(int, input().split())))
if N == 1:
    print(0)
else:
    r = X[-1] - X[0]
    ans = float("inf")
    for i in range(r+1):
      R = X[0] + i
      hp = 0
      for j in range(N):
        hp = hp + (R - X[j]) ** 2
 
        ans = min(hp, ans)
 
    print(ans)

N = int(input())
X = sorted(list(map(int, input().split())))
if N == 1:
    print(0)
else:
    r = X[-1] - X[0]
    ans = float("inf")
    for i in range(r + 1):
        R = X[0] + i
        hp = 0
        for j in range(N):
            hp = hp + (R - X[j]) ** 2

        ans = min(hp, ans)

    print(ans)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
def main(n, x):
    ans = []

    for p in range(1, n + 101):
        t = 0
        for _x in x:
            t += (_x - p) ** 2

        ans.append(t)

    print(min(ans))


if __name__ == "__main__":
    n = int(input())
    x = list(map(int, input().split()))


def main(n, x):
    ans = []

    for p in range(1, n + 101):
        t = 0
        for _x in x:
            t += (_x - p) ** 2

        ans.append(t)

    print(min(ans))


if __name__ == "__main__":
    n = int(input())
    x = list(map(int, input().split()))

    main(n, x)


Verdicts: Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import sys
ans = sys.maxint

n = int(input())
x = [int(i) for i in input().split()]


tmp = 0
for i in range(-1000, 1001): 
    for j in range(n):
        tmp += pow(x[j] - i, 2)
    if ans > tmp:
        ans = tmp
    tmp = 0
print(ans)


# -*- coding: utf-8 -*-
n = int(input())
x = [int(i) for i in input().split()]

ans = 100 * 100 * 100
tmp = 0
for i in range(-1000, 1001): 
    for j in range(n):
        tmp += pow(x[j] - i, 2)
    if ans > tmp:
        ans = tmp
    tmp = 0
print(ans)


Verdicts: Runtime Error

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):

N=int(input())
X=list(map(int,input().split()))
X.sort()
#print(X)
med=int(statistics.median(X))
#print(med)


min=10**10
sum=0
#print(X)
while True:
    sum=0
    for i in range(N):
        sum+=(X[i]-med)**2
    if sum<min:
        min=sum
        prev=sum
        med+=1
    else:
        break

print(prev)


# coding: utf-8
# Your code here!

N=int(input())
X=list(map(int,input().split()))
X.sort()

sig=0
for i in range(N):
    sig+=X[i]

sig_2=0
for i in range(N):
    sig_2+=X[i]**2

min=10**10
med=X[0]
while True:
    sum=N*med**2-2*med*sig+sig_2

    if sum<min:
        min=sum
        prev=sum
        med+=1
    else:
        break

print(prev)

Verdicts: Runtime Error

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
N = int(input())
X_list = [int(i) for i in input().split()]

low = min(X_list)
high = max(X_list)

minimum = high
for p in range(low,high) :
    tmp = 0
    for x in X_list :
        tmp += pow(x-p,2)
    
    if (tmp < minimum) :
        minimum = tmp

print(minimum)

N = int(input())
X_list = [int(i) for i in input().split()]

low = min(X_list)
high = max(X_list)

minimum = 99999999999999
for p in range(low,high) :
    tmp = 0
    for x in X_list :
        tmp += pow(x-p,2)
    
    if (tmp < minimum) :
        minimum = tmp

if (minimum == 99999999999999) :
    print(0)
else :
    print(minimum)

Verdicts: Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
def resolve():
    N = int(input())
    n_array = np.array(list(map(int,input().split())))
    mea = int(np.average(n_array) + 0.5)
    ans = n_array - mea 
    print(sum(ans*ans))
resolve()

import numpy as np

def resolve():
    N = int(input())
    n_array = np.array(list(map(int,input().split())))
    mea = int(np.average(n_array) + 0.5)
    ans = n_array - mea 
    print(sum(ans*ans))
resolve()    

Verdicts: Runtime Error

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
N=int(input())
a=[int(x) for x in input().split()]
import math
import statistics
mean=statistics.mean(a)
m=round(mean,0)

sum=0
for x in a:
    t=(x-m)**2
    sum+=t
print(sum)

N=int(input())
a=[int(x) for x in input().split()]
import math
import statistics
mean=statistics.mean(a)
m=round(mean,0)

sum=0
for x in a:
    t=(x-m)**2
    sum+=t
int_sum=int(sum)
print(int_sum)

Verdicts: Wrong Answer

Accepted
Problem: There are N people living on a number line.  The i-th person lives at coordinate X_i.  You are going to hold a meeting that all N people have to attend.  The meeting can be held at any **integer coordinate**. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.  Find the minimum total points of stamina the N people have to spend.

Submission attempts (in order):
n=int(input())
l=list(map(int,input().split()))
       
f_ans=100000000000000
for i in l:
  ans=0
  for j in range(min(l),max(l)+1):
    ans+=(i-j)**2
    f_ans=min(ans,f_ans)
    
print(f_ans)
    
    

n=int(input())
lis=list(map(int,input().split()))
       
f_ans=100000000000000
for i in range(min(lis),max(lis)+1):
  ans=0
  for l in lis:
    ans+=(i-l)**2
  f_ans=min(ans,f_ans)
    
print(f_ans)
    
    


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
# ABC152
a,b = map(int, input().split())
 
if a<b:
    ans=str(a)*b
else:
    ans=str(b)*a
print(ans)

# ABC152
N, M = map(int, input().split())
if N==M:
    ans="Yes"
else:
    ans="No"
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n, m = map(int, input())

if n == m:
    print("Yes")
else:
    print("No")

n, m = map(int, input().split())

if n == m:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n,m=map(int,input().split())
if n==m:
  print('AC')
else:
  print('WA')

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


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n,m=map(int,input().split())
if n==m
   print("Yes")
else:
   print("No")

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


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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N = int(input())
Ps = list(map(int, input().split()))
count = 0
low = -1

for i in range(N):
    low = Ps[i]

    if ( sum(x < low for x in Ps[:i]) == 0):
        count += 1

print(count)

N, M = map(int, input().split())

if (N==M):
    print('Yes')
else :
    print('No')

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
a = input().rstrip().split()
if a[0] = a[1]:
  print('Yes')
else:
  print('No')

a = input().rstrip().split()
if a[0] == a[1]:
  print('Yes')
else:
  print('No')


Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n,m=map(int,input().split())
if n>m:
  print("No")
else:
  print("Yes)

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n=int(input())
m=int(input())
if(n==m):
    print("Yes\n")
else:
    print("No\n")

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
a, b = map(int, input().split())
if a == b:
	Print('Yes')
else:
	Print('No')

a, b = map(int, input().split())
if a == b:
	print('Yes')
else:
	print('No')

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N = input("")
L = input("").split(" ")
suc = int(N)

for i in range(int(N)):
    for j in range(i):
        if (L[j] < L[i]):
            suc -= 1
            break
    
print(suc)

# -*- coding: utf-8 -*-

def fun():
    A = input("")
    return A

N = str(fun()).split(" ")
if (N[0] == N[1]):
    print("Yes")
    
else:
    print("No")


Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
str1, str2 = [s for s in input().split()]
a = str1*str2
b = str2*str2
if a > b:
    print(a)
elif a < b:
    print(b)
else:
    print(a)

def acwa():
x,y = map(int,input().split())
if x = y:
	print('Yes');
else x < y:
  	print('No');

str1, str2 = [s for s in input().split()]
a = str1*int(str2)
b = str2*int(str1)
if str1 > str2:
  print(b)
elif str1 < str2:
  print(a)
else:
  print(a)

x,y = map(int,input().split());
if x = y:
	print('Yes');
else x > y:
  	print('No');

str1, str2 = [s for s in input().split()]
a = str1*int(str2)
b = str2*int(str1)
list = [a, b]
list.sort();
print(list[0])

str1, str2 = [s for s in input().split()]
a = str1*int(str2)
b = str2*int(str2)
if a > b:
    print(a)
elif a < b:
    print(b)
else:
    print(a)

str1, str2 = [s for s in input().split()]
a = str1*int(str2)
b = str2*int(str1)
int(a)
int(b)
list = [a, b]
list.sort();
print(list[0])

str1, str2 = [s for s in input().split()]
a = str1*int(str2)
b = str2*int(str1)
sort = [a, b]
sorted(sort)
print(sort[0])

a = list(map(int,input().split()));
if a[0] == a[1]:
	print('Yes');
else a[0] > a[1]:
	printf('No');

str1, str2 = [s for s in input().split()]
a = str(str1)*str2
b = str(str2)*str2
if a > b:
    print(a)
elif a < b:
    print(b)
else:
    print(a)

str1, str2 = [s for s in input().split()]
a = str1*int(str2)
b = str2*int(str1)
if len(a) > len(b):
    print(a)
elif len(a) < len(b):
    print(b)
else:
    print(a)

str1, str2 = [s for s in input().split()]
if str1 == str2:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
# -*- coding: utf-8 -*-


a, b = map(int, input().split())

sa = ""
sb = ""
for i in range(b):
    sa = sa + str(a)
for i in range(a):
    sb = sb + str(b)
if sa < sb:
    print(sa)
else:
    print(sb)


# -*- coding: utf-8 -*-
n, m = map(int, input().split())
if n == m:
	print("Yes")
else:
	print("No")


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
a,b=map(str,input().split())

if int(a)>=int(b):
  print(str(a)*b)
else:
  print(str(b)*a)


n,m=map(int,input().split())

if n==m:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
A,B = map(int,input().split())

ansA = ""
ansB = ""
for countA in range(B):
    ansA = ansA + str(A)
for countB in range(A):
    ansB = ansB + str(B)

list = [str(ansA),str(ansB)]
list.sort()

print(list[0])


input = list(map(int, input().split()))
N = input[0]
M = input[1]

if iN == M:
    print("Yes")
else:
    print("No")


input = list(map(int, input().split()))
N = input[0]
M = input[1]

if N == M:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n,m = map(int, intput().split())
print('Yes' if N==M else 'No')

n,m = map(int, intput().split())
print('Yes' if n==m else 'No')

n,m = map(int, input().split())
print('Yes' if n == m else 'No')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
import sys
input = sys.stdin.buffer.readline
n = int(input())
a = list(map(int, input().split()))
from fractions import gcd
def lcm(x,y):
  return (x*y)//gcd(x,y)
l = 1
mod = 10**9+7
for i in range(n):
  l = lcm(l, a[i])
l %= mod
ans = 0
for i in range(n):
  ans += l // a[i]
  ans %= mod
print(ans)

import sys
input = sys.stdin.buffer.readline
n = int(input())
a = list(map(int, input().split()))
from fractions import gcd
def lcm(x,y):
  return (x*y)//gcd(x,y)
l = 1
mod = 10**9+7
for i in range(n):
  l = lcm(l, a) % mod
ans = 0
for i in range(n):
  ans += l // a[i]
  ans %= mod
print(ans)


import sys
input = sys.stdin.buffer.readline
n = int(input())
a = list(map(int, input().split()))
from fractions import gcd
def lcm(x,y):
  return (x*y)//gcd(x,y)
l = 1
mod = 10**9+7
for i in range(n):
  l = lcm(l, a[i])
ans = 0
for i in range(n):
  ans += l // a[i]
  ans %= mod
print(ans)


import sys
input = sys.stdin.buffer.readline
n = int(input())
a = list(map(int, input().split()))
from fractions import gcd
def lcm(x,y):
  return (x*y)//gcd(x,y)
l = 1
mod = 10**9+7
for i in range(n):
  l = lcm(l, a[i])
ans = 0
for i in range(n):
  ans += l // a[i]
print(ans%mod)


print('Yes' if eval(input().replace(' ','==')) else 'No')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
a, b = input().split()
str_list = []
a_ = a * int(b)
b_ = b * int(a)
str_list.append(a_)
str_list.append(b_)
str_list = sorted(str_list)
print('%s' % str_list[0])


a, b = input().split()
str_list = []
a_ = a * int(b)
b_ = b * int(a)
str_list.append(a_)
str_list.append(b_)
sorted(str_list)
print('%s' % str_list[0])


N, M = map(int, input().split())
if N==M:
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n,m=map(int,input().split())
print(Yes) if n==m else print(No)

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
#coding: utf-8

s = input().split()
if s[0]>s[1]:
    for i in range(int(s[0])):
  	    print(str(s[1]),end='')
    print()
else:
    for i in range(int(s[1])):
  	     print(str(s[0]),end='')
    print()


#coding: utf-8

s = input().split()
if s[0]==s[1]:
  print('yes')
else:
  print('No')

#coding: utf-8
 
s = input().split()
if s[0]>s[1]:
  for i in range(s[0]):
  	print(str(s[1]),end='')
else:
  for i in range(s[1]):
  	print(str(s[0]),end='')

#coding: utf-8

s = input().split()
if s[0]>s[1]:
  for i in range(int(s[0])):
  	print(str(s[1]),end='')
else:
  for i in range(int(s[1])):
  	print(str(s[0]),end='')


#coding: utf-8
 
s = input().split()
if s[0]==s[1]:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
def main():
    a = input()
    l = list(map(int,input().split()))
    ans = check(int(a),l)
    print(ans)

def check(a,l):
    num = 0
    for i in range(a):
        for j in range(i):
            if l[i] > l[j]:
                break
        else:
            num = num + 1
    return num

main()

def main():
  i = list(map(int, input().split()))
  ans = check(i[0],i[1])
  print ans
  
def check(int n, int m):
  if n == m:
    return true
  else:
    return false

def main():
  a,b = map(int,input().split())
  ans = check(a,b)
  print(ans)
  
def check(n,m):
  if n == m:
    return True
  else:
    return False
main()

def main():
  n = input()
  m = input()
  ans = check(n,m)
  print ans
  
def check(int n, int m):
  if(n == m):
    return true
  else:
    return false

def main():
    a = input()
    #if int(a) > 100000:
    #    exit
    l = list(map(int,input().split()))
    #if len(l) > int(a):
    #    exit
    ans = check(int(a),l)
    print(ans)

def check(a,l):
    num = 0
    for i in range(a):
        for j in range(i):
            if l[i] > l[j]:
                break
        else:
            num = num + 1
    return num

main()

def main():
  a,b = map(int,input().split())
  ans = check(a,b)
  print(ans)
  
def check(n,m):
  if n == m:
    return "Yes"
  else:
    return "No"
main()

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N, M=int(input())
if N==M:
	print('Yes')
else:
	print('No')

N, M=map(int,input().split())
if N==M:
	print('Yes')
else:
	print('No')

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N, M = map(int, input().split())

If N==M :
	print("Yes")
else :
	print("No")

N, M = map(int, input().split())

if N == M :
	print("Yes")
else :
	print("No")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N, M = map(int, input().split())
if N == M:
  print('AC')
else:
  print('WA')

N, M = map(int, input().split())
if N == M:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M=map(int,input().split())
if N=M:
  print("Yes")
else:
  print("No")
 

N,M=map(int,input().split())
if N=M:
  print("Yes")
else:
  print("No")
 

N,M=map(int,input().split)
if N=M:
  print("Yes")
else:
  print("No")
 

N,M=map(int,input().split())
if N==M:
  print("Yes")
else:
  print("No")
 

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n,m=map(int,input().split())
if n==m:
  print('AC')
else:
  print('WA')

n,m=map(int,input().split())
if n==m:
  print('AC')
else:
  print('WA')

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M=map(int.input().split())
print("yes"if N==M else"no")

N,M=map(int,input().split())
print("Yes" if N==M else "No")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
n,m=map(int,inpt().split())
if n==m:
  print('Yes')
else:
  print('No')

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

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
S=list(map(int,input().split()))
S1=str(S[0])
S2=str(S[1])
S3=S1*S[1]
S4=S2*S[0]
if S[0]<=S[1]:
    print(S3)
else:
    print(S4)

S=list(map(int,input().split()))
if S[0]==S[1]:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N, M = map(int, input().split())

if M < N:
  print('NO')
else:
  print('YES')

N, M = map(int, input().split())
 
if M < N:
  print('No')
else:
  print('Yes')

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M = map(int,input())

print("Yes") if N==M else print("No")

N,M = map(int,input().split())
 
print("Yes") if N==M else print("No")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
from sys import stdin
if m >= n:
    print("Yes")
else:
    print("No")

from sys import stdin
n,m=map(int,input().split())
if m >= n:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.   The problem has N test cases, all of which must be passed to get an AC verdict.   Takahashi's submission has passed M cases out of the N test cases.   Determine whether Takahashi's submission gets an AC.

Submission attempts (in order):
N,M=map(int,input().split())
if N==M:
    print("YES")
else:
    print("NO")


N,M=map(int,input().split())
if N==M:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Accepted