Submission #321075

#TimeUsernameProblemLanguageResultExecution timeMemory
321075fadi57Safety (NOI18_safety)C++14
0 / 100
55 ms2788 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mx=200009; const int mod= 998244353; const int inf=2*1e5+9; ll n,h; ll a[mx]; int main() { cin>>n>>h;ll sum=0; for(int i=0;i<n;i++){ cin>>a[i];sum+=a[i]; }int equal=1;ll ans=0; ll mxx= 1e9; mxx=mxx*mx;ans=mxx; for(int i=0;i<n;i++){ ans=min(ans,abs(a[i]*n-sum));} cout<<ans; }

Compilation message (stderr)

safety.cpp: In function 'int main()':
safety.cpp:15:6: warning: unused variable 'equal' [-Wunused-variable]
   15 | }int equal=1;ll ans=0;
      |      ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...