UVA10916- Factstone Benchmark
来源:互联网 发布:js获取当前日期 编辑:程序博客网 时间:2024/06/14 20:24
计算 n的最大值,2^n>n!,如果一直整数相乘的话,会越界,所以要取对数。
#include<stdio.h>#include<math.h>#include<algorithm>using namespace std;int main(){int n, i;double m, sum;while (scanf("%d", &n) && n){m = pow(2, (n - 1940) / 10) * log(2);sum = 0;for(int i = 1; ; i++){sum += log(i);if (sum > m){printf("%d\n", i - 1);break;}}}return 0;}
- UVA10916- Factstone Benchmark
- UVA10916 Factstone Benchmark
- uva10916 Factstone Benchmark
- Factstone Benchmark
- Factstone Benchmark
- Factstone Benchmark
- Factstone Benchmark
- Factstone Benchmark
- Factstone Benchmark
- UVa 10916 Factstone Benchmark
- hdu 1141 Factstone Benchmark
- 1119. Factstone Benchmark
- poj2661 Factstone Benchmark
- uva 10916 Factstone Benchmark
- UVA 10916 - Factstone Benchmark
- UVa 10916 - Factstone Benchmark
- uva 10916 - Factstone Benchmark
- uva-10916 - Factstone Benchmark
- UVA10719- Quotient Polynomial
- Maya: 菜单 编辑网格 >移除选定对象
- hdu1358(KMP+最小循环节)
- Maya: 菜单 编辑网格 >移除全部
- Maya: 菜单 编辑网格 >折痕集
- UVA10916- Factstone Benchmark
- Hibernate懒加载深入分析
- 关于考研的一些复习视屏
- Maya: 菜单 编辑网格 >指定不可见面
- remoting与socket、webservice和wcf的比较及优势
- 设计模式学习笔记
- hdu——1711——Number Sequence
- 禁止Windows7系统自动安装驱动程序
- HDU:3953 I'll play a trick on you