CF1062D Fun with Integers
思路:
找规律。
实现:
1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 int main() 5 { 6 ll n; 7 while (cin >> n) 8 { 9 ll cnt = 0; 10 for (int i = 2; i * i <= n; i++) 11 { 12 ll tmp = n / i; 13 cnt += (i + 1 + tmp) * (tmp - i) / 2; 14 cnt += (tmp - i + 1) * i; 15 } 16 cout << (cnt << 2) << endl; 17 } 18 return 0; 19 }
转载于:https://www.cnblogs.com/wangyiming/p/9977600.html
CF1062D Fun with Integers相关推荐
- pandas将dataframe原有的数据列名称转化为整数数值列名称(convert dataframe column labelsl into integers)
pandas将dataframe原有的数据列名称转化为整数数值列名称(convert dataframe column labelsl into integers) 目录 pandas将datafra ...
- [LeetCode] Sum of Two Integers 两数之和
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Exam ...
- “TypeError: list indices must be integers or slices, not str”有关报错解决方案
"TypeError: list indices must be integers or slices, not str"有关报错解决方案 参考文章: (1)"TypeE ...
- python3 错误string indices must be integers 的解决方法
这个错误意思是字符串的下标一定要是整数 出这种错误有多种可能,最形象直接的就是: a = '[abc]' print(a['0']) 有点pyhton基础的都知道下标怎么能是字符串'0',必须是整数0 ...
- list indices must be integers or slices, not tuple
11年it研发经验,从一个会计转行为算法工程师,学过C#,c++,java,android,php,go,js,python,CNN神经网络,四千多篇博文,三千多篇原创,只为与你分享,共同成长,一起进 ...
- leetcode 371. Sum of Two Integers
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Exam ...
- MATLAB报错“Integers can only be raised to positive integral powers.“
报错代码是下面这样的: I=imread('pout.jpg'); if size(I,3)>1 %判断如果是彩色图像,转换为灰度图 I=rgb2gray(I); end Gamma_ ...
- Divide Two Integers
Divide two integers without using multiplication, division and mod operator. 思路:不能使用乘法除法以及取模运算来计算两个数 ...
- leetcode之Divide Two Integers
题目:Divide Two Integers Divide two integers without using multiplication, division and mod operator. ...
- 成功解决ValueError: ‘usecols‘ must either be list-like of all strings, all unicode, all integers or a ca
成功解决ValueError: 'usecols' must either be list-like of all strings, all unicode, all integers or a ca ...
最新文章
- 从Python到AI,这条路好走吗?
- 【Unity 3D】学习笔记三十六:物理引擎——刚体
- redis启动问题:/var/redis/run/redis_6379.pid exists, process is already running or crashed
- [NHibernate]事务
- VC/MFC如何设置对话框背景颜色
- 洛谷——P1583 魔法照片
- python property作用_python中@property的作用和getter setter的解释
- 正确的python变量名_在Python,如何将变量名作为字符串?_others_酷徒编程知识库...
- excel删除行 uipath_UiPath之常见问题集锦(二)
- 提高学生对计算机学科学习兴趣的研究的结题报告,《如何在体育教学中运用体育游戏》的研究结题报告...
- 【爬虫剑谱】二卷4章 实战篇-模拟登录铁路12306网站(滑块验证)
- C++使用VARIANT实现二维数组的操作
- cas → 注销登录后跳转到登录页
- VS Code下载安装教程
- CrossApp V1.0.1,新增动画与连接 wifi 功能
- uni实现前端分页功能
- java 斑马 打印不出来_通过PrintServer将原始ZPL发送到Zebra打印机不起作用
- 自定义ViewGroup
- 统计检验的基本原理(异常值检验)
- java do po dto_彻底搞懂DAO,PO,BO,DTO,VO,DO