摘要: StarsTime Limit:1000MSMemory Limit:65536KTotal Submissions:29602Accepted:12924DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the 阅读全文
posted @ 2014-03-07 16:46 ~~Snail~~ 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Numbering PathsBackgroundProblems that process input and generate a simple ``yes'' or ``no'' answer are called decision problems. One class of decision problems, the NP-complete problems, are not amenable to general efficient solutions. Other problems may be simple as decision proble 阅读全文
posted @ 2014-03-07 16:11 ~~Snail~~ 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #define MAX_V 10050 4 5 int V,E; //V表示顶点数,E表示边数(顶点标号为0~V-1) 6 vector G[MAX_V]; //图的邻接表表示 7 vector rG[MAX_V]; //把边反向后的图 8 vector vs; //后序遍历顺序的顶点列表(即用一个栈模拟了回溯时的标号) 9 bool used[MAX_V]; //DFS中用到的访问标记10 int cmp[MAX_V]; //顶点所属强连... 阅读全文
posted @ 2014-03-07 12:04 ~~Snail~~ 阅读(229) 评论(0) 推荐(0) 编辑
摘要: Popular CowsTime Limit:2000MSMemory Limit:65536KTotal Submissions:21685Accepted:8852DescriptionEvery cow's dream is to become the most popular cow in the herd. In a herd of N (1 2 #include 3 #include 4 #include 5 #define MAX_V 10050 6 7 using namespace std; 8 9 int V,E; 10 vector G[MAX_V]... 阅读全文
posted @ 2014-03-07 11:52 ~~Snail~~ 阅读(272) 评论(0) 推荐(0) 编辑