https://i2.wp.com/eblogarithm.com/wp-content/uploads/2016/11/Codeforces-Round-379-Div-2-problem-B-Anton-and-Digits-Solution-In-CC1.png?fit=640%2C360

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



There are no comments

Add yours

Leave a Reply

%d bloggers like this: