ural 1014 Product of Digits
来源:互联网 发布:淘宝客乱扣佣金怎么办 编辑:程序博客网 时间:2024/04/29 02:58
首先面对此题,最不该做的就是暴搜. U no it.
于是我们想到桶!
首先质因数分解(2,3,5,7), 如果n>1直接output -1.
然后我们就要把桶里面的数的个数压缩.
8=2*2*2 当然首当其冲.
然后是 9=3*3
然后是 6=2*3
然后是 4=2*2
这么做是对的, 不过一直感觉说不太明白, Wittgenstein告诉我们: 沉默.
然后就可以提交了.
如果你真的照上面做了, 而且确保没错, 那么恭喜你, WA#3.
不要重做. 我们只是漏掉了两个神级整数:
0 -> 10
1 -> 1
这样就AC了.
- ural 1014 Product of Digits
- URAL 1014 Product of Digits
- 10 URAL 1014 Product of Digits
- Ural 1014 Product of Digits 解题报告
- ural 1014 the product of digits
- URAL 1014 Product of Digits 贪心
- Ural-1014. Product of Digits(简单题)
- ural 1014. Product of Digits贪心
- (贪心5.2.6)URAL 1014 Product of Digits(利用数据有序化进行贪心选择)
- 1014. Product of Digits
- 993 - Product of digits
- 993 - Product of digits
- Ural1014-Product of Digits
- uva993 Product of digits
- 1014. Product of Digits
- Ural 1658 Sum of Digits
- ural 1658. Sum of Digits
- URAL 1658. Sum of Digits
- UVa OJ 10929-You can say 11
- 视频收集
- Hibernate连接Oracle10g之hibernate.cfg.xml
- 位运算符的应用的总结
- 准备建立一套完善的企业级应用,有兴趣的进来看看,欢迎探讨
- ural 1014 Product of Digits
- UVa OJ 10008-What's Cryptanalysis?
- eclipse开发android,添加源码
- Topcoder SRM200
- 2009-2010年中国嵌入式开发从业人员调查报告
- 在这个安静的晚上,在这个不该矫情的地方
- 无题
- HDU 1007
- 不能从其他机器访问RHEL5.5上的tomcat6