#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#include <cstdio>//sprintf islower isupper
#include <cstdlib>//malloc exit strcat itoa system("cls")
#include <iostream>//pair
#include <fstream>//freopen("C:\\Users\\13606\\Desktop\\草稿.txt","r",stdin);
#include <bitset>
//#include <map>
//#include<unordered_map>
#include <vector>
#include <stack>
#include <set>
#include <string.h>//strstr substr
#include <string>
#include <time.h>//srand(((unsigned)time(NULL))); Seed n=rand()%10 - 0~9;
#include <cmath>
#include <deque>
#include <queue>//priority_queue<int, vector<int>, greater<int> > q;//less
#include <vector>//emplace_back
//#include <math.h>
//#include <windows.h>//reverse(a,a+len);// ~ ! ~ ! floor
#include <algorithm>//sort + unique : sz=unique(b+1,b+n+1)-(b+1);+nth_element(first, nth, last, compare)
using namespace std;//next_permutation(a+1,a+1+n);//prev_permutation
//******************
int abss(int a);
int lowbit(int n);
int Del_bit_1(int n);
int maxx(int a,int b);
int minn(int a,int b);
double fabss(double a);
void swapp(int &a,int &b);
clock_t __STRAT,__END;
double __TOTALTIME;
void _MS(){__STRAT=clock();}
void _ME(){__END=clock();__TOTALTIME=(double)(__END-__STRAT)/CLOCKS_PER_SEC;cout<<"Time: "<<__TOTALTIME<<" s"<<endl;}
//***********************
#define rint register int
#define fo(a,b,c) for(rint a=b;a<=c;++a)
#define fr(a,b,c) for(rint a=b;a>=c;--a)
#define mem(a,b) memset(a,b,sizeof(a))
#define pr printf
#define sc scanf
#define ls rt<<1
#define rs rt<<1|1
typedef long long ll;
const double E=2.718281828;
const double PI=acos(-1.0);
//const ll INF=(1LL<<60);
const int inf=(<<);
const double ESP=1e-;
const int mod=(int)1e9+;
const int N=(int)6e6+; int a[N];
int dp[N][];//表示只有和mask后i位不同的子集; int main()
{
int n;
sc("%d",&n);
for(int i=;i<=n;++i)
sc("%d",&a[i]),dp[i][]=a[i];
for(int i=;i<=(<<);++i)
{
for(int j=;j<=;++j)
{
int pos=j-;
if((i>>pos)&) dp[i][j]=dp[i][j-]+dp[i^(<<pos)][j-];
else dp[i][j]=dp[i][j-];
}
}
return ;
} /**************************************************************************************/ int maxx(int a,int b)
{
return a>b?a:b;
} void swapp(int &a,int &b)
{
a^=b^=a^=b;
} int lowbit(int n)
{
return n&(-n);
} int Del_bit_1(int n)
{
return n&(n-);
} int abss(int a)
{
return a>?a:-a;
} double fabss(double a)
{
return a>?a:-a;
} int minn(int a,int b)
{
return a<b?a:b;
}

最新文章

  1. android中接口和抽象类的区别
  2. 修改hosts文件,修改后不生效怎么办
  3. 依赖注入(DI)和Ninject,Ninject
  4. SE Homework 1 —An Error Impressed Me
  5. CSS样式 让你的输入的小写自动变成大写。
  6. curl获取http请求的状态码
  7. Java JPA 查询实体部分字段
  8. nopCommerce架构分析系列(二)数据Cache
  9. android百度地图打包混淆 用不了No such file or directory (2) com.baidu.mapapi.BMapManager.init(Unknown Source)
  10. Varnish的vcl子程序
  11. 关于脱离laravel框架使用Illuminate/Validation验证器
  12. 闪屏页面开发遇到的问题you need to use a theme.appcompat theme (or descendant)
  13. 用户身份切换之初窥企业远程用户没root还有root权限
  14. 使用fastcall 代替汇编hook thiscall
  15. python小趣味_520绘制一个心形.
  16. SQL表的基本操作
  17. 百度地图JSSDK使用小实例
  18. 关于想通过ros的dstnat实现公网IP nat 公网IP的情况
  19. python中,如何将字符串转换为数字(将数字转换为整型),字符串的10转换为整型的10,10.5转换为10
  20. centos下安卓构建打包太慢

热门文章

  1. maxwell的数据引导方式
  2. python 快速排序-代码示例
  3. Linux-ubuntu英文版输入法不能切换中文输入法问题解决办法
  4. JAVA类定义的修饰
  5. [Java]给指定时间加上十秒
  6. k8s-helm02-----helm常用命令
  7. 数据分析 - matpltlib 模块
  8. php----处理从mysql查询返回的数据
  9. idea设置包的导入和提示重复代码下波浪线
  10. Ubuntu防火墙常用命令