UVa 305: precalcuate, they are only 14
UVa 156: set for ordered strings, map for keys
UVa 195: next_permutation with own compare function
UVa 11221: look transpose matrix on both directions