当前位置:网站首页>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< 边栏推荐
- Promise的使用与async/await的使用
- KDD'22 Recommendation System Papers (24 Research & 36 Application Papers)
- Leetcode sword 】 refers to the Offer (special commando) summary
- 【猜拳游戏 基于Objective-C语言】
- 仿记事本;QFile
- Basic tools - NETCAT (Telnet - banner, transfer text message)
- 人体神经元细胞分布图片,神经元人体分布大图
- 卷积神经网络 图像识别,卷积神经网络 图像处理
- String title parsing
- "Public Administration" exam key points and answers
猜你喜欢

nonebot插件:说话的艺术

Object.prototype.toString()如何判断数据类型及注意点

APISIX Ingress v1.5-rc1 released

KDD'22 Recommendation System Papers (24 Research & 36 Application Papers)

clue binary tree

Session and cookie usage

Web attack log analysis: a guide for beginners

【RPC】Mercury RPC

Mail online cobalstrike fishing

APISIX Ingress v1.5-rc1 发布
随机推荐
APISIX Ingress v1.5-rc1 released
Talk about the principle and implementation of Redis distributed lock [Ant Financial Services Three Sides]
Typescript namespace
flex布局属性简约速记
云计算和云服务,云计算
IP核之RAM实验
Day7:面试必考选择题
std::thread创建线程,使用std::ref()传递类对象参数
apifox使用文档之环境变量 / 全局变量 / 临时变量附apifox学习路线图
人体神经元细胞分布图片,神经元人体分布大图
"Public Administration" exam key points and answers
Tensorboard的使用 ---- SummaryWriter类(pytorch版)
Go-Excelize API源码阅读(十)—— SetActiveSheet(index int)
字符串题目解析
The tests that need to be done in the development of medical device products
数据库系统原理与应用教程(080)—— MySQL 练习题:操作题 186-193(二十四):综合练习
flex布局缺点
TCP/IP基本实现
Leetcode sword 】 refers to the Offer (special commando) summary
线索二叉树