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

By |2017-04-07T22:10:19+00:00January 20th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

#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; }