CSU 1803 - 2016 - [同余]
题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1803
Input
Output
对于每组数据,输出一个整数表示满足条件的数量。
Sample Input
32 63
2016 2016
1000000000 1000000000
Sample Output
1
30576
7523146895502644
#include<cstdio>
using namespace std;
typedef long long LL; LL n,m;
LL amo[][];
void init()
{
LL sum;
amo[][]=;
for(int i=;i<=;i++)
{
amo[i][]=amo[][i]=;
sum=;
for(int j=;j<=;j++)
{
if((i*j)%==) sum++;
amo[i][j]=amo[i-][j]+sum;
}
}
} int main()
{
init();
while(scanf("%lld%lld",&n,&m)!=EOF)
{
LL a1=n/, b1=n%;
LL a2=m/, b2=m%;
printf("%lld\n",amo[][]*a1*a2+a1*amo[][b2]+a2*amo[b1][]+amo[b1][b2]);
}
}
注意:CSU的OJ不能使用bits/stdc++.h,同时注意数字范围超int,需要使用long long.
CSU 1803 - 2016 - [同余]的更多相关文章
- CSU 1803 2016(数论)
2016 Problem Description: 给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1≤a≤n,1≤b≤m; a×b 是 2016 的倍数. Input: 输 ...
- CSU 1803 2016 湖南省2016省赛
1803: 2016 Submit Page Summary Time Limit: 5 Sec Memory Limit: 128 Mb Submitted: 1416 ...
- 【模拟】【数学】CSU 1803 2016 (2016湖南省第十二届大学生计算机程序设计竞赛)
题目链接: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1803 题目大意: 给定n,m(n,m<=109)1<=i<=n,1& ...
- CSU 1803 2016
湖南省第十二届大学生计算机程序设计竞赛$A$题 枚举. 处理一下$\% 2016$之后的数分别有几个,然后$2016*2016$枚举一下统计方案数就可以了. #pragma comment(linke ...
- CSU - 1803 —— 数学题
题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1803 Description 给出正整数 n 和 m,统计满足以下条件的正整数对 ...
- 十二届 - CSU 1803 :2016(同余定理)
题目地址:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1803 Knowledge Point: 同余定理:两个整数a.b,若它们除以整数m所 ...
- csu 1803(余数分类)
1803: 2016 Time Limit: 5 Sec Memory Limit: 128 MBSubmit: 565 Solved: 364[Submit][Status][Web Board ...
- 【CSU 1803】2016
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1803 Solution: 考虑两个数x,y乘积%2016=0 x×y≡0(MOD 2016) x= ...
- 【CSU 1803】2016 (数学)
Description 给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1. 1≤a≤n,1≤b≤m; 2. a×b 是 2016 的倍数. Input 输入包含不超过 30 ...
随机推荐
- 【Windows socket+IP+UDP+TCP】网络基础
Windows Socket+网络 Winsock是 Windows下套接字标准. Winsock 编程分为UDP[Windows socket + UDP],TCP[Wi ...
- SpringMVC -- 梗概--源码--贰--异常管理
附:实体类 Class : User package com.c61.entity; import java.text.SimpleDateFormat; import java.util.Date; ...
- git push 问题汇总
Q:git push时卡死 这个问题找的快要放弃的时候... A: git config --global http.postBuffer [via] Q:git push 报错 Counting o ...
- Explaining Delegates in C# - Part 3 (Events 2)
I was thinking that the previous post on Events and Delegates was quite self-explanatory. A couple o ...
- python cookie
http://www.jayconrod.com/posts/17/how-to-use-http-cookies-in-python
- ConcurrentModificationException 详解
工作中碰到个ConcurrentModificationException.代码如下: List list = ...;for(Iterator iter = list.iterator(); ite ...
- OSG3.4编译FFMPEG插件
0.加入你要读a.mp4,那个正确的写法是osg::Image* image = osgDB::readImageFile("a.mp4.ffmpeg"); 1.在github上下 ...
- Twitter 高并发高可用架构
解决 Twitter的“问题”就像玩玩具一样,这是一个很有趣的扩展性比喻.每个人都觉得 Twitter很简单,一个菜鸟架构师随便摆弄一下个可伸缩的 Twitter就有了,就这么简单.然而事实不是这样, ...
- 如何将一个项目打成war包?
如何将一个项目打成war包?进入该项目所在目录jar -cvf myProjec.war myProject
- Barcode.js功能强大的条码生成jQuery插件
本文转载自http://www.uedsc.com/barcode-js.html Barcode.js是一个基于jQuery库的插件,用于绘制条形码或者二维码,能够生成基于DIV+CSS或者Canv ...