锘??xml version="1.0" encoding="utf-8" standalone="yes"?>91久久福利国产成人精品,蜜桃麻豆www久久国产精品,日韩人妻无码一区二区三区久久
http://www.shnenglu.com/notonlysuccess/archive/2009/11/08/91589.html#100383Etfl Etfl Sat, 07 Nov 2009 16:35:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/11/08/91589.html#100383 ]]>re: 紲炲鐨勮垶韞垀~Dancing_Links http://www.shnenglu.com/notonlysuccess/archive/2009/09/08/89701.html#95613why why Tue, 08 Sep 2009 13:29:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/09/08/89701.html#95613 ]]>re: 紲炲鐨勮垶韞垀~Dancing_Links http://www.shnenglu.com/notonlysuccess/archive/2009/09/07/89701.html#95488why why Mon, 07 Sep 2009 13:44:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/09/07/89701.html#95488 鎴戣嚜宸變篃妯′豢鐫鍐欎簡涓?浣嗕竴鐩碩LE
鑳藉惁鍊熶綘瀹屾暣鐨勪唬鐮佸涔犲涔犲憿~
榪欐槸鎴戠殑閭:
weihaoo2@163.com
璋㈣阿鍟妦
]]> re: 姒傜巼棰樻繪眹 http://www.shnenglu.com/notonlysuccess/archive/2009/08/29/83367.html#94769ACMer ACMer Sat, 29 Aug 2009 08:25:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/29/83367.html#94769 #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
const int MAXN = 20;
struct point_T {
int x, y;
};
point_T st, ed[MAXN * MAXN];
char map[MAXN][MAXN];
int board[MAXN][MAXN];
int row, col, cnt;
double mat[MAXN * MAXN][MAXN * MAXN];
int dir[4][2] = { {1, 0}, {-1, 0}, {0, -1}, {0, 1} };
bool ok(int x, int y) {
return x >= 0 && x < row && y >= 0 && y < col && (map[x][y] == '@' || map[x][y] == '.' || map[x][y] == '$');
}
void floodfill(int x, int y) {
board[x][y] = ++ cnt;
for(int i = 0; i < 4; i ++) {
int tx = x + dir[i][0];
int ty = y + dir[i][1];
if(ok(tx, ty) && board[tx][ty] == -1) {
floodfill(tx, ty);
}
}
}
bool gauss(int n) {
int i, j, row, idx;
double buf, maxx;
for(row = 0; row < n; row ++) {
for(maxx = 0, i = row; i < n; i ++) {
if(maxx < fabs(mat[i][row])) {
maxx = fabs(mat[i][row]);
idx = i;
}
}
if(maxx == 0) return false;
if(idx != row) {
for(i = row; i <= n; i ++)
swap(mat[row][i], mat[idx][i]);
}
for(i = row + 1; i < n; i ++) {
buf = mat[i][row] / mat[row][row];
for(j = row; j <= n; j ++)
mat[i][j] -= buf * mat[row][j];
}
}
for(i = n - 1; i >= 0; i --) {
for(j = i + 1; j < n; j ++)
mat[i][n] -= mat[i][j] * mat[j][j];
mat[i][i] = mat[i][n] / mat[i][i];
}
return true;
}
int main() {
int i, j, k, l, cn;
while(scanf("%d%d", &row, &col) != EOF) {
cn = 0;
for(i = 0; i < row; i ++) {
scanf("%s", map[i]);
for(j = 0; j < col; j ++) {
if(map[i][j] == '@') {
st.x = i;
st.y = j;
}else if(map[i][j] == '$') {
ed[cn].x = i;
ed[cn].y = j;
cn ++;
}
}
}
memset(board, -1, sizeof(board));
cnt = -1;
floodfill(st.x, st.y);
for(i = 0; i < cn; i ++) {
if(board[ed[i].x][ed[i].y] != -1)
break;
}
if(i == cn) {
printf("-1\n");
continue;
}
memset(mat, 0, sizeof(mat));
int now, tx, ty, num;
for(i = 0; i < row; i ++) {
for(j = 0; j < col; j ++) {
if(board[i][j] != -1) {
now = board[i][j];
num = 0;
for(k = 0; k < 4; k ++) {
tx = i + dir[k][0];
ty = j + dir[k][1];
if(ok(tx, ty)) {
num ++;
mat[now][board[tx][ty]] = -1;
}
mat[now][now] = num;
mat[now][cnt + 1] = num;
}
}
}
}
for(i = 0; i < cn; i ++) {
l = board[ed[i].x][ed[i].y];
memset(mat[l], 0, sizeof(mat[l]));
mat[l][l] = 1;
}
if(gauss(cnt + 1))
printf("%.6lf\n", mat[board[st.x][st.y]][board[st.x][st.y]]);
else
printf("-1\n");
}
return(0);
}
]]> re: 姒傜巼棰樻繪眹 http://www.shnenglu.com/notonlysuccess/archive/2009/08/29/83367.html#94768ACM ACM Sat, 29 Aug 2009 08:21:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/29/83367.html#94768 ==> (a + b)E[n] - aE[n-1] - bE[n + 1] = 0;
==>涓轟粈涔堝湪寤哄騫跨煩闃墊椂鏄痬at[i][i - 1] = -b, mat[i][i + 1] = -a,mat[i][i] = a + b; 鑰屼笉鏄痬at[i][i - 1] = -a, mat[i][i + 1] = -b, mat[i][i] = a + b; ]]> re: 姒傜巼棰樻繪眹 http://www.shnenglu.com/notonlysuccess/archive/2009/08/20/83367.html#93910lxghost lxghost Thu, 20 Aug 2009 06:52:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/20/83367.html#93910 ]]>re: 紲炲鐨勮垶韞垀~Dancing_Links http://www.shnenglu.com/notonlysuccess/archive/2009/08/18/89701.html#93699鍌誨唇 鍌誨唇 Tue, 18 Aug 2009 05:47:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/18/89701.html#93699 鏈夌殑鍟妦鍒濆鐨勬椂鍊欏S榪涜浜嗚祴鍊紐榪欎釜S杈懼埌涓涓緢寮虹殑鍓灊鐨勫憿 ]]>re: 紲炲鐨勮垶韞垀~Dancing_Links http://www.shnenglu.com/notonlysuccess/archive/2009/08/17/89701.html#93648acmer acmer Mon, 17 Aug 2009 14:06:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/17/89701.html#93648 ]]>re: 鍗婂勾AC鐢熸動錛屼粎浠ユ鏂囩邯蹇?/title> http://www.shnenglu.com/notonlysuccess/archive/2009/08/12/80162.html#92995cs cs Wed, 12 Aug 2009 02:28:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/12/80162.html#92995 ]]> re: 鍗婂勾AC鐢熸動錛屼粎浠ユ鏂囩邯蹇?/title> http://www.shnenglu.com/notonlysuccess/archive/2009/08/09/80162.html#92712WACow WACow Sun, 09 Aug 2009 08:31:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/09/80162.html#92712 ]]> re: 鍗婂勾AC鐢熸動錛屼粎浠ユ鏂囩邯蹇?/title> http://www.shnenglu.com/notonlysuccess/archive/2009/08/09/80162.html#92711SiNZeRo SiNZeRo Sun, 09 Aug 2009 08:25:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/09/80162.html#92711 ]]> re: 鍗婂勾AC鐢熸動錛屼粎浠ユ鏂囩邯蹇礫鏈櫥褰昡 http://www.shnenglu.com/notonlysuccess/archive/2009/08/07/80162.html#92493鏉?/dc:creator>鏉?/author>Fri, 07 Aug 2009 01:47:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/07/80162.html#92493 ]]> re: 紲炲鐨勮垶韞垀~Dancing_Links http://www.shnenglu.com/notonlysuccess/archive/2009/08/05/89701.html#92358鍌誨唇 鍌誨唇 Wed, 05 Aug 2009 14:14:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/05/89701.html#92358 鍏跺疄鍏抽敭鍦ㄤ簬寤哄浘鐨勮繃縐皛~涓婅竟閭d釜妯℃澘鍏跺疄閫熷害宸埆涓嶆槸寰堝ぇ ]]>re: 2009.2.10灝忚 http://www.shnenglu.com/notonlysuccess/archive/2009/08/05/73421.html#92281zxz zxz Wed, 05 Aug 2009 06:29:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/05/73421.html#92281 ]]>re: PKU鈥斺擠P涓撹緫 http://www.shnenglu.com/notonlysuccess/archive/2009/08/04/91589.html#92198zhuweicong zhuweicong Tue, 04 Aug 2009 10:40:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/08/04/91589.html#92198 ]]>re: 紲炲鐨勮垶韞垀~Dancing_Links http://www.shnenglu.com/notonlysuccess/archive/2009/07/30/89701.html#91670howie howie Thu, 30 Jul 2009 01:49:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/07/30/89701.html#91670 浣犵殑涓轟粈涔堥偅涔堝揩鍛紵璇烽棶鍋氫簡浠涔堜紭鍖?
]]> re: 紲炲鐨勮垶韞垀~Dancing_Links http://www.shnenglu.com/notonlysuccess/archive/2009/07/16/89701.html#90270majia majia Thu, 16 Jul 2009 11:21:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/07/16/89701.html#90270 ]]>re: HDOJ1074~~Doing Homework瑙i鎶ュ憡 http://www.shnenglu.com/notonlysuccess/archive/2009/07/10/74168.html#89716sh菐宕?/dc:creator>sh菐宕?/author>Fri, 10 Jul 2009 02:46:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/07/10/74168.html#89716 榪欓噷娌℃湁浠g爜鏍煎紡 鑷繁澶嶅埗ALT + F8涓涓?br> #include<stdio.h> #include<string> #define Min(a,b) a>b?b:a struct DP{ int score; int next; int time; }dp[32768]; struct Homework{ int deadlion,time; char name[101]; }hw[15]; char ans[15][101]; int n; void dfs(int k) { int i,min,cnt,time,d=k,id,score,next,t; char ch[16]; memset(ch,'0',sizeof(ch)); i = 14; d = k; cnt = 0; ch[15] = 0; while(d) { if(d&1) { cnt += d&1; ch[i] = (d&1) + '0'; id = i;//濡傛灉鍙湁涓涓?錛宨d鍙互璁板綍涓?鐨勪綅瀛?br>} i --; d >>= 1; }//杞寲鎴愪簩榪涘埗 if(cnt == 1)//鏈搴曚笅鐨勬儏鍐?鍙畬鎴愪簡涓縐嶄綔涓?br>{ id = 14 - id; if(hw[id].deadlion >= hw[id].time) dp[k].score = 0; else dp[k].score = hw[id].time - hw[id].deadlion; dp[k].time = hw[id].time; dp[k].next = id; return ; } min = 0x7FFFFFFF; for(i=0;i<15;i++) { if(ch[i]=='1') { id = 14 - i; int kk = k - (1<<id); if(dp[kk].time == -1) dfs(kk); time = dp[kk].time + hw[id].time; score = dp[kk].score; if(hw[id].deadlion < time) score += (time-hw[id].deadlion); if(score < min || score == min && strcmp(hw[id].name,hw[next].name)<0) { if(score<min) next = id; min = score; t = time; } } } dp[k].score = min; dp[k].next = next; dp[k].time = t; } int main() { int T,i,k; scanf("%d",&T); while (T--) { scanf("%d",&n); k = (1<<n)-1;//涓鍏辨湁榪欎箞澶氬彲鑳?br>for(i=0;i<=k;i++) dp[i].time = -1; for(i=0;i<n;i++) scanf("%s%d%d",hw[i].name,&hw[i].deadlion,&hw[i].time); dfs(k); printf("%d\n",dp[k].score); //杈撳嚭鍚嶅瓧 for(i=0;i<n;i++) { strcpy(ans[i],hw[ dp[k].next ].name); k = k - (1<<(dp[k].next)); } for(i=n-1;i>=0;i--) puts(ans[i]); } return 0; } ]]> re: HDOJ1074~~Doing Homework瑙i鎶ュ憡[鏈櫥褰昡 http://www.shnenglu.com/notonlysuccess/archive/2009/07/09/74168.html#89603ac ac Thu, 09 Jul 2009 02:37:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/07/09/74168.html#89603 楹葷儲璐翠笅
鍦ㄧ嚎鐙傜瓑 ]]> re: 鍗婂勾AC鐢熸動錛屼粎浠ユ鏂囩邯蹇礫鏈櫥褰昡 http://www.shnenglu.com/notonlysuccess/archive/2009/07/07/80162.html#89480铚楃墰 铚楃墰 Tue, 07 Jul 2009 10:59:00 GMT http://www.shnenglu.com/notonlysuccess/archive/2009/07/07/80162.html#89480 鍏勫紵瀵笰CM鐨勭簿紲炲拰鎬佸害璁╂垜鏁僵! ]]>
伊人久久大香线焦AV综合影院 |
国产精品久久久久久久久鸭 |
精品国产婷婷久久久 |
久久丝袜精品中文字幕 |
久久人人添人人爽添人人片牛牛
|
99久久亚洲综合精品网站 |
一级做a爰片久久毛片16 |
久久这里只有精品视频99 |
欧美丰满熟妇BBB久久久 |
久久中文精品无码中文字幕 |
蜜臀av性久久久久蜜臀aⅴ麻豆
|
欧美亚洲国产精品久久久久 |
久久精品欧美日韩精品 |
久久久久婷婷 |
99久久99久久 |
久久丫精品国产亚洲av |
午夜视频久久久久一区 |
91精品国产综合久久香蕉 |
波多野结衣AV无码久久一区 |
久久精品国产一区二区三区不卡 |
久久久无码精品亚洲日韩按摩
|
日韩久久无码免费毛片软件 |
九九久久99综合一区二区 |
国产美女亚洲精品久久久综合 |
久久高清一级毛片 |
精品久久香蕉国产线看观看亚洲 |
久久午夜福利无码1000合集 |
久久九九免费高清视频 |
国内精品久久久久久久涩爱 |
久久r热这里有精品视频 |
亚洲AV日韩精品久久久久 |
亚洲精品无码久久久 |
久久久不卡国产精品一区二区 |
91精品国产色综久久 |
99久久www免费人成精品 |
久久婷婷久久一区二区三区 |
久久美女人爽女人爽 |
99久久国产综合精品五月天喷水
|
伊人丁香狠狠色综合久久 |
av无码久久久久不卡免费网站 |
久久精品无码午夜福利理论片 |