Codeforces Round #379 (Div. 2), problem: (B) Anton and Digits Solution In C/C++

Hey guys I just tried the anton and digits problem , hope you might like my solution feel free to comment better solution .

#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int two, thr, fv, sx,ans, Min;

ans=0;
cin>>two>>thr>>fv>>sx;

Min = two;
if(Min>fv)
Min=fv;
if(Min>sx)
Min=sx;
ans = Min*256;
two = two – Min;
Min = two;
if(Min>thr)
Min=thr;
ans = ans+Min*32;
cout<<ans<<endl;

return 0;
}

(Visited 155 times, 1 visits today)

About the Author:

Taniv Ashraf

Leave A Comment