Codeforces 734 B. Anton and Digits Solution

Solve in C++:

#include<bits/stdc++.h>
using namespace std;
main()
{

    long long int k2,k3,k5,k6,i,n,m1,m2,m3,d,r1,r2;
    while(cin>>k2>>k3>>k5>>k6)
    {
        m1=min(k2,k5);
        m2=min(m1,k6);
        r1=m2*256;
        d=k2-m2;

        if(d>0)
        {
            m3=min(d,k3);
            r2=m3*32;
            cout<<r1+r2<<endl;
        }
        else
        {
            cout<<r1<<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 ...

Powered by Blogger.