# include <queue>
# include <cstdio>
# include <cstring>
# include <iostream>
# include <algorithm>
using namespace std; int v[4] = {1,10,100,1000},a[100000]; struct BigNumber{
int d[1000];
BigNumber() { memset(d,0,sizeof(d)); d[0] = 1; }
BigNumber operator =(const int b){
char s[40];
sprintf(s,"%d",b);
int len = strlen(s);
memset(d,0,sizeof(d));
d[0] = (len - 1)/4 + 1;
for(int i = 0;i < len;i++) d[(len-i-1)/4+1] += (s[i]-'0')*v[(len-i-1)%4];
return *this;
}
void put(){
printf("%d",d[d[0]]);
for(int i = d[0]-1;i >= 1;i--) printf("%04d",d[i]);
printf("\n");
}
}; BigNumber operator * (const BigNumber &a,const int &k)
{
BigNumber c;
c.d[0] = a.d[0];
int i ,x = 0;
for(int i = 1;i <=a.d[0];i++){
x = a.d[i]*k + x;
c.d[i] = x%10000;
x /= 10000;
}
while(x > 0){
c.d[++c.d[0]] = x%10000;
x /= 10000;
}
while((c.d[0]>1) && (c.d[c.d[0]] == 0)) --c.d[0];
return c;
} int main()
{
//freopen("a.txt","r",stdin);
//freopen("b.txt","r",stdin);
__int64 n,i;
while(~scanf("%I64d",&n)){
BigNumber ans;
ans = 1;
if(n <= 4){
printf("%d\n",n); continue;
}
//算出n的连续和;
for(i = 2;i < n;i++){
a[i-2] = i;
n -= i;
} int cnt = i - 3;
while(n){
a[cnt]++;
n--;
cnt -= 1;
if(cnt == -1) cnt = i - 3;
}
for(int j = 0;j <= i - 3;j++){
//printf("%d ",a[j]);
ans = ans * a[j];
}
ans.put();
}
return 0;
}

最新文章

  1. 【Linux】df命令 ,查看磁盘容量。
  2. PostGr-SQL 基本概念
  3. python内置函数 2
  4. JS魔法堂:追忆那些原始的选择器
  5. MySQL数据库学习笔记(一)----MySQL 5.6.21的安装和配置(setup版)
  6. 用Python作GIS之一:介入STARS
  7. Commons CLI - Usage
  8. YII与Ace Admin 的集成
  9. redis学习一
  10. AngularJs踩过的坑
  11. pycharm 输入法光标跟随
  12. idea properties文件中文无法正常显示
  13. 函数:PHP将字符串从GBK转换为UTF8字符集iconv
  14. leetcode 总结 动态规划问题小结
  15. Eclipse的Jar包解压出System.js里String与Boolean定义分号可有可无吗?
  16. spring自带的定时任务功能@EnableScheduling
  17. fedora 中从命令行中直接打开资源管理器
  18. unity3d-Visual Studio Tools for Unity快捷键
  19. JS数组对象的方法
  20. css3实现立方体效果

热门文章

  1. mysql 处理数据库中的重复行
  2. php 修改
  3. python 列表 字符串 转换
  4. 12.jsp概述及指令
  5. 关于虚拟机IP网段和公司内网网段的问题?
  6. JavaScript 数组操作函数--转载+格式整理
  7. apxs添加apache模块
  8. Laravel 5.1的多路由文件的配置
  9. dedecms--自定义session存值取值
  10. 小窥React360——用React创建360全景VR体验