poj 2013 Symmetric Order 解题报告】的更多相关文章

题目链接:http://poj.org/problem?id=2013 设长度非递减的字串序列为s[1]...s[n].设计递归子程序print(n),其中n为字串序号,每分析1个字串,n=n-1. n = 0 为边界.字串s为局部变量: 先输入和输出当前组的第1个字串s,n = n - 1: 若n > 0,则输入当前组的第2个字符s,n = n - 1.若n > 0,则通过递归调用print(n)将字串s入栈.回溯过程相当于栈顶字串s出栈,因此直接输出s. #include <iost…
1.链接地址: http://bailian.openjudge.cn/practice/2013 http://poj.org/problem?id=2013 2.题目: Symmetric Order Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 11793   Accepted: 7181 Description In your job at Albatross Circus Management (yes, it…
 http://blog.csdn.net/geniusluzh/article/details/6619575 在说Tarjan算法解决桥和边双连通分量问题之前我们先来回顾一下Tarjan算法是如何求解强连通分量的. Tarjan算法在求解强连通分量的时候,通过引入dfs过程中对一个点访问的顺序dfsNum(也就是在访问该点之前已经访问的点的个数)和一个点可以到达的最小的dfsNum的low数组,当我们遇到一个顶点的dfsNum值等于low值,那么该点就是一个强连通分量的根.因为我们在dfs的…
题目大意:给定一个4位素数,一个目标4位素数.每次变换一位,保证变换后依然是素数,求变换到目标素数的最小步数. 解题报告:直接用最短路. 枚举1000-10000所有素数,如果素数A交换一位可以得到素数B,则在AB间加入一条长度为1的双向边. 则题中所求的便是从起点到终点的最短路.使用Dijkstra或SPFA皆可. 当然,纯粹的BFS也是可以的. 用Dijkstra算法A了题目之后,看了一下Discuss,发现了一个新名词,双向BFS. 即从起点和终点同时进行BFS,相遇则求得最短路. 借鉴了…
    487-3279 Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 228365   Accepted: 39826 Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or p…
题目地址: http://poj.org/problem?id=2376 题目内容: Cleaning Shifts Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12226   Accepted: 3187 Description Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores arou…
题目地址: http://poj.org/problem?id=1611 题目内容: The Suspects Time Limit: 1000MS   Memory Limit: 20000K Total Submissions: 24253   Accepted: 11868 Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recogni…
题目地址: http://poj.org/problem?id=2524 题目内容: Ubiquitous Religions Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 26119   Accepted: 12859 Description There are so many different religions in the world today that it is difficult to keep tra…
题目地址: http://poj.org/problem?id=3009 题目内容: Curling 2.0 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 13042   Accepted: 5478 Description On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are…
    Exponentiation Time Limit: 500MS   Memory Limit: 10000K Total Submissions: 126980   Accepted: 30980 Description Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of t…