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 2035. Another Dress Rehearsal

C++ AC
Posted by D4nick 2 Jan 2019 08:00
#include <iostream>
using namespace std;
int main() {
    long x, y, c, a, b, MIN, MAX;
    cin >> x >> y >> c;
    if (x + y < c) {
        cout << "Impossible";
        return 0;
    }
    if (x >= c)
        cout << c << " " << 0;
    else if (y >= c)
        cout << 0 << " " << c;
    else{
        if (x < y)
            cout << x << " " << c - x;
        else
            cout << c - y <<  " " << y ;
    }
}
Re: C++ AC
Posted by Smilodon_am [Obninsk INPE] 2 Jan 2019 12:33
Please, do not publish your accepted solution code on forum. You disable other people to put their mind on the task in such a manner.
Please respect other possibility to solve a task on their own.
Re: C++ AC
Posted by D4nick 30 Jan 2019 03:03
I think that  if people don't need an answer they will not watch it. But if they need to see it, an answer is very useful to them, they can find their mistakes and to learn one more variant of programming. Also I watched answers of other people but it absolutely doesn't mean I answered the same on that problems and haven't put my own mind on the tasks.
Smilodon_am [Obninsk INPE] wrote 2 January 2019 12:33
Please, do not publish your accepted solution code on forum. You disable other people to put their mind on the task in such a manner.
Please respect other possibility to solve a task on their own.

Edited by author 30.01.2019 03:06