SDOI2012Longge的问题
2705: [SDOI2012]Longge的问题
Time Limit: 3 Sec Memory Limit: 128 MB
Submit: 930 Solved: 601
[Submit][Status]
Description
Input
Output
Sample Input
Sample Output
HINT
【数据范围】
对于60%的数据,0<N<=2^16。
对于100%的数据,0<N<=2^32。
题解:
代码:
var i:longint;
n,k,ans:int64;
procedure main;
begin
readln(n);
ans:=n;
for i:= to trunc(sqrt(n)) do
if n mod i= then
begin
k:=;
while n mod i= do
begin
inc(k);
n:=n div i;
end;
inc(ans,ans*(i-)*k div i);
end;
if n<> then inc(ans,ans*(n-)* div n);
writeln(ans);
end;
begin
main;
end.
SDOI2012Longge的问题的更多相关文章
- bzoj题目分类
转载于http://blog.csdn.net/creationaugust/article/details/513876231000:A+B 1001:平面图最小割,转对偶图最短路 1002:矩阵树 ...
随机推荐
- CentOS安装配置Git服务器(gitosis)
主要参考: http://blog.csdn.net/dengjianqiang2011/article/details/9260435 辅助参考: http://freeloda.blog.51ct ...
- nodejs read/write file
fs.readFile('c:\\tmp\\helloworld.txt','utf8',function(err,data){console.log(data);}) var token=fs.re ...
- poj 2728 Desert King (最小比例生成树)
http://poj.org/problem?id=2728 Desert King Time Limit: 3000MS Memory Limit: 65536K Total Submissio ...
- centos7安装mplayer以及出现的各种问题
首先,centos7默认的视频播放器基本不能用,这里我们选择mplayer作为视频播放器. 安装的过程,痛并快乐着....... 首先我们去mplayer的官网下载需要的文件,http://www.m ...
- WPF MultiDataTrigger
huhu <Style x:Key="Cell" TargetType="{x:Type Button}"> <Setter Property ...
- 谈谈js中for in 需要注意的地方
js中for in 可以遍历对象或数组的显性属性,也就是说我们自己定义的属性是可以遍历的,那些原型上默认已有的属性,例如:Object.prototype.toString.Object.protot ...
- php站点
thinkphp wordpress 记事狗 phpcms http://jingyan.baidu.com/article/4b07be3c61e93e48b380f3fd.html
- define中的:#,##,#@
[define中的:#,##,#@] #define Conn(x,y) x##y #define ToChar(x) #@x #define ToString(x) #x (2)x##y表示什么?表 ...
- SQL Server CONVERT() 函数
http://www.w3school.com.cn/sql/func_convert.asp 定义和用法 CONVERT() 函数是把日期转换为新数据类型的通用函数. CONVERT() 函数可以用 ...
- hdu 4557 非诚勿扰
水题…… 代码如下: #include<iostream> #include<stdio.h> #include<algorithm> #include<io ...