https://i2.wp.com/eblogarithm.com/wp-content/uploads/2017/01/Codeforces-Round-392-Div-2-problem-A-Holiday-Of-Equality-Solution-in-CC1.png?fit=640%2C360

Codeforces Round #392 (Div. 2), problem: (A) Holiday Of Equality Solution in C/C++

#include <stdio.h>
int main()
{
int i, n, x, s=0, max=0;
scanf(“%d”, &n);
for (i=0; i<n; i++)
{
scanf(“%d”, &x);
if (x>max)
max=x;
s+=x;
}
printf(“%d”, n*max-s);
return 0;
}

(Visited 361 times, 2 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: