链接:http://codeforces.com/contest/734/problem/B
题意:用2,3,5,6组成若干个32和256,求总和最大能组成多少。
分析:贪心优先组256即可。
代码:
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<queue>
#include<bitset>
#include<math.h>
#include<vector>
#include<string>
#include<stdio.h>
#include<cstring>
#include<iostream>
#include<algorithm>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
typedef double db;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
const db eps=1e-5;
const int N=1e6+10;
const int M=4e6+10;
const ll MOD=1000000007;
const int mod=1000000007;
const int MAX=1000000010;
const double pi=acos(-1.0);
int main()
{
ll a,b,c,d,ans=0;
scanf("%I64d%I64d%I64d%I64d", &a, &b, &c, &d);
ans+=1ll*256*min(a,min(c,d));
a-=min(a,min(c,d));
ans+=1ll*32*min(a,b);
printf("%I64d\n", ans);
return 0;
}