锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品国产99久久无毒不卡
,久久久久国产亚洲AV麻豆,精品无码久久久久国产动漫3d 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 ; }
]]>
亚洲国产精品久久电影欧美 |
99久久精品费精品国产一区二区
|
亚洲欧美国产精品专区久久 |
99久久亚洲综合精品成人 |
伊人久久免费视频 |
精品伊人久久久 |
国产成人综合久久综合 |
久久精品国产精品亜洲毛片 |
久久精品亚洲AV久久久无码 |
久久国产乱子精品免费女 |
久久久久亚洲AV无码专区桃色 |
亚洲伊人久久大香线蕉综合图片 |
久久免费国产精品一区二区 |
久久综合鬼色88久久精品综合自在自线噜噜
|
91精品国产91久久 |
无码八A片人妻少妇久久 |
久久国产精品一区二区 |
久久狠狠爱亚洲综合影院 |
国产农村妇女毛片精品久久 |
精品久久久久久无码中文字幕一区
|
无码乱码观看精品久久 |
久久免费高清视频 |
久久久一本精品99久久精品88 |
国产高潮国产高潮久久久91 |
国产成人无码久久久精品一 |
99久久夜色精品国产网站
|
久久精品国产亚洲av麻豆蜜芽
|
久久人人爽人人爽人人片AV东京热 |
久久久老熟女一区二区三区 |
久久人人爽人人爽人人爽 |
亚洲午夜精品久久久久久app |
99久久亚洲综合精品成人 |
97精品国产91久久久久久 |
久久精品国产色蜜蜜麻豆 |
国产精品久久久久a影院 |
香港aa三级久久三级老师2021国产三级精品三级在
|
亚洲精品无码久久不卡 |
久久亚洲国产精品五月天婷 |
久久免费国产精品 |
综合久久久久久中文字幕亚洲国产国产综合一区首
|
国产精品xxxx国产喷水亚洲国产精品无码久久一区
|