Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
囧……谁能告诉我建图时为什么K到C只能建成单向边?void make_graph() { for (int i = 1; i <= K + C; i++) for (int j = 1; j <= K + C; j++) if (adj[i][j] <= ans) f[i][j] = 1; else f[i][j] = 0; for (int i = 1; i <= K; i++) f[i][t] = M, f[t][i] = 0; for (int i = K + 1; i <= K + C; i++) f[s][i] = 1, f[i][s] = 0; } 这样就WA了…… void make_graph() { memset(f, 0, sizeof(f)); for (int i = K + 1; i <= K + C; i++) for (int j = 1; j <= K; j++) if (adj[i][j] <= ans) f[i][j] = 1; for (int i = 1; i <= K; i++) f[i][t] = M; for (int i = K + 1; i <= K + C; i++) f[s][i] = 1; } 这样就AC了…… Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator