当前位置:网站首页>AtCoder—C - ABC conjecture
AtCoder—C - ABC conjecture
2022-08-07 02:34:00 【MITBlick】
Time Limit: 2 sec / Memory Limit: 1024 MB
Score : 300300 points
Problem Statement
You are given a positive integer NN.
Find the number of triples of positive integers (A, B, C)(A,B,C) such that A\leq B\leq CA≤B≤C and ABC\leq NABC≤N.
The Constraints guarantee that the answer is less than 2^{63}263.
Constraints
- 1 \leq N \leq 10^{11}1≤N≤1011
- NN is an integer.
Input
Input is given from Standard Input in the following format:
NN
Output
Print the answer.
Sample Input 1 Copy
Copy
4
Sample Output 1 Copy
Copy
5
There are five such triples: (1,1,1),(1,1,2),(1,1,3),(1,1,4),(1,2,2)(1,1,1),(1,1,2),(1,1,3),(1,1,4),(1,2,2).
Sample Input 2 Copy
Copy
100
Sample Output 2 Copy
Copy
323
Sample Input 3 Copy
Copy
100000000000
Sample Output 3 Copy
Copy
5745290566750
#include #include #include using namespace std;typedef long long ll;signed main(){ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);ll N;cin >> N;ll ans = 0;for (ll a = 1; a <= N; a++) //enumerate the first item{if (a*a > N / a) break; //The last two items are greater than the first itemfor (ll b = a; b <= N; b++) //Second item{ll cma = N / (a * b);if (cma < b) break;ans += cma - b + 1;}}cout << ans << endl;} 边栏推荐
猜你喜欢
随机推荐
yum 获取指定命令所属安装包(yum provides)
ansible file 模块
苹果所有设备参数大全
HUSTOJ添加ssl证书
【数学建模】论文模板和latex模板
Solve [__NSArrayM objectAtIndex:]: index 0 beyon Objective-C exception bug method
领克09phev主动和被动安全配置齐全,百公里加速5.6s
HCIP实验(08)
【Verilog基础】DFT(Design for Test)可测性设计的一些基础概念
基于FPGA的fir滤波器设计verilog实现
德迅云安全提供国内卓越、快速、稳定的高防产品
【数学建模】Topsis优劣解距离法
【UGF】GameFramework接入HybridCLR(wolong)卧龙热更框架
【ROS2原理4】interface 接口
KingbaseES V8R3集群管理维护案例之---集群迁移单实例架构
ansibleYum 模块
LVS+Keepalived
82-FastDFS详解
字节跳动 Flink 状态查询实践与优化
Husband borrows money for business, does wife have to pay it back?









