锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久se精品一区精品二区,久久免费观看视频,香蕉99久久国产综合精品宅男自 http://www.shnenglu.com/Going/category/10323.htmlzh-cn Tue, 12 May 2009 09:15:34 GMT Tue, 12 May 2009 09:15:34 GMT 60 hdu 2809 God of War http://www.shnenglu.com/Going/archive/2009/05/09/82349.htmlGoing Going Sat, 09 May 2009 02:20:00 GMT http://www.shnenglu.com/Going/archive/2009/05/09/82349.html http://www.shnenglu.com/Going/comments/82349.html http://www.shnenglu.com/Going/archive/2009/05/09/82349.html#Feedback 0 http://www.shnenglu.com/Going/comments/commentRss/82349.html http://www.shnenglu.com/Going/services/trackbacks/82349.html #include < iostream > #include< cstdio > #include< string > using namespace std; struct In { int ATI; int DEF; int HP; int LEVEL; } node[ 25 ],s[ 1 << 20 ]; int ATI,DEF,HP,LEVEL,INATI,INDEF,INHP; int cas; int max( int a, int b) { if (a > b) return a; else return b; } In Dfs(int p) { int r; In now; bool flag = false ; if (s[p].LEVEL != - 1 ) return s[p]; int i; for (i = 0 ;i < cas;i ++ ) { r = 1 << i; if (r & p) { now = Dfs(p - ( 1 << i)); int a = max(now.ATI - node[i].DEF, 1 ); int b = max(node[i].ATI - now.DEF, 1 ); int c = now.HP - (node[i].HP / a - 1 + ((node[i].HP % a) > 0 )) * b; int h = (now.LEVEL + node[i].LEVEL) / 100 ; if (c > 0 ) c = c + INHP * (h - (now.LEVEL / 100 )); if ( ! flag || c > s[p].HP) { s[p].HP = c; s[p].ATI = s[ 0 ].ATI + h * INATI; s[p].DEF = s[ 0 ].DEF + h * INDEF; s[p].LEVEL = (now.LEVEL + node[i].LEVEL); flag = true ; } } } return s[p]; } int main() { while (scanf( " %d%d%d%d%d%d " , & s[ 0 ].ATI, & s[ 0 ].DEF, & s[ 0 ].HP, & INATI, & INDEF, & INHP) != EOF) { char name[ 25 ]; scanf( " %d " , & cas); int i; for (i = 0 ; i < cas;i ++ ) { scanf( " %s%d%d%d%d " , & name, & node[i].ATI, & node[i].DEF, & node[i].HP, & node[i].LEVEL); } s[0 ].LEVEL = 0 ; int last = ( 1 << cas) - 1 ; for (i = 1 ; i <= last ;i ++ ) s[i].LEVEL = - 1 ; In ans; ans = Dfs(last); if (ans.HP > 0 ) printf( " %d\n " ,ans.HP); else printf(" Poor LvBu,his period was gone.\n " ); } return 0 ; }
]]>hdu 1978 How many ways http://www.shnenglu.com/Going/archive/2009/05/08/82273.htmlGoing Going Fri, 08 May 2009 13:34:00 GMT http://www.shnenglu.com/Going/archive/2009/05/08/82273.html http://www.shnenglu.com/Going/comments/82273.html http://www.shnenglu.com/Going/archive/2009/05/08/82273.html#Feedback 0 http://www.shnenglu.com/Going/comments/commentRss/82273.html http://www.shnenglu.com/Going/services/trackbacks/82273.html #include < iostream > using namespace std; int m,n; int g[ 105 ][ 105 ],dp[ 105 ][ 105 ]; int Dfs( int a, int b) { if (dp[a][b] != - 1 ) return dp[a][b]; int i,j,d,sum; d = g[a][b]; sum = 0 ; for (i = 0 ;i <= d;i ++ ) { for (j = 0 ;i + j <= d;j ++ ) { if ((i + j) == 0 ) continue ; if (a + i <= m && b + j <= n) { sum += Dfs(a + i,b + j); } else { break ; } } } sum = sum % 10000 ; dp[a][b] = sum; return dp[a][b]; } int main() { int i,j,t; scanf( " %d " , & t); while (t -- ) { scanf( " %d%d " , & m, & n); for (i = 1 ; i <= m;i ++ ) for (j = 1 ; j <= n;j ++ ) scanf( " %d " , & g[i][j]); memset(dp, - 1 , sizeof (dp)); dp[m][n] = 1 ; cout << Dfs( 1 , 1 ) << endl; } return 0 ; }
]]>zju 2765 Recursively Palindromic Partitions http://www.shnenglu.com/Going/archive/2009/05/08/82205.htmlGoing Going Fri, 08 May 2009 00:13:00 GMT http://www.shnenglu.com/Going/archive/2009/05/08/82205.html http://www.shnenglu.com/Going/comments/82205.html http://www.shnenglu.com/Going/archive/2009/05/08/82205.html#Feedback 0 http://www.shnenglu.com/Going/comments/commentRss/82205.html http://www.shnenglu.com/Going/services/trackbacks/82205.html
#include < iostream > using namespace std; const int MAX = 2140000000 ; int f[ 1000001 ]; void Dfs( int p) { int i,sum = 1 ,temp; if (p % 2 == 1 ) { for (i = 1 ; i < p;i += 2 ) { temp = (p - i) / 2 ; if (f[temp] == MAX) Dfs(temp); sum += f[temp]; } } else { for (i = 0 ;i < p;i += 2 ) { temp = (p - i) / 2 ; if (f[temp] == MAX) Dfs(temp); sum += f[temp]; } } f[p] = sum; } int main() { int text; cin >> text; int i; for (i = 0 ;i <= 1000000 ;i ++ ) f[i] = MAX; int cases = 1 ; f[ 0 ] = 0 ; f[ 1 ] = 1 ; f[ 2 ] = 2 ; f[ 3 ] = 2 ; f[ 4 ] = 4 ; while (text -- ) { int n; cin >> n; if (f[n] == MAX) Dfs(n); cout << cases ++<< " " << f[n] << endl; } return 0 ; }
]]>hdu 1074 Doing Homework http://www.shnenglu.com/Going/archive/2009/04/28/81332.htmlGoing Going Tue, 28 Apr 2009 09:38:00 GMT http://www.shnenglu.com/Going/archive/2009/04/28/81332.html http://www.shnenglu.com/Going/comments/81332.html http://www.shnenglu.com/Going/archive/2009/04/28/81332.html#Feedback 0 http://www.shnenglu.com/Going/comments/commentRss/81332.html http://www.shnenglu.com/Going/services/trackbacks/81332.html #include < iostream > #include< algorithm > #include< string > using namespace std; typedef struct aa { string s; int d,c; } Node; Node a[ 20 ]; int binary[ 16 ] = { 1 , 2 , 4 , 8 , 16 , 32 , 64 , 128 , 256 , 512 , 1024 , 2048 , 4096 , 8192 , 16384 , 32768 } ; int flag[ 65536 ]; bool mark[ 16 ]; string str[ 16 ],outs[ 16 ]; int n; void Dfs( int days, int cost, int sum, int num) // days琛ㄧず鍐欎綔涓氱殑寮濮嬫棩鏈燂紝cost琛ㄧず鍓嶉潰鐨勮姳璐癸紝sum璁板綍浣滀笟鏄惁瀹屾垚鎯呭喌錛宯um琛ㄧず閫夋嫨鐨勪綔涓氭暟 { int i,temp; if (num == n) { if (flag[sum] == cost) { // flag[sum] = cost; for (i = 0 ;i < num;i ++ ) outs[i] = str[i]; } return ; } for (i = 1 ;i <= n;i ++ ) { if (mark[i] == false ) { mark[i] = true ; sum += binary[i]; // 瑕佸啓絎琲闂ㄨ temp = days + a[i].c - a[i].d; if (temp < 0 ) temp = cost; else { temp = temp + cost; } // 絎琲闂ㄤ綔涓氬畬鎴愬悗鐨勪唬浠穞emp if (flag[sum] > temp) { flag[sum] = temp; // 璁板綍鐘舵?/span> str[num ++ ] = a[i].s; Dfs(a[i].c + days,temp,sum,num); num -- ; } sum = sum - binary[i]; mark[i] = false ; } } }int main() { int test; cin >> test; while (test -- ) { cin >> n; int i; int st = 0 ; for (i = 1 ;i <= n;i ++ ) { cin >> a[i].s >> a[i].d >> a[i].c; } for (i = 0 ;i < 65536 ;i ++ ) { flag[i] = 1000000 ; } memset(mark,false , sizeof (mark)); // 鏍囪鐘舵?/span> Dfs( 0 , 0 , 0 , 0 ); for (i = 1 ;i <= n;i ++ ) { st += binary[i]; // 緇撴灉瀛樻斁鍦ㄤ笅鏍囦負st鐨刦lag[st]涓?/span> } cout<< flag[st] << endl; for (i = 0 ;i < n;i ++ ) cout << outs[i] << endl; } return 0 ; }
]]>hdu 1241 Oil Deposits http://www.shnenglu.com/Going/archive/2009/04/23/80834.htmlGoing Going Thu, 23 Apr 2009 05:01:00 GMT http://www.shnenglu.com/Going/archive/2009/04/23/80834.html http://www.shnenglu.com/Going/comments/80834.html http://www.shnenglu.com/Going/archive/2009/04/23/80834.html#Feedback 0 http://www.shnenglu.com/Going/comments/commentRss/80834.html http://www.shnenglu.com/Going/services/trackbacks/80834.html #include < iostream > #include< string > using namespace std; int sum,m,n; bool used[ 102 ][ 102 ]; char maps[ 102 ][ 102 ]; int a[ 8 ][ 2 ] = { { 0 , 1 } , { 0 , - 1 } , { 1 , 0 } , { - 1 , 0 } , { 1 , 1 } , { 1 , - 1 } , { - 1 , 1 } , { - 1 , - 1 } } ; void Dfs( int i, int j) { int k; int s,t; if (used[i][j] == true ) return ; for (k = 0 ;k < 8 ;k ++ ) { s = i + a[k][ 0 ]; t = j + a[k][ 1 ]; if (s < 0 || s >= n || t < 0 || t >= m) continue ; if (maps[s][t] == ' @ ' && used[s][t] == false ) { used[s][t] = true ; Dfs(s,t); } }// while(!Q.empty()) } int main() { int i,j; while (cin >> n >> m) { if (n == 0 && m == 0 ) break ; for (i = 0 ;i < n;i ++ ) scanf( " %s " ,maps[i]); for (i = 0 ;i < n;i ++ ) for (j = 0 ;j < m;j ++ ) used[i][j] = false ; sum = 0 ; for (i = 0 ;i < n;i ++ ) { for (j = 0 ;j < m;j ++ ) { if (maps[i][j] == ' @ ' && used[i][j] == false ) { used[i][j] = true ; Dfs(i,j); sum ++ ; } } } printf(" %d\n " ,sum); } return 0 ; } /**/ /* #include<iostream> #include<queue> #include<string> using namespace std; typedef struct node { int x,y; }Node; queue<Node> Q; int sum,m,n; bool used[102][102]; char maps[102][102]; int a[8][2] = {{0,1},{0,-1},{1,0},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}}; void Bfs(int i,int j) { Node p,q; int k; int s,t; p.x = i; p.y = j; Q.push(p); while(!Q.empty()) { q = Q.front(); Q.pop(); for(k = 0;k < 8;k++) { s = q.x + a[k][0]; t = q.y + a[k][1]; if(s < 0 || s >= n || t < 0 || t >= m) continue; if(maps[s][t] == '@' && used[s][t] == false) { used[s][t] = true; p.x = s; p.y = t; Q.push(p); } } }//while(!Q.empty()) } int main() { int i,j; while(cin>>n>>m) { if(n == 0 && m == 0) break; for(i = 0;i < n;i++) //cin>>maps[i]; scanf("%s",maps[i]); for(i = 0;i < n;i++) for(j = 0;j < m;j++) used[i][j] = false; sum = 0; for(i = 0;i < n;i++) { for(j = 0;j < m;j++) { if(maps[i][j] == '@' && used[i][j] == false) { used[i][j] = true; Bfs(i,j); sum++; } } } printf("%d\n",sum); //cout<<sum<<endl; } return 0; }*/
]]>hdu 1016 Prime Ring Problem http://www.shnenglu.com/Going/archive/2009/04/23/80832.htmlGoing Going Thu, 23 Apr 2009 04:55:00 GMT http://www.shnenglu.com/Going/archive/2009/04/23/80832.html http://www.shnenglu.com/Going/comments/80832.html http://www.shnenglu.com/Going/archive/2009/04/23/80832.html#Feedback 0 http://www.shnenglu.com/Going/comments/commentRss/80832.html http://www.shnenglu.com/Going/services/trackbacks/80832.html #include < iostream > using namespace std; bool used[ 21 ]; bool prim[ 41 ]; int a[ 21 ]; int n; void Initprim() { int i; for (i = 0 ;i <= 40 ;i ++ ) { prim[i] = false ; } prim[2 ] = prim[ 3 ] = prim[ 5 ] = prim[ 7 ] = true ; prim[ 11 ] = prim[ 13 ] = prim[ 17 ] = prim[ 19 ] = true ; prim[ 23 ] = prim[ 29 ] = prim[ 31 ] = prim[ 37 ] = true ; } // 灝?0浠ュ唴鐨勭礌鏁版爣璁板嚭鏉?/span>void Dfs( int k) { int i; if (k > n) { if (prim[a[ 1 ] + a[n]]) // 濡傛灉澶村熬鐩稿姞鏄礌鏁幫紝灝卞彲杈撳嚭 { cout << a[ 1 ]; for (i = 2 ;i <= n;i ++ ) { cout << " " << a[i]; } cout<< endl; } } else { for (i = 2 ;i <= n;i ++ ) { if ( ! used[i] && prim[i + a[k - 1 ]]) { used[i] = true ; a[k] = i; Dfs(k + 1 ); // 涓鐩存繁鎼滐紝 used[i] = false ; } } } }int main() { int cases = 1 ; int i; Initprim(); for (i = 1 ;i <= 20 ;i ++ ) used[i] = false ; used[ 1 ] = true ; a[ 1 ] = 1 ; while (cin >> n) { cout << " Case " << cases ++<< " : " << endl; Dfs( 2 ); cout << endl; } return 0 ; }
]]>
区久久AAA片69亚洲 |
欧美日韩精品久久久免费观看 |
久久国产亚洲精品无码 |
99精品久久精品一区二区 |
国产精品热久久毛片 |
欧美无乱码久久久免费午夜一区二区三区中文字幕
|
性做久久久久久免费观看 |
国产精品一区二区久久精品涩爱 |
亚洲精品无码专区久久久 |
国产精品青草久久久久婷婷
|
久久亚洲日韩精品一区二区三区 |
99久久精品国产麻豆 |
青青热久久国产久精品 |
国内精品久久久久伊人av |
久久亚洲精品无码播放 |
伊人久久大香线蕉亚洲五月天
|
久久99国产精品久久 |
久久伊人色 |
av无码久久久久不卡免费网站 |
久久精品成人免费观看97 |
亚洲AV无码久久精品成人 |
99久久免费国产精品 |
亚洲级αV无码毛片久久精品
|
久久青青草原综合伊人 |
欧美亚洲国产精品久久高清 |
久久免费美女视频 |
亚洲AV成人无码久久精品老人 |
久久97久久97精品免视看秋霞 |
久久精品九九亚洲精品 |
中文成人无码精品久久久不卡 |
香蕉久久夜色精品国产小说 |
久久久久亚洲AV片无码下载蜜桃 |
国产午夜电影久久 |
国产午夜福利精品久久2021
|
久久93精品国产91久久综合 |
97r久久精品国产99国产精 |
中文成人久久久久影院免费观看 |
国内精品免费久久影院 |
亚洲国产精品久久久久婷婷软件 |
久久综合九色综合网站 |
久久亚洲AV无码精品色午夜麻豆 |