Acm之DFS
Aelsy
努力变成一个优秀的程序员
展开
-
Joke with permutation
此题,题意应该好理解,我在这里用的是DFS(优先深度搜索)这里的mark变量相当重要#include #include #include #include using namespace std;const int maxn = 100001;int len;int mark;int vis[maxn];char s[maxn];void dfs(int n){ if(n原创 2015-08-03 23:55:17 · 776 阅读 · 0 评论 -
[HDU1016]Prime Ring Problem
Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime原创 2015-08-04 22:59:37 · 432 阅读 · 0 评论 -
[HDU1011]-Starship Troopers
Starship TroopersTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionYou, the leader of 星级队员Troopers, are sent to destroy a base of the bug原创 2016-08-18 15:48:59 · 336 阅读 · 0 评论