You are viewing a single comment's thread. Return to all comments →
Hi I have implemented in C++ but getting WA. Any help?
#include <iostream> #include <string> #include <string.h> #include <vector> #include <stdio.h> #include <algorithm> using namespace std; int main() { long long t,n,i,a[10005],mini; cin>>t; while (t--) { cin>>n; mini=100000; for (i=0;i<n;i++) { cin>>a[i]; mini=min(a[i],mini); } long long res = 0; for (i=0;i<n;i++) { a[i]-=mini; long long x = a[i]/5; long long y = (a[i]%5)/2; long long z = (a[i]%5)%2; res+=x+y+z; } cout<<res<<endl; } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Equal
You are viewing a single comment's thread. Return to all comments →
Hi I have implemented in C++ but getting WA. Any help?