湖南省第十二届大学生计算机程序设计竞赛$A$题

枚举。

处理一下$\% 2016$之后的数分别有几个,然后$2016*2016$枚举一下统计方案数就可以了。

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0),eps=1e-;
void File()
{
freopen("D:\\in.txt","r",stdin);
freopen("D:\\out.txt","w",stdout);
}
template <class T>
inline void read(T &x)
{
char c = getchar(); x = ;while(!isdigit(c)) c = getchar();
while(isdigit(c)) { x = x * + c - ''; c = getchar(); }
} LL n,m,a[],b[]; int main()
{
while(~scanf("%lld%lld",&n,&m))
{
memset(a,,sizeof a); memset(b,,sizeof b);
for(int i=;i<;i++) a[i]=n/(LL),b[i]=m/(LL);
for(int i=;i<=n%;i++) a[i]++;
for(int i=;i<=m%;i++) b[i]++;
LL ans=;
for(int i=;i<;i++)
for(int j=;j<;j++)
if(i*j%==) ans=ans+a[i]*b[j];
cout<<ans<<endl;
}
return ;
}

CSU 1803 2016的更多相关文章

  1. CSU 1803 2016(数论)

    2016 Problem Description: 给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1≤a≤n,1≤b≤m; a×b 是 2016 的倍数. Input: 输 ...

  2. CSU 1803 2016 湖南省2016省赛

    1803: 2016 Submit Page   Summary   Time Limit: 5 Sec     Memory Limit: 128 Mb     Submitted: 1416    ...

  3. 【模拟】【数学】CSU 1803 2016 (2016湖南省第十二届大学生计算机程序设计竞赛)

    题目链接: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1803 题目大意: 给定n,m(n,m<=109)1<=i<=n,1& ...

  4. CSU 1803 - 2016 - [同余]

    题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1803 给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1. ...

  5. CSU - 1803 —— 数学题

    题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1803 Description  给出正整数 n 和 m,统计满足以下条件的正整数对 ...

  6. 十二届 - CSU 1803 :2016(同余定理)

    题目地址:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1803 Knowledge Point: 同余定理:两个整数a.b,若它们除以整数m所 ...

  7. csu 1803(余数分类)

    1803: 2016 Time Limit: 5 Sec  Memory Limit: 128 MBSubmit: 565  Solved: 364[Submit][Status][Web Board ...

  8. 【CSU 1803】2016

    http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1803 Solution: 考虑两个数x,y乘积%2016=0 x×y≡0(MOD 2016) x= ...

  9. 【CSU 1803】2016 (数学)

    Description 给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1. 1≤a≤n,1≤b≤m; 2. a×b 是 2016 的倍数. Input 输入包含不超过 30 ...

随机推荐

  1. MVC与EasyUI结合增删改查

    构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(9)-MVC与EasyUI结合增删改查   在第八讲中,我们已经做到了怎么样分页.这一讲主要讲增删改查.第六讲的 ...

  2. Android简单发送邮件(可带附件)

    项目中遇到了一个发送邮件的功能,在网上查了很多,资料也很多.这里就不一一介绍了,只是写出我使用的方案(最简单的) Intent email = new Intent(android.content.I ...

  3. NotePad++安装和配置C/C++开发插件

    NotePad++ - 安装和配置C/C++开发插件 | NotePad++ - Install and Configure plugins for develop C/C++ http://aofe ...

  4. js中的“闭包”

    js中的“闭包” 姓名:闭包 官方概念:闭包是一个拥有许多变量和绑定了这些变量的环境的表达式(通常是一个函数),因而这些变量也是该表达式的一部分. ( ⊙o⊙ )!!!这个也太尼玛官方了撒,作为菜鸟的 ...

  5. Mathematics for Computer Graphics

    Mathematics for Computer Graphics 最近严重感觉到数学知识的不足! http://bbs.gameres.com/showthread.asp?threadid=105 ...

  6. T-SQL编程的基本语法和思想

    通过一个很实用的例子让你学会T-SQL编程的基本语法和思想   例子需求:把Execl中的三级分类(列别的三级联动)数据导入到数据库中. Excel表中数据的显示格式: 图1 数据库中表的显示格式: ...

  7. Arduino live weather broadcasting 实时天气站

    Live broadcasting with arduino get a pc , make it run linux. make arduino catch the weather sensor a ...

  8. Arduino 各种模块篇 蓝牙模块 手机蓝牙控制Arduino LED灯

    解决方案. 条件: 1.手机android 商店下载 blueTerm 2.向arduino中载入如下代码: char val; ; void setup() { Serial.begin(); pi ...

  9. 【Cocos2d-X开发学习笔记】第05期:渲染框架之布景层类(CCLayer)的使用

    本系列学习教程使用的是cocos2d-x-2.1.4版本(截至目前为止最新稳定版) ,PC开发环境Windows7,C++开发环境VS2010 图层也是渲染框架中很重要的内容.场景类用来划分游戏的状态 ...

  10. Hackers’ Crackdown-----UVA11825-----DP+状态压缩

    题目地址:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...