SRM506 Div2 Easy(250) SlimeXSlimeRancher2
#include <vector> #include <numeric> #include <algorithm> using namespace std; class SlimeXSlimeRancher2{public: int train( vector <int> a ) { return *max_element(a.begin(),a.end())*(int)a.size() - accumulate(a.begin(),a.end(),0); }};