Codeforces Round #377 (Div. 2), problem: (C) Sanatorium, Solution in C++

Hi guys , I just solved the Codeforces Round #377 (Div. 2), problem: (C) Sanatorium , hope you like it .
You are most welcome to submit any other solution .

#include
using namespace std;
int main()
{
long long int a[3], t, i, ans, temp, j;

for(i=0; i<3; i++) cin>>a[i];
if(a[0]==a[1] && a[0]==a[2])
cout<<0<a[j])
{
t=a[i];
a[i]=a[j];
a[j]=t;
}
}
}

ans=0;
temp = a[2]-1-a[1];
if(temp>0)
ans += temp;
temp = a[2]-1-a[0];
if(temp>0)
ans += temp;
cout<

(Visited 107 times, 1 visits today)
By | 2017-04-07T22:11:51+00:00 October 17th, 2016|Categories: C/C++, Programming|Tags: , , , , |0 Comments

About the Author:

Leave A Comment