题目1038:Sum of Factorials
来源:互联网 发布:java程序员委培班 编辑:程序博客网 时间:2024/06/03 17:25
#include <iostream>#include <algorithm>#include <queue>#include <vector>#include <cstring>#include <stack>#include <string>#include <string.h>#include <stdio.h>#include <cmath>#include <map>#include <functional>#include <set>#include <limits.h>#include <math.h>#include <ctype.h>using namespace std;//1038int d[10];void init(){ d[0]=1; for(int i=1;i<10;i++) d[i]=i*d[i-1];}int main(){ int n; init(); while(cin>>n) { for(int i=9;i>=0;i--) if(n>=d[i]) n-=d[i]; if(n) cout<<"NO"<<endl; else cout<<"YES"<<endl; } return 0;}/************************************************************** Problem: 1038 User: cust123 Language: C++ Result: Accepted Time:0 ms Memory:1520 kb****************************************************************/
0 0
- 题目1038:Sum of Factorials
- 题目1038:Sum of Factorials
- 题目1038:Sum of Factorials
- 题目1038:Sum of Factorials
- 题目1038:Sum of Factorials
- 题目1038:Sum of Factorials 九度
- 贪心法_题目1038:Sum of Factorials
- 九度oj 题目1038:Sum of Factorials
- 九度OJ题目1038:Sum of Factorials
- 九度 oj 题目1038:Sum of Factorials
- 九度OJ 1038 Sum of Factorials
- 九度oj-1038-Sum of Factorials
- 九度[1038]-Sum of Factorials
- Sum of Factorials
- Sum of Factorials
- Sum of Factorials
- Sum of Factorials zoj
- poj1775 - Sum of Factorials
- 集合类总结
- Intent和PendingIntent的区别
- Java Object and Class基本
- Log4j使用
- Android中pendingIntent的深入理解
- 题目1038:Sum of Factorials
- 使用LinkedHashMap构建LRU的Cache
- Android LayoutInflater详解
- 谈layout_gravity和gravity的用法
- shell脚本数组报错Syntax error: "(" unexpected
- Spring AOP实现(以log管理为例)
- 数据结构总结
- android Handler post sendMessage
- annot refer to a non-final variable * inside an inner class defined in a different method"错误解析