ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1787. Turn for MEGA

Whats wrong c++?
Posted by Vadim 16 Aug 2016 18:42
#include <iostream>

using namespace std;

int main()
{
    int k;
    cin >> k;

    int n;
    cin >> n;

    int change;
    int result = 0;

    for (int i = 0; i < n; i++)
    {
        cin >> change;
        result += change;
    }

    if (result - k*n >= 0) cout << result - k*n;
    else cout << 0;
    return 0;
}
Re: Whats wrong c++?
Posted by ToadMonster 16 Aug 2016 21:13
Author's behavior.
1) You should explain what problem is - WA/TLE/runtime error.
2) You should better remove/clear/add explanation to post after you solved task yourself.

Edited by author 16.08.2016 21:18