2016
来源:互联网 发布:js new york 编辑:程序博客网 时间:2024/04/28 12:27
CSU - 1803
2016
Time Limit: 5000MS Memory Limit: 131072KB 64bit IO Format: %lld & %llu
Submit
Status
Description
给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量:
1. 1≤a≤n,1≤b≤m;
2. a×b 是 2016 的倍数。
Input
输入包含不超过 30 组数据。
每组数据包含两个整数 n,m (1≤n,m≤10 9).
Output
对于每组数据,输出一个整数表示满足条件的数量。
Sample Input
32 63
2016 2016
1000000000 1000000000
Sample Output
1
30576
7523146895502644
#include<iostream>#include<algorithm>main(){ const long long p = 2016; long long m, n, sum; using namespace std; while(cin>>m>>n && (m||n)) { sum = 0; for(int i = 1; i <= min(m, p); i++) { for(int j = 1; j <= min(n, p); j++) { if((i*j)%2016==0) { sum += ((m-i)/p+1)*((n-j)/p+1); } } } cout<<sum<<endl; }}
写完后感觉自己好傻逼
0 0
- 2016
- 2016
- 2016
- 2016!
- 2016
- 2016
- 2016
- 2016
- 2016
- 2016
- 2016
- 2016
- 2016
- 2016-
- 2016
- 2016
- 2016
- 2016
- kendoUI行编辑器的使用grid.editRow($("#grid tr:eq(1)"))无效
- 标准体重计算器
- 站在源码的角度全解Scroller工作机制(一)
- Python日志输出——logging模块
- 理解szeof
- 2016
- pytohn驱动连接mysql数据库
- Innodb中的事务隔离级别和锁的关系
- Entity Framework 执行sql语句 存储过程
- RDD应用API---flatMap、map、reduceByKey、collect、foreach
- Syntax error on token ".", @ expected after this token - Syntax error, insert "SimpleName" to compl
- RunLoop 与 Runtime
- 最优控制理论总结——极小值原理PMP
- 数据结构与算法视频教程_内力修炼