#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #pragma comment(linker, "/STACK:10240000000,10240000000") #define mem(x,k) memset(x,k,sizeof(x)) #define rep(i,n) for(int i=0;i pii; #define CHG ch=getchar() #define FRD x=bo=0; for(CHG;ch<'0'||ch>'9';CHG) if(ch=='-')bo=1; #define FR2 for(;ch>='0'&&ch<='9';x=(x<<1)+(x<<3)+ch-'0',CHG); char ch; int bo; inline bool blank(char ch){return ch==' '||ch=='\n'||ch=='\r'||ch=='\t';} inline void rd(int &x){ FRD FR2 if (bo)x=-x; } inline void RD(ll &x){ FRD FR2 if (bo)x=-x; } inline ll RD(){ ll x; RD(x); return x; } inline int rd(){ int x; rd(x); return x;} inline void RD(char *s){///scanf %s for (CHG;blank(ch);CHG); for (;!blank(ch);CHG)*s++=ch; *s=0; } inline void RD(char &c){for(CHG;blank(c);CHG);} inline void RD(double &x){ scanf("%lf",&x);} template inline void OT(T x){ static char buf[20]; char *p1=buf;if(!x)*p1++='0';if (x<0)putchar('-'),x=-x; while(x)*p1++=x%10+'0',x/=10; while(p1--!=buf)putchar(*p1); } #define pe() puts("") #define pk() putchar(' ') #define wt(x) OT(x),pe(); #define wl(a,n) rep(_i,n) OT(a[_i]),putchar(" \n"[_i==n-1]); const int maxn = 1e6 + 14; int num[11]; int weight[3000]; int dp[3000][6]; int an; const int mx = 1<<11; int dfs(int sign, int day){ if(day==5){ // printf("%d\n",weight[mx-sign-1]); return weight[sign]; } if(dp[sign][day]!=-1) return dp[sign][day]; // debug; dp[sign][day] = inf; // printf("%d.....\n",sign); for(int i=0;i