当前位置:网站首页>Integer block sample
Integer block sample
2022-08-08 05:46:00 【a little yu】
Title description
Given is a positive integer N. Find the value

.
Here, for a real number x, [x] denotes the largest integer not exceeding x.
Constraints
1≤N≤1012
N is an integer.
Enter
Input is given from Standard Input in the following format:
N
Output
Print the answer.
Sample input Copy
【Example 1】3【Example 2】10000000000
Sample output Copy
【Example 1】5【Example 2】231802823220
Tips
Example 1 Explanation:
We have

.
Example 2 Explanation:
Note that the input and output may not fit into a 32-bit integer type.
#includeusing namespace std;typedef long long ll;typedef double db;ll n,sum,r;int main(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cin>>n;for(ll l=1;l<=n;l=r+1){r=n/(n/l);sum+=(r-l+1)*(n/l);}cout< 边栏推荐
猜你喜欢
随机推荐
76. 最小覆盖子串
Filter 过滤器的使用
【Win10】Several sleep problems and countermeasures
使用 Zap 和 W3af 进行 Web 应用程序漏洞评估
【无标题】暂时没有想好叫什么名字
Why do big Internet companies keep hiring while frantically laying off staff?
Week 8 Generative Adversarial Networks(生成对抗网络 GAN)
Runtime——KVC,KVO原理
uniapp H5 签名横版生成图片
Week 8 Transformer Language Models and Implications
Week 8 Transformer Language Models and Implications
VSCode已经设置过为中文但变成英文的解决办法
浅学软件逆向笔记(1)
Completed - desktop interactive wizard design based on facial expressions (share the results, attach the data set of facial expressions and the yolov5 model trained by yourself and the interactive int
Day7:面试必考选择题
数据库分库分表,何时分?怎样分?
Unity-CharacterController (Character Controller)
数据库ADB多个字符,想要导入到ES存为nested的类型,这个支持吗?有对应的文档吗
C language force to deduct the length of the last word of the 58th question.Traverse from back to front
wpf中DataGrid的样式








