USACO:Healthy Holsteins

/*
ID: Jang Lawrence
PROG: holstein
LANG: C++
*/
#include
#include
#include
#include
#include
#define mp make_pair
using namespace std;
int need[30];
int n,g,val[16][30],ans,ansx;
int countbit(int x){return x==0?0:1+countbit(x&(x-1));}
void  yes(int x)
{
    int a[30]={};
    for(int i=0;iansx) ansx=x;
        }
    }
}
int main()
{
  #ifndef  DEBUG
  freopen("holstein.in","r",stdin);
  freopen("holstein.out","w",stdout);
  #endif
  scanf("%d",&n);
  for(int i=0;i=0;--i)
    if(ansx&(1<

你可能感兴趣的:(usaco)