上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 23 下一页
摘要: http://acm.sdibt.edu.cn/JudgeOnline/problem.php?id=3237Problem H:Boring CountingTime Limit: 3 Sec Memory Limit: 128 MB Submit: 8 Solved: 4 [Submit][Status][Discuss]DescriptionIn this problem you are given a number sequence P consisting of N integer and Pi is the ith element in the sequence. Now you 阅读全文
posted @ 2013-08-15 14:28 crazy_apple 阅读(578) 评论(0) 推荐(0) 编辑
摘要: 2013年"浪潮杯"山东省第四届ACM大学生程序设计竞赛排名:http://acm.upc.edu.cn/ranklist/一、第J题坑爹大水题,模拟一下就行了J:Contest Print Server【题解】: 题目大意:输入n,s,x,y,mod 分别队伍数n,还有一个s生成函数 s=((s*x)+y)%mod,就是打印机根据要求打印纸张,打印到s时,打印机将重置,生成新的s【code】: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 int t; 9 ... 阅读全文
posted @ 2013-08-14 11:32 crazy_apple 阅读(353) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3522Slim SpanTime Limit:5000MSMemory Limit:65536KTotal Submissions:5666Accepted:2965DescriptionGiven an undirected weighted graphG, you should find one of spanning trees specified as follows.The graphGis an ordered pair (V,E), whereVis a set of vertices {v1,v2, …,vn} andEis 阅读全文
posted @ 2013-08-13 10:48 crazy_apple 阅读(406) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1236Network of SchoolsTime Limit:1000MSMemory Limit:10000KTotal Submissions:9481Accepted:3767DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distribut 阅读全文
posted @ 2013-08-12 17:08 crazy_apple 阅读(258) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2762Going from u to v or from v to u?Time Limit:2000MSMemory Limit:65536KTotal Submissions:12733Accepted:3286DescriptionIn order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time, 阅读全文
posted @ 2013-08-11 20:23 crazy_apple 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 题目地址:http://poj.org/problem?id=2553The Bottom of a GraphTime Limit:3000MSMemory Limit:65536KTotal Submissions:7881Accepted:3263DescriptionWe will use the following (standard) definitions from graph theory. LetVbe a nonempty and finite set, its elements being called vertices (or nodes). LetEbe a subs 阅读全文
posted @ 2013-08-10 18:00 crazy_apple 阅读(256) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2186Popular CowsTime Limit:2000MSMemory Limit:65536KTotal Submissions:20191Accepted:8193DescriptionEvery cow's dream is to become the most popular cow in the herd. In a herd of N (1 7 #include 8 #include 9 #include 10 #include 11 #include 12 13 #define N 10010 14 using. 阅读全文
posted @ 2013-08-10 17:16 crazy_apple 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 #define N 1000 9 10 using namespace std;11 12 int pre[N],lowlink[N],sccno[N],dfn_clock,scc_cnt;13 14 stack stk;15 16 vector G[N];17 18 void DFN(int u)19 {20 pre[u] = lowlink[u] = ++dfn_clock; //时间戳21 stk.push(u);22 ... 阅读全文
posted @ 2013-08-10 11:50 crazy_apple 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 有向图强连通分量的Tarjan算法[有向图强连通分量]在有向图G中,如果两个顶点间至少存在一条路径,称两个顶点强连通(strongly connected)。如果有向图G的每两个顶点都强连通,称G是一个强连通图。非强连通图有向图的极大强连通子图,称为强连通分量(strongly connected components)。下图中,子图{1,2,3,4}为一个强连通分量,因为顶点1,2,3,4两两可达。{5},{6}也分别是两个强连通分量。直接根据定义,用双向遍历取交集的方法求强连通分量,时间复杂度为O(N^2+M)。更好的方法是Kosaraju算法或Tarjan算法,两者的时间复杂度都是O(N 阅读全文
posted @ 2013-08-10 11:48 crazy_apple 阅读(192) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3013Big Christmas TreeTime Limit:3000MSMemory Limit:131072KTotal Submissions:19009Accepted:4048DescriptionChristmas is coming to KCM city. Suby the loyal civilian in KCM city is preparing a big neat Christmas tree. The simple structure of the tree is shown in right picture. 阅读全文
posted @ 2013-08-09 18:46 crazy_apple 阅读(303) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 23 下一页