`
yangliuy
  • 浏览: 65067 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

POJ 1207 求最大数链长度 暴力枚举数学题

 
阅读更多

这个题目直接用的暴力枚举,但是还是WA了几次

原因是这句话You should process all pairs of integers and for each pair determine the maximum cycle length over all integers between and including i and j.

注意i可能大于j,此时需要交换顺序,但是输出的时候还会是原始顺序

比如 输入1 10 输出 1 10 20 ;输入10 1 输出 10 1 20

因此交换i和j需要用标志位记录一下

Source Code

Problem: 1207 User: yangliuACMer
Memory: 244K Time: 16MS
Language: C++ Result: Accepted


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics