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 2066. Simple Expression

Simple Solution in C++
Posted by Sofiullah Iqbal Kiron 5 Mar 2020 12:46
$ Please make sure that you have tried enough and than see solution for gathering concept.


$ Code:-

#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a+3);
    cout << min((a[0]-a[1]-a[2]), (a[0]-a[1]*a[2])) << endl;
}
Re: Simple Solution in C++
Posted by Daibri 3 May 2022 04:57
It IS already sorted. XD