https://i1.wp.com/eblogarithm.com/wp-content/uploads/2016/10/Codeforces-Round-377-Div-2-problem-C-Sanatorium-Solution-in-C1.png?fit=640%2C360

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 92 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: