Submission #20709558
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n;
cin >>n;
long long arr[n];
for(int i = 0;i<n;i++)
{
cin >> arr[i];
}
long long ans = 0;
for(int i =0;i<n;i++)
{ for(int j = i+1;j< n;j++)
{
ans += (arr[i]- arr[j]) * (arr[i] - arr[j]);
}
}
cout << ans << endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Squared Error |
| User | Rey564219 |
| Language | C++ (GCC 9.2.1) |
| Score | 0 |
| Code Size | 452 Byte |
| Status | TLE |
| Exec Time | 2206 ms |
| Memory | 5644 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 300 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | handmade_00.txt, handmade_01.txt, max_00.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, same_00.txt, same_01.txt, same_02.txt, same_03.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| handmade_00.txt | AC | 3 ms | 3412 KiB |
| handmade_01.txt | AC | 3 ms | 3552 KiB |
| max_00.txt | TLE | 2206 ms | 5636 KiB |
| random_00.txt | TLE | 2205 ms | 5580 KiB |
| random_01.txt | TLE | 2205 ms | 5636 KiB |
| random_02.txt | TLE | 2205 ms | 5636 KiB |
| random_03.txt | TLE | 2205 ms | 5304 KiB |
| random_04.txt | TLE | 2205 ms | 4844 KiB |
| random_05.txt | TLE | 2205 ms | 4344 KiB |
| same_00.txt | TLE | 2205 ms | 5644 KiB |
| same_01.txt | TLE | 2205 ms | 5528 KiB |
| same_02.txt | AC | 10 ms | 3384 KiB |
| same_03.txt | TLE | 2205 ms | 5264 KiB |
| sample_01.txt | AC | 8 ms | 3472 KiB |
| sample_02.txt | AC | 2 ms | 3548 KiB |