Pro.ID10205 TitleAll Latin Squares Title链接http://10.20.2.8/oj/exercise/problem?problem_id=10205 AC2 Submit4 Ratio50.00% 时间&空间限制描述A square arrangement of numbers 1 2 3 4 5 is a 5 × 5 Latin Square because each whole number from 1 to 5 appears once and only once in each row and column. Write a program that will compute the number of N × N Latin Squares whose first row is: 1 2 3 4 5.......N Your program should work for any N from 2 to 7. 输入One line containing the integer N. 输出Description A square arrangement of numbers 1 2 3 4 5 is a 5 × 5 Latin Square because each whole number from 1 to 5 appears once and only once in each row and column. Write a program that will compute the number of N × N Latin Squares whose first row is: 1 2 3 4 5.......N Your program should work for any N from 2 to 7. Input One line containing the integer N. Output A single integer telling the number of latin squares whose first row is 1 2 3 ... N. Sample Input 5 Sample Output 1344 Source 样例输入5 样例输出1344 作者 |