Submission #17469564


Source Code Expand

Copy
#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cstdlib>
using namespace std;

typedef long long ll;

int main()
{
	int n; cin >> n;
	vector<int> x(n);
	ll sum = 0; int max = -1;
	for(int i = 0; i < n; i++)
	{
		cin >> x[i];
		x[i] = abs(x[i]);
		sum += x[i];
		if(max < x[i])	max = x[i];
	}
	ll dsum = 0;
	for(int i = 0; i < n; i++)	dsum += x[i]*x[i];

	cout << sum << "\n" << setprecision(20) << sqrtl(1.0*dsum) << "\n";
  	cout << max << "\n";
}

Submission Info

Submission Time
Task B - Various distances
User bashNewbie
Language C++ (GCC 9.2.1)
Score 0
Code Size 532 Byte
Status WA
Exec Time 36 ms
Memory 3852 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 2
AC × 6
WA × 12
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_10.txt, hand_11.txt, hand_12.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
hand_01.txt AC 18 ms 3644 KB
hand_02.txt AC 20 ms 3612 KB
hand_03.txt WA 36 ms 3852 KB
hand_10.txt AC 2 ms 3592 KB
hand_11.txt WA 2 ms 3844 KB
hand_12.txt AC 18 ms 3776 KB
random_01.txt WA 35 ms 3608 KB
random_02.txt WA 7 ms 3664 KB
random_03.txt WA 31 ms 3824 KB
random_04.txt WA 28 ms 3592 KB
random_05.txt WA 35 ms 3784 KB
random_06.txt WA 6 ms 3644 KB
random_07.txt WA 33 ms 3800 KB
random_08.txt WA 23 ms 3724 KB
random_09.txt WA 34 ms 3744 KB
random_10.txt WA 4 ms 3736 KB
sample_01.txt AC 2 ms 3644 KB
sample_02.txt AC 2 ms 3600 KB