Lexicographic permutations
来源:互联网 发布:excel编程用什么语言 编辑:程序博客网 时间:2024/06/05 10:17
https://projecteuler.net/problem=24
Lexicographic permutations
Problem 24
Published on Friday, 16th August 2002, 06:00 pm; Solved by 75662; Difficulty rating: 5%A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
012 021 102 120 201 210
What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
这道题懒得编程了,就纯粹靠手工计算的结果,过程如下:
9!=362880,我们要算第100万个,所以第一个数字排在第三位,也就是 2,接下来要算第274240位数 (1000000 - 9! * 2)
8!=40320,经过计算:8!*6 < 274240 < 8!*7,所以第二个数字,排在剩下数字的第7位,也就是:7,接下来算第32320位数(274240 - 8! * 6)
。
。
。
依次类推:直到剩下最后两位6和0,要求第二位数,那就是60了。
所以结果是:2783915460
用计算机算也一样,懒得写程序了
- Lexicographic permutations
- PE 24 Lexicographic permutations
- 24 Lexicographic permutations - Project Euler +
- project euler 24 Lexicographic permutations
- projecteuler---->problem=24----Lexicographic permutations
- Project Euler:Problem 24 Lexicographic permutations
- Problem 24 Lexicographic permutations (全排列)
- Problem 24 Lexicographic permutations (全排列)
- Matlab编程 Project Euler Problem24 : Lexicographic permutations
- 欧拉工程第24题:Lexicographic permutations
- Permutations
- Permutations
- Permutations
- Permutations
- Permutations
- Permutations
- Permutations
- Permutations
- 4 ASCII码排序
- [Java]double初始化问题
- java.sql.SQLException: ORA-01810: 格式代码出现两次
- VS2008升级到2013中cocos2dx出现的一些小问题
- Linux中的makefile文件
- Lexicographic permutations
- 前端神器Sublime Text 3的下载与安装
- C++处理类型
- 远程部署Maven web项目到web服务器
- IFTTT实现新浪微博完美同步Twitter
- 枚举+dijkstra(最短路删点) hdu5137How Many Maos Does the Guanxi Worth
- JeeSite(2):导入数据,进入系统
- 抽象类与接口的区别
- python获取ipv6地址