摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 bool cmp(string a,string b) 7 { 8 return a+b>b+a; 9 }10 11 void solve(int n)12 {13 string a[100];14 for(int i=0;i>a[i];17 }18 19 sort(a,a+n,cmp);20 for(int i=0;i>n && n)32 {33 solve(n);34 }35 36 ... 阅读全文
posted @ 2013-12-23 23:54 doubleshik 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 利用set 进行判断重复, 可以用dfs 因为只有11步。 我这里用了bfs题目:Problem DKnights in FENInput: standard inputOutput: standard outputTime Limit: 10 secondsThere are black and white knights on a 5 by 5 chessboard. There are twelve of each color, and there is one square that is empty. At any time, a knight can move into an em 阅读全文
posted @ 2013-12-23 15:06 doubleshik 阅读(247) 评论(0) 推荐(0) 编辑