hdu4944与因子有关
来源:互联网 发布:php新视频教程 编辑:程序博客网 时间:2024/04/26 10:46
#include<cstdio>#include<iostream>using namespace std;#define ll long longconst int need_num=500000;const int max_n=500000+100;const ll mod=1ll<<32;ll f[max_n];void init(){ f[1]=1; for(int i=2;i<=need_num;i++) { f[i]=f[i-1]; ll cur=0; for(int j=1;j*j<=i;j++) if(i%j==0) { cur+=(j+1)*j/2; if(j*j==i)break; ll k=i/j; cur+=(k+1)*k/2; } cur%=mod; f[i]=(f[i]+cur*i%mod)%mod; }}int main(){ init(); int T; cin>>T; for(int cas=1;cas<=T;cas++) { int n; scanf("%d",&n); printf("Case #%d: %I64d\n",cas,f[n]); } return 0;}
0 0
- hdu4944与因子有关
- HDU4944 FSF’s game【因子和】【递推】
- hdu4944 FSF’s game
- 线程粒度因子与锁粒度因子
- 正整数的因子与质因子
- 【专题】因子和与因子个数
- 素数因子与阶乘
- 因子与阶乘
- 因子与阶乘
- 向量与因子操作
- 因子与阶乘
- 噪声系数与噪声因子
- SqlServer 碎片与填充因子
- R语言-因子与表格
- 松弛变量与惩罚因子
- hdu 1999 数论水题 有关真因子 水题
- 有关某数的因子——分数拆分
- struck有关与集合有关
- apt-get update apt-get upgrade
- 人生是个千疮百孔的鸡蛋
- hdoj 2045 LELE的RPG难题 解题报告(简单递推)
- poj2607Fire Station(floyd最短路)
- 冒泡排序
- hdu4944与因子有关
- Struts2下载
- 命令模式(Command Pattern)小结
- iOS屏幕旋转学习笔记
- 出现( linker command failed with exit code 1)错误总结
- 第四天-8。13
- OCP-1Z0-051 补充题库 第36题 约束
- 面试题
- 星星评分定制