hdu 4985(模拟)】的更多相关文章

Little Pony and Permutation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 639    Accepted Submission(s): 342 Problem Description As a unicorn, the ability of using magic is the distinguishing…
http://acm.hdu.edu.cn/showproblem.php?pid=4891 给出一个文本,问说有多少种理解方式. 1. $$中间的,(s1+1) * (s2+1) * ...*(sn+1), si表示连续的空格数. 2.{}中间,即 | 的个数+1. 就是模拟 #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <…
http://acm.hdu.edu.cn/showproblem.php?pid=5012 模拟出骰子四种反转方式,bfs,最多不会走超过6步 #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <string> #include <queue> #include <vector> #include <i…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4985 题目意思:有 n 个数,对于第 i 个数给出 σ(i) 的值.求出互不相交的循环的个数,并输出每个循环包含的数字. 还是不太懂吧?反正比赛的时候我也没看懂 >__< ! 据说,这条题目用到了置换群 + 循环 的知识,黑书上 P246 有相应介绍. 先来说明下这幅图的意思,搞明白题意就发现这条题是很好做的. 它表示:σ(1) = 2, σ(2) = 5, σ(3) = 4, σ(4) = 3,…
思路: 主要就是模拟这些操作,用链表果断超时.改用堆栈模拟就过了 #include<map> #include<set> #include<stack> #include<cmath> #include<queue> #include<cstdio> #include<vector> #include<string> #include<cstdlib> #include<cstring>…
The Donkey of Gui Zhou Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 389    Accepted Submission(s): 153 Problem Description There was no donkey in the province of Gui Zhou, China. A trouble m…
题目链接 模拟题,直接看代码. £:分数的计算方法,要用double; #include <set> #include <map> #include <cmath> #include <queue> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef…
http://acm.hdu.edu.cn/showproblem.php?pid=5003 记得排序后输出 #include <cstdio> #include <cstring> #include <iostream> #include <string> #include <vector> #include <set> #include <map> #include <algorithm> #include…
http://acm.hdu.edu.cn/showproblem.php?pid=5033 平面上有n个建筑,每个建筑由(xi,hi)表示,m组询问在某一个点能看到天空的视角范围大小. 维护一个凸包,据说可以用单调栈 #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <string> #include <set> #in…
Regroup Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1057    Accepted Submission(s): 297 Problem Description When ALPC42 got to a panzer brigade, He was asked to build software to help them r…