Submission #19424524
Source Code Expand
Copy
#include<bits/stdc++.h> #define lli long long int #define endl "\n" #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL); using namespace std; lli min(lli a,lli b) { if (a<b) { return a; } else { return b; } } lli max(lli a,lli b) { if (a>b) { return a; } else { return b; } } void solve() { long long int n; cin>>n; int arr[n]; for(lli i=0;i<n;i++) cin>>arr[i]; long long int m=0; long long int e=0; int c=0; for(lli i=0;i<n;i++) { m+=abs(arr[i]); e+=arr[i]*arr[i]; c=max(c,abs(arr[i])); } double E=(double)(pow(e,0.5)); cout<<m<<endl; cout<<E<<endl; cout<<c<<endl; } int main(){ fastio; cout<<fixed; cout<<setprecision(15); lli t=1; // cin>>t; for(lli i=1;i<=t;i++) { solve(); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Various distances |
User | nalingoyal |
Language | C++ (GCC 9.2.1) |
Score | 0 |
Code Size | 1010 Byte |
Status | WA |
Exec Time | 21 ms |
Memory | 4496 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||||
Status |
|
|
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 | 13 ms | 4148 KB |
hand_02.txt | AC | 14 ms | 4496 KB |
hand_03.txt | WA | 20 ms | 4456 KB |
hand_10.txt | AC | 2 ms | 3820 KB |
hand_11.txt | WA | 3 ms | 4008 KB |
hand_12.txt | AC | 16 ms | 4444 KB |
random_01.txt | WA | 14 ms | 4400 KB |
random_02.txt | WA | 4 ms | 4044 KB |
random_03.txt | WA | 14 ms | 4492 KB |
random_04.txt | WA | 13 ms | 4332 KB |
random_05.txt | WA | 15 ms | 4404 KB |
random_06.txt | WA | 3 ms | 4008 KB |
random_07.txt | WA | 21 ms | 4336 KB |
random_08.txt | WA | 10 ms | 4176 KB |
random_09.txt | WA | 20 ms | 4460 KB |
random_10.txt | WA | 5 ms | 3956 KB |
sample_01.txt | AC | 2 ms | 4160 KB |
sample_02.txt | AC | 2 ms | 3944 KB |