锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美精品久久久久久久自慰,7777久久亚洲中文字幕,国产精品青草久久久久福利99 http://m.shnenglu.com/Dreams/category/10052.htmlzh-cn Thu, 14 May 2009 04:01:39 GMT Thu, 14 May 2009 04:01:39 GMT 60 zju 2750 Idiomatic Phrases Game http://m.shnenglu.com/Dreams/archive/2009/05/14/82931.htmlDreamSky DreamSky Thu, 14 May 2009 03:09:00 GMT http://m.shnenglu.com/Dreams/archive/2009/05/14/82931.html http://m.shnenglu.com/Dreams/comments/82931.html http://m.shnenglu.com/Dreams/archive/2009/05/14/82931.html#Feedback 0 http://m.shnenglu.com/Dreams/comments/commentRss/82931.html http://m.shnenglu.com/Dreams/services/trackbacks/82931.html http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2750
// 1868088 2009-05-14 08:38:13 Wrong Answer 2750 C++ 130 4100 aslys // 1868170 2009-05-14 09:46:00 Time Limit Exceeded 2750 C++ 1001 4100 aslys // 1868224 2009-05-14 10:24:24 Accepted 2750 C++ 150 4112 aslys #include < iostream > #include< string > #include< queue > using namespace std; const int inf = 1000000000 ; const int N = 1001 ; struct Node { int t; char s[ 5 ]; char e[ 5 ]; } pt[N]; struct node { int v; int cost; node() {} // 瀹氫箟涓棿鍙橀噺鏃訛紝瑕佺敤鍒拌鏋愭瀯鍑芥暟錛屾鏃朵笉闇瑕佸垵鍊?/span> node( int a, int c) { v = a; cost = c; } friend bool operator < (node a,node b) // 閲嶈澆榪愮畻絎︼紝浠庡皬鍒板ぇ鎺掑簭 { return a.cost > b.cost; } } ; int n,gra[N][N]; void dijkstra( int u) { priority_queue < node > Q; node p,q; bool mark[N]; int dist[N]; int i,j,index; for (i = 1 ;i <= n;i ++ ) { if (gra[u][i] != inf) { p.v = i; p.cost = gra[u][i]; Q.push(p); } dist[i] = gra[u][i]; mark[i] = 0 ; } mark[u] = 1 ; for (i = 1 ;i <= n;i ++ ) { index = - 1 ; while ( ! Q.empty()) // 瀵瑰ご鍏冪礌灝辨槸鏈灝忕殑 { q = Q.top(); Q.pop(); if (mark[q.v] == 0 ) { index = q.v; break ; } } if (index == - 1 ) break ; if (index == n) break ; mark[index] = 1 ; for (j = 1 ;j <= n;j ++ ) if (mark[j] == 0 && dist[j] > q.cost + gra[index][j]) { dist[j] = q.cost + gra[index][j]; p.cost = dist[j]; p.v = j; Q.push(p); } } if (dist[n] == inf) printf( " -1\n " ); else printf(" %d\n " ,dist[n]); } int main() { while (cin >> n && n) { char temp[N]; int i,j,len; for (i = 1 ;i <= n;i ++ ) // init() for (j = 1 ;j <= n;j ++ ) gra[i][j] = inf; for (i = 1 ;i <= n;i ++ ) { scanf( " %d%s " , & pt[i].t,temp); len = strlen(temp); for (j = 0 ;j < 4 ;j ++ ) // 鍙栧ご pt[i].s[j] = temp[j]; pt[i].s[j] = ' \0 ' ; len -= 4 ; for (j = 0 ;j < 4 ;j ++ ) // 鍙栧熬 pt[i].e[j] = temp[j + len]; pt[i].e[j] = ' \0 ' ; } for (i = 1 ;i <= n;i ++ ) for (j = 1 ;j <= n;j ++ ) if (strcmp(pt[i].e,pt[j].s) == 0 ) gra[i][j] = pt[i].t; dijkstra( 1 ); } return 0 ; }
]]> zju 2853 Evolution http://m.shnenglu.com/Dreams/archive/2009/05/12/82660.htmlDreamSky DreamSky Tue, 12 May 2009 01:55:00 GMT http://m.shnenglu.com/Dreams/archive/2009/05/12/82660.html http://m.shnenglu.com/Dreams/comments/82660.html http://m.shnenglu.com/Dreams/archive/2009/05/12/82660.html#Feedback 0 http://m.shnenglu.com/Dreams/comments/commentRss/82660.html http://m.shnenglu.com/Dreams/services/trackbacks/82660.html http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2853
// 1865331 2009-05-11 21:26:46 Accepted 2853 C++ 3790 1484 aslys #include < iostream > using namespace std; const int N = 204 ; int n; double matrix[N][N]; double x[N][N],y[N][N],z[N][N]; void fun( int k, double m[][N]) { int i,j,p,t; double sum; if (k == 1 ) // 鐭╅樀鐨勪竴嬈℃柟 { for (i = 0 ;i < n;i ++ ) for (j = 0 ;j < n;j ++ ) m[i][j] = matrix[i][j]; } else if (k == 2 ) // 鐭╅樀鐨勪簩嬈℃柟 { for (i = 0 ;i < n;i ++ ) for (j = 0 ;j < n;j ++ ) { sum = matrix[i][ 0 ] * matrix[ 0 ][j]; for (p = 1 ;p < n;p ++ ) sum += matrix[i][p] * matrix[p][j]; m[i][j] = sum; } } else // 鐭╅樀鐨?nbsp;k 嬈℃柟 錛屽厛璁$畻鍑?nbsp;k/2 嬈℃柟 錛屽姞蹇綆楅熷害 { t = k / 2 ; fun(t,x); // 閫掑綊璋冪敤 for (i = 0 ;i < n;i ++ ) for (j = 0 ;j < n;j ++ ) { sum = x[i][ 0 ] * x[ 0 ][j]; for (p = 1 ;p < n;p ++ ) sum += x[i][p] * x[p][j]; y[i][j] = sum; } if ( k % 2 == 1 ) // 姣斿瀵圭煩闃礎 錛欰^9 = A^4 * A^4 * A { for (i = 0 ;i < n;i ++ ) for (j = 0 ;j < n;j ++ ) { sum = matrix[i][ 0 ] * y[ 0 ][j]; for (p = 1 ;p < n;p ++ ) sum += matrix[i][p] * y[p][j];; m[i][j] = sum; } } else { for (i = 0 ;i < n;i ++ ) for (j = 0 ;j < n;j ++ ) m[i][j] = y[i][j]; } } }int main() { int m; while (scanf( " %d%d " , & n, & m) != EOF) { if ( m == 0 && n == 0 ) break ; int i,j,k; double num[N],r; for (i = 0 ;i < n;i ++ ) // init() for (j = 0 ;j < n;j ++ ) { if (i == j) matrix[i][j] = 1.0 ; else matrix[i][j] = 0.0 ; } for (i = 0 ;i < n;i ++ ) scanf( " %lf " , & num[i]); scanf( " %d " , & k); while (k -- ) { scanf( " %d%d%lf " , & i, & j, & r); matrix[j][i] += r; // 鏋勫緩鍒濆鐭╅樀 matrix[i][i] -= r; } fun(m,z); // 姹傜煩闃電殑m嬈℃柟錛岀粨鏋滄斁鍦?nbsp;x 鏁扮粍涓?/span> r = 0.0 ; for (j = 0 ;j < n;j ++ ) r += z[n - 1 ][j] * num[j]; printf( " %.0lf\n " ,r); } return 0 ; } /**/ /* 3 1 40 20 10 2 0 1 1 1 2 1 3 2 40 20 10 2 0 1 1 1 2 1*/
]]> zju 2974 Just Pour the Water http://m.shnenglu.com/Dreams/archive/2009/05/11/82607.htmlDreamSky DreamSky Mon, 11 May 2009 11:33:00 GMT http://m.shnenglu.com/Dreams/archive/2009/05/11/82607.html http://m.shnenglu.com/Dreams/comments/82607.html http://m.shnenglu.com/Dreams/archive/2009/05/11/82607.html#Feedback 0 http://m.shnenglu.com/Dreams/comments/commentRss/82607.html http://m.shnenglu.com/Dreams/services/trackbacks/82607.html 闃呰鍏ㄦ枃 ]]> hdu 1013 Digital Roots http://m.shnenglu.com/Dreams/archive/2009/04/04/78931.htmlDreamSky DreamSky Sat, 04 Apr 2009 02:49:00 GMT http://m.shnenglu.com/Dreams/archive/2009/04/04/78931.html http://m.shnenglu.com/Dreams/comments/78931.html http://m.shnenglu.com/Dreams/archive/2009/04/04/78931.html#Feedback 0 http://m.shnenglu.com/Dreams/comments/commentRss/78931.html http://m.shnenglu.com/Dreams/services/trackbacks/78931.html http://acm.hdu.edu.cn/showproblem.php?pid=1013
#include < stdio.h > int main() { char tp[ 1001 ]; while (scanf( " %s " ,tp) != EOF) { int sum = 0 ; char * p = tp; if (strcmp(tp, " 0 " ) == 0 ) break ; /**/ /* 涓嬮潰鐨勫彉閲忚瀹氫箟鍒頒笂闈㈠幓錛屽惁鍒欎細鍑虹幇璇硶閿欒錛屽涓?nbsp; int sum = 0; char *p = tp; ************************************* 0_0_1232530_20045.c 0_0_1232530_20045.c(9) : error C2143: 璇硶閿欒 : 緙哄皯“;”(鍦?#8220;綾誨瀷”鐨勫墠闈? 0_0_1232530_20045.c(10) : error C2143: 璇硶閿欒 : 緙哄皯“;”(鍦?#8220;綾誨瀷”鐨勫墠闈? 0_0_1232530_20045.c(11) : error C2065: “p” : 鏈0鏄庣殑鏍囪瘑絎?br> 0_0_1232530_20045.c(11) : error C2100: 闈炴硶鐨勯棿鎺ュ鍧 0_0_1232530_20045.c(13) : error C2065: “sum” : 鏈0鏄庣殑鏍囪瘑絎?br> 0_0_1232530_20045.c(13) : error C2100: 闈炴硶鐨勯棿鎺ュ鍧 ************************************** */ while ( * p != ' \0 ' ) { sum += * p - ' 0 ' ; while (sum / 10 ) sum = sum % 10 + sum / 10 ; p ++ ; } printf(" %d\n " ,sum); } return 0 ; }
]]> poj 1088 婊戦洩 http://m.shnenglu.com/Dreams/archive/2009/04/02/78736.htmlDreamSky DreamSky Thu, 02 Apr 2009 12:20:00 GMT http://m.shnenglu.com/Dreams/archive/2009/04/02/78736.html http://m.shnenglu.com/Dreams/comments/78736.html http://m.shnenglu.com/Dreams/archive/2009/04/02/78736.html#Feedback 0 http://m.shnenglu.com/Dreams/comments/commentRss/78736.html http://m.shnenglu.com/Dreams/services/trackbacks/78736.html
// 涓鴻繖棰?#8230;…鏁翠釜浜虹儲鍒版瀬欏?#8230;… #include < iostream > using namespace std; int map[ 101 ][ 101 ]; int dp[ 101 ][ 101 ]; // dp[i][j]琛ㄧず浠巌 j 鍑哄彂鑳藉鍒拌揪鐨勬渶澶ч暱搴?/span>int m,n; int dir[ 4 ][ 2 ] = { { - 1 , 0 } , { 1 , 0 } , { 0 , - 1 } , { 0 , 1 } } ; int dfs( int si, int sj) { int k,vi,vj,mt,temp; if (dp[si][sj] > 0 ) return dp[si][sj]; mt = 0 ; for (k = 0 ;k < 4 ;k ++ ) { vi = si + dir[k][ 0 ]; vj = sj + dir[k][ 1 ]; if (vi >= 1 && vi <= m && vj >= 1 && vj <= n ) { if (map[vi][vj] > map[si][sj] ) { temp = dfs(vi,vj); if (temp > mt) mt = temp; } } }// for(k=0;k<4;k++) dp[si][sj] = mt + 1 ; return mt + 1 ; } int main() { while (cin >> m >> n) { int i,j; for (i = 1 ;i <= m;i ++ ) for (j = 1 ;j <= n;j ++ ) { scanf( " %d " , & map[i][j]); dp[i][j] = 0 ; } for (i = 1 ;i <= m;i ++ ) for (j = 1 ;j <= n;j ++ ) dfs(i,j); int M = 0 ; for (i = 1 ;i <= m;i ++ ) for (j = 1 ;j <= n;j ++ ) if (dp[i][j] > M) M = dp[i][j]; cout << M << endl; } return 0 ; }
http://acm.pku.edu.cn/JudgeOnline/problem?id=1088
]]> zju 2022 Factorial http://m.shnenglu.com/Dreams/archive/2009/04/02/78670.htmlDreamSky DreamSky Thu, 02 Apr 2009 04:28:00 GMT http://m.shnenglu.com/Dreams/archive/2009/04/02/78670.html http://m.shnenglu.com/Dreams/comments/78670.html http://m.shnenglu.com/Dreams/archive/2009/04/02/78670.html#Feedback 0 http://m.shnenglu.com/Dreams/comments/commentRss/78670.html http://m.shnenglu.com/Dreams/services/trackbacks/78670.html http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1022
// 璁板綍鍥犲瓙5鐨勪釜鏁?/span>#include < iostream > using namespace std; int main() { int t; cin >> t; while (t -- ) { __int64 n,sum = 0 ,p = 5 ; scanf( " %I64d " , & n); while (p <= n) { sum += n / p; n /= 5 ; } printf(" %I64d\n " ,sum); } return 0 ; }
]]>
久久久久亚洲国产 |
亚洲伊人久久精品影院 |
日本三级久久网 |
欧美色综合久久久久久 |
伊人久久大香线蕉亚洲五月天 |
日韩精品久久无码中文字幕 |
99久久99久久精品国产片 |
欧美日韩成人精品久久久免费看 |
99久久99久久精品国产片果冻 |
国产精品久久99 |
亚洲人成网站999久久久综合 |
久久亚洲AV成人无码电影 |
久久久久亚洲爆乳少妇无 |
久久婷婷激情综合色综合俺也去 |
久久电影网 |
99久久99久久 |
久久综合综合久久综合 |
欧美午夜精品久久久久久浪潮 |
国产综合久久久久久鬼色 |
久久综合色之久久综合 |
精品久久久久中文字幕日本 |
亚洲Av无码国产情品久久 |
国产精品一久久香蕉国产线看 |
亚洲精品tv久久久久 |
久久久久久免费一区二区三区 |
国产成人久久精品一区二区三区 |
久久久国产精华液 |
亚洲欧美精品伊人久久 |
国产精品美女久久久久网 |
久久精品人人做人人爽97
|
色偷偷91久久综合噜噜噜噜 |
精品午夜久久福利大片 |
国产精品久久久久影院嫩草
|
久久国产精品久久精品国产 |
麻豆成人久久精品二区三区免费
|
久久精品国产99久久无毒不卡 |
欧美黑人激情性久久 |
久久这里都是精品 |
久久久久久久久久久久久久 |
久久精品一本到99热免费 |
思思久久精品在热线热 |