Submission #38978009
Source Code Expand
Copy
import sysinput = sys.stdin.readlineN = int(input())x = list(map(int,input().split("\n")[0].split(" ")))arr = []for j in range(0,101):res = 0for i in range(len(x)):res += (x[i]-j)**2arr.append(res)print(min(arr))
import sys input = sys.stdin.readline N = int(input()) x = list(map(int,input().split("\n")[0].split(" "))) arr = [] for j in range(0,101): res = 0 for i in range(len(x)): res += (x[i]-j)**2 arr.append(res) print(min(arr))
Submission Info
Submission Time | |
---|---|
Task | C - Rally |
User | ika9810_ |
Language | Python (3.8.2) |
Score | 300 |
Code Size | 256 Byte |
Status | AC |
Exec Time | 27 ms |
Memory | 8992 KB |
Judge Result
Set Name | All | Sample | ||||
---|---|---|---|---|---|---|
Score / Max Score | 300 / 300 | 0 / 0 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
All | sample_01.txt, sample_02.txt, testcase_0.txt, testcase_1.txt, testcase_10.txt, testcase_11.txt, testcase_2.txt, testcase_3.txt, testcase_4.txt, testcase_5.txt, testcase_6.txt, testcase_7.txt, testcase_8.txt, testcase_9.txt |
Sample | sample_01.txt, sample_02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 25 ms | 8840 KB |
sample_02.txt | AC | 24 ms | 8936 KB |
testcase_0.txt | AC | 27 ms | 8832 KB |
testcase_1.txt | AC | 26 ms | 8864 KB |
testcase_10.txt | AC | 23 ms | 8868 KB |
testcase_11.txt | AC | 18 ms | 8872 KB |
testcase_2.txt | AC | 21 ms | 8836 KB |
testcase_3.txt | AC | 18 ms | 8980 KB |
testcase_4.txt | AC | 21 ms | 8832 KB |
testcase_5.txt | AC | 25 ms | 8868 KB |
testcase_6.txt | AC | 21 ms | 8992 KB |
testcase_7.txt | AC | 25 ms | 8932 KB |
testcase_8.txt | AC | 19 ms | 8868 KB |
testcase_9.txt | AC | 25 ms | 8868 KB |