锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品久久8x国产免费观看,亚洲va久久久噜噜噜久久狠狠,伊人久久大香线蕉影院95 http://www.shnenglu.com/Dreams/category/10188.htmlzh-cn Sun, 03 May 2009 03:49:21 GMT Sun, 03 May 2009 03:49:21 GMT 60 hdu 1429 鑳滃埄澶ч冧骸(緇? http://www.shnenglu.com/Dreams/archive/2009/05/02/81677.htmlDreamSky DreamSky Sat, 02 May 2009 00:43:00 GMT http://www.shnenglu.com/Dreams/archive/2009/05/02/81677.html http://www.shnenglu.com/Dreams/comments/81677.html http://www.shnenglu.com/Dreams/archive/2009/05/02/81677.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/81677.html http://www.shnenglu.com/Dreams/services/trackbacks/81677.html 闃呰鍏ㄦ枃 ]]> hdu 1728 閫冪榪峰 http://www.shnenglu.com/Dreams/archive/2009/04/23/80882.htmlDreamSky DreamSky Thu, 23 Apr 2009 11:25:00 GMT http://www.shnenglu.com/Dreams/archive/2009/04/23/80882.html http://www.shnenglu.com/Dreams/comments/80882.html http://www.shnenglu.com/Dreams/archive/2009/04/23/80882.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/80882.html http://www.shnenglu.com/Dreams/services/trackbacks/80882.html http://acm.hdu.edu.cn/showproblem.php?pid=1728
// 1302018 2009-04-23 19:16:46 Accepted 1728 31MS 332K 1788 B C++ no way #include < iostream > #include< queue > #include< stdio.h > using namespace std; struct Node { int x; int y; } ; int dir[ 4 ][ 2 ] = { { - 1 , 0 } , { 1 , 0 } , { 0 , - 1 } , { 0 , 1 } } ; char map[ 102 ][ 102 ]; int m,n,step; int ok,sx,sy,ex,ey; int mark[ 102 ][ 102 ]; void Init() { int i,j; cin >> m >> n; for (i = 0 ;i < m;i ++ ) for (j = 0 ;j < n;j ++ ) mark[i][j] = - 1 ; for (i = 0 ;i < m;i ++ ) scanf( " %s " ,map[i]); scanf( " %d%d%d%d%d " , & step, & sy, & sx, & ey, & ex); sx -- ; sy -- ; ex -- ; ey -- ; } void bfs() { int k,turns; Node q,p; queue < Node > Q; p.x = sx; p.y = sy; Q.push(p); while ( ! Q.empty()) { q = Q.front(); Q.pop(); turns = mark[q.x][q.y] + 1 ; for (k = 0 ;k < 4 ;k ++ ) // 鍥涙柟鍚戯紝姣忎釜鏂瑰悜閮借蛋鍒板簳 { p.x = q.x + dir[k][ 0 ]; p.y = q.y + dir[k][ 1 ]; while (p.x >= 0 && p.x < m && p.y >= 0 && p.y < n && map[p.x][p.y] == ' . ' ) // { if (mark[p.x][p.y] == - 1 ) { if (p.x == ex && p.y == ey && turns <= step ) { // 鏈鍏堟悳鍒扮殑灝辨槸鏈浼樼殑錛?nbsp; ok = 1 ; return ; } mark[p.x][p.y] = turns; Q.push(p); } p.x += dir[k][ 0 ]; p.y += dir[k][ 1 ]; } }// for(k=0;k<4;k++) } // while(!Q.empty()) } int main() { int t; cin >> t; while (t -- ) { Init(); if (sx == ex && sy == ey) { printf( " yes\n " ); continue ; } ok = 0 ; bfs(); if ( ok == 1 ) cout << " yes " << endl; else cout<< " no " << endl; } return 0 ; }
]]> zju 2849 Attack of Panda Virus http://www.shnenglu.com/Dreams/archive/2009/04/17/80211.htmlDreamSky DreamSky Fri, 17 Apr 2009 01:15:00 GMT http://www.shnenglu.com/Dreams/archive/2009/04/17/80211.html http://www.shnenglu.com/Dreams/comments/80211.html http://www.shnenglu.com/Dreams/archive/2009/04/17/80211.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/80211.html http://www.shnenglu.com/Dreams/services/trackbacks/80211.html http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1849
// 1833420 2009-04-14 16:41:33 Memory Limit Exceeded 2849 C++ 0 32769 aslys // 1835799 2009-04-17 09:10:34 Accepted 2849 C++ 780 8292 aslys #include < iostream > #include< queue > using namespace std; struct Node { int vi; int vj; int day; int type; friend bool operator < (Node a,Node b) { if (a.day != b.day) return a.day > b.day; else return a.type > b.type; } }; priority_queue < Node > Q; int dir[ 4 ][ 2 ] = { - 1 , 0 , 1 , 0 , 0 , - 1 , 0 , 1 } ; int m,n; int gra[ 501 ][ 501 ]; int sum[ 250002 ]; void init() { int i,j; Node p; memset(sum, 0 , sizeof (sum)); // 涓瀹氳鍏ㄩ儴娓呯┖錛屽垏璁板垏璁?/span> for (i = 1 ;i <= m;i ++ ) { for (j = 1 ;j <= n;j ++ ) { scanf( " %d " , & gra[i][j]); if (gra[i][j] > 0 ) { p.vi = i; p.vj = j; p.day = 1 ; p.type = gra[i][j]; Q.push(p); sum[gra[i][j]] ++ ; } } } } void bfs() { int k,dmax; Node p,q; while ( ! Q.empty()) { q = Q.top(); Q.pop(); dmax = - 111111111 ; for (k = 0 ;k < 4 ;k ++ ) { p.vi = q.vi + dir[k][ 0 ]; p.vj = q.vj + dir[k][ 1 ]; if (p.vi >= 1 && p.vi <= m && q.vi >= 1 && q.vj <= n ) { if (gra[p.vi][p.vj] < 0 ) { if ( gra[p.vi][p.vj] + q.day >= 0 ) { p.type = q.type; p.day = q.day; gra[p.vi][p.vj] = p.type; Q.push(p); sum[p.type] ++ ; } else if (gra[p.vi][p.vj] > dmax) // 瀵繪壘鍏跺懆鍥存渶蹇紶鏌撶殑鏈哄瓙~ { dmax = gra[p.vi][p.vj] ; } } } // for(k=0;k<4;k++) } if (dmax != - 111111111 ) { q.day = dmax * ( - 1 ); Q.push(q); } }// while(!Q.empty()) } int main() { int a,T; while (cin >> m >> n) { init(); bfs(); cin >> T; while (T -- ) { scanf( " %d " , & a); printf( " %d\n " ,sum[a]); } } return 0 ; }
]]> hdu 1026 Ignatius and the Princess I http://www.shnenglu.com/Dreams/archive/2009/04/16/80102.htmlDreamSky DreamSky Wed, 15 Apr 2009 23:58:00 GMT http://www.shnenglu.com/Dreams/archive/2009/04/16/80102.html http://www.shnenglu.com/Dreams/comments/80102.html http://www.shnenglu.com/Dreams/archive/2009/04/16/80102.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/80102.html http://www.shnenglu.com/Dreams/services/trackbacks/80102.html 闃呰鍏ㄦ枃 ]]> hdu 1239 Calling Extraterrestrial Intelligence Again http://www.shnenglu.com/Dreams/archive/2009/04/11/79611.htmlDreamSky DreamSky Sat, 11 Apr 2009 11:44:00 GMT http://www.shnenglu.com/Dreams/archive/2009/04/11/79611.html http://www.shnenglu.com/Dreams/comments/79611.html http://www.shnenglu.com/Dreams/archive/2009/04/11/79611.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/79611.html http://www.shnenglu.com/Dreams/services/trackbacks/79611.html http://acm.hdu.edu.cn/showproblem.php?pid=1239
#include < iostream > #include< cmath > using namespace std; int prim[ 1230 ]; // 10000浠ュ唴鐨勭礌鏁板叡1229涓?/span>int main() { int i,j,k; // k璁板綍10000浠ュ唴绱犳暟鐨勪釜鏁?/span> bool primes[ 10000 ]; primes[ 1 ] = 0 ; for (i = 2 ;i <= 10000 ;i ++ ) primes[i] = 1 ; for (i = 2 ;i <= 5000 ;i ++ ) { if (primes[i] == 1 ) { for (j = 2 ;j * i <= 10000 ;j ++ ) primes[j * i] = 0 ; } } for (i = 1 ,k = 0 ;i <= 10000 ;i ++ ) if ( primes[i] == 1 ) prim[k ++ ] = i; int m,p,q,maxs,id,jd; while (cin >> m >> p >> q && m + p + q) { maxs = 1 ; for (i = k - 1 ;i >= 0 ;i -- ) // 绱犳暟鍊艱秺鏉ヨ秺灝?/span> { for (j = i ; j < k; j ++ ) // 绱犳暟鍊艱秺鏉ヨ秺澶?/span> { if (prim[i] * prim[j] > m || ( double )prim[i] / prim[j] < ( double )p / q ) break ; if (maxs < prim[i] * prim[j]) { maxs = prim[i] * prim[j]; id = i; jd = j; } } } cout<< prim[id] << " " << prim[jd] << endl; } return 0 ; }
]]> hdu 1072 Nightmare http://www.shnenglu.com/Dreams/archive/2009/04/11/79607.htmlDreamSky DreamSky Sat, 11 Apr 2009 11:15:00 GMT http://www.shnenglu.com/Dreams/archive/2009/04/11/79607.html http://www.shnenglu.com/Dreams/comments/79607.html http://www.shnenglu.com/Dreams/archive/2009/04/11/79607.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/79607.html http://www.shnenglu.com/Dreams/services/trackbacks/79607.html http://acm.hdu.edu.cn/showproblem.php?pid=1072
#include < iostream > #include< queue > using namespace std; struct Node { int vi,vj; int time; // 鍓╀綑鏃墮棿 int step; // 鑺辮垂鏃墮棿 } ; int gra[ 9 ][ 9 ]; int mark[ 9 ][ 9 ]; // 璧板埌i銆乯鎵鍓╀綑鐨勬椂闂?/span>int m,n,mins; int si,sj,ei,ej; int dir[ 4 ][ 2 ] = { - 1 , 0 , 1 , 0 , 0 , - 1 , 0 , 1 } ; void bfs() { int k; Node p,q; queue < Node > Q; p.step = 0 ; p.time = 6 ; p.vi = si; p.vj = sj; Q.push(p); mark[si][sj] = p.time; while ( ! Q.empty()) { q = Q.front(); Q.pop(); if (q.vi == ei && q.vj == ej) { if (q.time > 0 ) { // 璺戞帀 mins = q.step; return ; } else continue ; } if (gra[q.vi][q.vj] == 4 ) // 鏃墮棿閲嶇疆 { mark[q.vi][q.vj] = 6 ; q.time = 6 ; } for (k = 0 ;k < 4 ;k ++ ) { p.vi = q.vi + dir[k][ 0 ]; p.vj = q.vj + dir[k][ 1 ]; p.time = q.time - 1 ; p.step = q.step + 1 ; if (p.vi >= 0 && p.vi < m && p.vj >= 0 && p.vj < n && gra[p.vi][p.vj] != 0 && q.time > 0 && mark[p.vi][p.vj] < p.time) // 涓嶈秴鐣屽張涓嶆槸澧?/span> { mark[p.vi][p.vj] = p.time; Q.push(p); } } // for(k=0;k<4;k++) } // while(!Q.empty()) } int main() { int t; cin >> t; while (t -- ) { cin >> m >> n; int i,j; for (i = 0 ;i < m;i ++ ) { for (j = 0 ;j < n;j ++ ) { cin >> gra[i][j]; if (gra[i][j] == 2 ) // 璧風偣 { si = i; sj = j; } else if (gra[i][j] == 3 ) // 緇堢偣 { ei = i; ej = j; } mark[i][j] = 0 ; } } mins = 1000 ; bfs(); if (mins != 1000 ) // 閫冩帀 cout << mins << endl; else cout<<- 1 << endl; } return 0 ; }
]]> hdu 1195 Open the Lock http://www.shnenglu.com/Dreams/archive/2009/04/08/79238.htmlDreamSky DreamSky Wed, 08 Apr 2009 02:04:00 GMT http://www.shnenglu.com/Dreams/archive/2009/04/08/79238.html http://www.shnenglu.com/Dreams/comments/79238.html http://www.shnenglu.com/Dreams/archive/2009/04/08/79238.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/79238.html http://www.shnenglu.com/Dreams/services/trackbacks/79238.html 闃呰鍏ㄦ枃 ]]> zju 1047 Image Perimeters http://www.shnenglu.com/Dreams/archive/2009/04/01/78601.htmlDreamSky DreamSky Wed, 01 Apr 2009 13:31:00 GMT http://www.shnenglu.com/Dreams/archive/2009/04/01/78601.html http://www.shnenglu.com/Dreams/comments/78601.html http://www.shnenglu.com/Dreams/archive/2009/04/01/78601.html#Feedback 0 http://www.shnenglu.com/Dreams/comments/commentRss/78601.html http://www.shnenglu.com/Dreams/services/trackbacks/78601.html http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=47
#include < iostream > #include< queue > #include< string > using namespace std; struct Node { int vi; int vj; } ; string str[ 21 ]; bool mark[ 21 ][ 21 ]; int m,n,si,sj,sum; int dir[ 8 ][ 2 ] = { { - 1 , 0 } , { 1 , 0 } , { 0 , - 1 } , { 0 , 1 } , { - 1 , - 1 } , { 1 , - 1 } , { - 1 , 1 } , { 1 , 1 } } ; // 鍏釜鏂瑰悜 void bfs() { int k; Node p,q; queue < Node > Q; p.vi = si; p.vj = sj; mark[si][sj] = 1 ; Q.push(p); while ( ! Q.empty()) { q = Q.front(); Q.pop(); for (k = 0 ;k < 4 ;k ++ ) // 涓娿佷笅銆佸乏銆佸彸 { p.vi = q.vi + dir[k][ 0 ]; p.vj = q.vj + dir[k][ 1 ]; if (p.vi >= 0 && p.vi < m && p.vj >= 0 && p.vj < n) { if (str[p.vi][p.vj] == ' . ' ) sum ++ ; else if (str[p.vi][p.vj] == ' X ' && mark[p.vi][p.vj] == 0 ) { mark[p.vi][p.vj] = 1 ; Q.push(p); } } else sum++ ; } for (k = 4 ;k < 8 ;k ++ ) // 宸︿笂銆佸乏涓嬨佸彸涓娿佸彸涓?/span> { p.vi = q.vi + dir[k][ 0 ]; p.vj = q.vj + dir[k][ 1 ]; if (p.vi >= 0 && p.vi < m && p.vj >= 0 && p.vj < n) { if (str[p.vi][p.vj] == ' X ' && mark[p.vi][p.vj] == 0 ) { mark[p.vi][p.vj] = 1 ; Q.push(p); } } } } // while(!Q.empty()) } int main() { while (cin >> m >> n >> si >> sj && m + n + si + sj) { si -- ; sj -- ; int i,j; for (i = 0 ;i < m;i ++ ) cin >> str[i]; sum = 0 ; memset(mark, 0 , sizeof (mark)); bfs(); cout << sum << endl; } return 0 ; }
]]>
国产精品中文久久久久久久 |
亚洲一本综合久久 |
久久精品无码一区二区app |
中文无码久久精品 |
久久久久久久久久久久久久 |
久久精品国产2020 |
久久91精品国产91 |
亚洲乱码精品久久久久.. |
久久久无码精品亚洲日韩按摩 |
97久久久久人妻精品专区 |
88久久精品无码一区二区毛片 |
久久亚洲高清综合 |
久久久精品国产免大香伊 |
国内精品久久人妻互换 |
国产高清国内精品福利99久久 |
亚洲国产精品狼友中文久久久 |
国内精品综合久久久40p |
四虎国产永久免费久久 |
久久综合九色综合久99 |
久久精品九九亚洲精品 |
久久精品?ⅴ无码中文字幕 |
久久无码国产专区精品 |
91精品国产综合久久香蕉 |
久久精品国产亚洲av麻豆图片
|
亚洲人成网亚洲欧洲无码久久 |
青草国产精品久久久久久 |
国产真实乱对白精彩久久 |
亚洲伊人久久大香线蕉综合图片
|
九九久久99综合一区二区 |
欧美国产精品久久高清 |
久久福利青草精品资源站免费 |
香蕉久久夜色精品国产尤物 |
久久久久久久99精品免费观看 |
一本色道久久综合亚洲精品 |
久久人人超碰精品CAOPOREN
|
日本人妻丰满熟妇久久久久久 |
久久只有这精品99 |
国产精品伦理久久久久久 |
久久精品国产欧美日韩99热 |
777米奇久久最新地址 |
亚洲欧洲久久久精品 |