题意:给你一条字符串,让你输出字符串中字符的全排列,输出的顺序要按它给的奇葩的字典序. 题解:要输出全排列,暴力dfs可以过,但要注意题目的字典序以及相同字符的情况.如果用next_permutation()处理可以简单很多:我是先将字典序"A a B b...Z z"的每个字母赋予一个值,即从1 2 3...52.然后将给的字符串全部转换成对应的数值后,用next_permutation()进行全排列(当然 题目给的字典序有一定规律,所以也可以直接给next_permutation(…
Anagram Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18393 Accepted: 7484 Description You are to write a program that has to generate all possible words from a given set of letters. Example: Given the word "abc", your program shoul…
SudoKu Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu POJ 2676 Description Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the c…