锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品无码久久久久久国产,理论片午午伦夜理片久久,久久精品中文字幕一区 http://www.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://www.shnenglu.com/Dreams/archive/2009/05/14/82931.htmlDreamSky DreamSky Thu, 14 May 2009 03:09:00 GMT http://www.shnenglu.com/Dreams/archive/2009/05/14/82931.html http://www.shnenglu.com/Dreams/comments/82931.html http://www.shnenglu.com/Dreams/archive/2009/05/14/82931.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/82931.html http://www.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://www.shnenglu.com/Dreams/archive/2009/05/12/82660.htmlDreamSky DreamSky Tue, 12 May 2009 01:55:00 GMT http://www.shnenglu.com/Dreams/archive/2009/05/12/82660.html http://www.shnenglu.com/Dreams/comments/82660.html http://www.shnenglu.com/Dreams/archive/2009/05/12/82660.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/82660.html http://www.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://www.shnenglu.com/Dreams/archive/2009/05/11/82607.htmlDreamSky DreamSky Mon, 11 May 2009 11:33:00 GMT http://www.shnenglu.com/Dreams/archive/2009/05/11/82607.html http://www.shnenglu.com/Dreams/comments/82607.html http://www.shnenglu.com/Dreams/archive/2009/05/11/82607.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/82607.html http://www.shnenglu.com/Dreams/services/trackbacks/82607.html 闃呰鍏ㄦ枃 ]]> hdu 1013 Digital Roots http://www.shnenglu.com/Dreams/archive/2009/04/04/78931.htmlDreamSky DreamSky Sat, 04 Apr 2009 02:49:00 GMT http://www.shnenglu.com/Dreams/archive/2009/04/04/78931.html http://www.shnenglu.com/Dreams/comments/78931.html http://www.shnenglu.com/Dreams/archive/2009/04/04/78931.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/78931.html http://www.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://www.shnenglu.com/Dreams/archive/2009/04/02/78736.htmlDreamSky DreamSky Thu, 02 Apr 2009 12:20:00 GMT http://www.shnenglu.com/Dreams/archive/2009/04/02/78736.html http://www.shnenglu.com/Dreams/comments/78736.html http://www.shnenglu.com/Dreams/archive/2009/04/02/78736.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/78736.html http://www.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://www.shnenglu.com/Dreams/archive/2009/04/02/78670.htmlDreamSky DreamSky Thu, 02 Apr 2009 04:28:00 GMT http://www.shnenglu.com/Dreams/archive/2009/04/02/78670.html http://www.shnenglu.com/Dreams/comments/78670.html http://www.shnenglu.com/Dreams/archive/2009/04/02/78670.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/78670.html http://www.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 ; }
]]>
国产亚洲美女精品久久久2020 |
国产精品成人99久久久久
|
午夜肉伦伦影院久久精品免费看国产一区二区三区
|
久久久精品午夜免费不卡 |
久久精品国产久精国产一老狼 |
精品无码久久久久久久久久 |
亚洲精品高清国产一久久 |
91精品国产91久久久久福利 |
精品国际久久久久999波多野 |
久久精品欧美日韩精品 |
精品久久久久久久久午夜福利 |
国产精品一区二区久久 |
国产精品99久久久久久人 |
久久国产精品-国产精品 |
97久久精品午夜一区二区 |
曰曰摸天天摸人人看久久久 |
精品欧美一区二区三区久久久 |
欧美性猛交xxxx免费看久久久 |
久久热这里只有精品在线观看 |
色婷婷综合久久久久中文 |
成人久久综合网 |
久久久久国产成人精品亚洲午夜 |
亚洲中文字幕伊人久久无码 |
亚洲色欲久久久综合网东京热 |
久久国产精品久久久 |
亚洲欧洲精品成人久久奇米网 |
久久综合噜噜激激的五月天 |
精品国产婷婷久久久 |
日本欧美久久久久免费播放网 |
国产精品美女久久久免费 |
日本WV一本一道久久香蕉 |
狠狠色丁香婷综合久久 |
一本大道久久东京热无码AV |
99麻豆久久久国产精品免费 |
亚洲午夜福利精品久久 |
狠狠色丁香久久婷婷综 |
人人妻久久人人澡人人爽人人精品 |
久久免费视频观看 |
久久WWW免费人成一看片 |
久久本道久久综合伊人 |
久久精品中文騷妇女内射 |