# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
104582 | 2019-04-08T09:23:10 Z | Hassoony | Simfonija (COCI19_simfonija) | C++17 | 1000 ms | 1408 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod=(1e9+7); const ll inf=(1ll<<61); const int MX=50009; int n,k,a[MX],b[MX],c[MX]; int main(){ cin>>n>>k; for(int i=0;i<n;i++)scanf("%d",&a[i]); for(int i=0;i<n;i++)scanf("%d",&b[i]); for(int i=0;i<n;i++)c[i]=a[i]-b[i]; sort(c,c+n); int x=c[(n-1)/2]; ll ans=0; for(int i=0;i<n;i++){ c[i]-=x; ans+=abs(c[i]); } cout<<ans<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 15 ms | 1152 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1059 ms | 1400 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 12 ms | 1152 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 9 ms | 896 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1071 ms | 1408 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 15 ms | 1144 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1068 ms | 1408 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 10 ms | 1152 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1055 ms | 1408 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |