摘要: Description大家都知道最小生成树一般求的是构成最小生成树的边的权值之和。现在请求构成最小生成树的边的权值之积 S,最终结果请输出 (S % 100003)。P.S. 点之间的边为无向边,矩阵保证符合无向图的对称性。Input多组数据。第一行,整数N,表示N个点。(0 2 #include 3 using namespace std; 4 5 #define MAX 105 6 #define INF 0x7FFFFFFF 7 int map[MAX][MAX]; // adjacency matrix 8 bool vis[MAX]; // is the node i vis... 阅读全文
posted @ 2014-01-04 20:54 Joyee 阅读(2135) 评论(0) 推荐(0) 编辑
摘要: ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionThere are N cities and N-1 roads in Magic-Island. You can go from one city to any other. One road only connects two cities. One day, The king of magic-island want to visit the island from the capital. No road is visited twice. Do you know 阅读全文
posted @ 2014-01-04 17:39 Joyee 阅读(1330) 评论(0) 推荐(0) 编辑