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 712 times, 1 visits today)

About the Author:

Leave A Comment