Monday, March 16, 2015

501A. Contest (Codeforces)

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define pf printf
#define sf scanf

int maxFunc(int a, int b)
{
    int A1= (3*a)/10;
    int A2 = a - ((a*b)/250);
    return max(A1, A2);
}

int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int M = maxFunc(a, c);
    int V = maxFunc(b, d);
    if(M>V)
    {
        pf("Misha\n");
    }
    else if(V>M)
    {
        pf("Vasya");
    }
    else
    {
        pf("Tie\n");
    }
}

No comments:

Post a Comment

Compare equality of two string in C

#include <stdio.h> #include<string.h> int main() {     char* country = "Bangladesh";     char* country2;     ...