Codeforces 501 A. Contest Solution

Solve In c++:

///AH Tonmoy
///Islamic University,Bangladesh;
#include<bits/stdc++.h>
using namespace std;
int main()
{

    int a,b,c,d,x,x1,y,y1,r,r1;
    while(cin>>a>>b>>c>>d)
    {
        x=3*a/10;
        y=a-((a/250)*c);

        r=max(x,y);

        x1=3*b/10;
        y1=b-((b/250)*d);

        r1=max(x1,y1);

        if(r<r1)
            cout<<"Vasya"<<endl;
        else if(r1<r)
            cout<<"Misha"<<endl;
        else if(r==r1)
        {
            cout<<"Tie"<<endl;
        }


    }
    return 0;
}

No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h &g...

Powered by Blogger.