CSU 1803 2016 (逆向思维)
来源:互联网 发布:北京小学生id软件下载 编辑:程序博客网 时间:2024/05/29 18:05
代码:
#include <map>#include <set>#include <stack>#include <queue>#include <cmath>#include <string>#include <vector>#include <cstdio>#include <cctype>#include <cstring>#include <sstream>#include <cstdlib>#include <iostream>#include <algorithm>#pragma comment(linker,"/STACK:102400000,102400000")using namespace std;#define MAX 1000005#define MAXN 1000005#define maxnode 205#define sigma_size 2#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#define lrt rt<<1#define rrt rt<<1|1#define middle int m=(r+l)>>1#define LL long long#define ull unsigned long long#define mem(x,v) memset(x,v,sizeof(x))#define lowbit(x) (x&-x)#define pii pair<int,int>#define bits(a) __builtin_popcount(a)#define mk make_pair#define limit 10000//const int prime = 999983;const int INF = 0x3f3f3f3f;const LL INFF = 0x3f3f;//const double pi = acos(-1.0);const double inf = 1e18;const double eps = 1e-9;const LL mod = 1e9+7;const ull mx = 133333331;/*****************************************************/inline void RI(int &x) { char c; while((c=getchar())<'0' || c>'9'); x=c-'0'; while((c=getchar())>='0' && c<='9') x=(x<<3)+(x<<1)+c-'0'; }/*****************************************************/int main(){ //freopen("in.txt","r",stdin); int n,m; while(cin>>n>>m){ LL ans=(LL)n*m; for(int i=1;i<=min(2015,n);i++){ for(int j=1;j<=min(2015,m);j++){ if(i*j%2016!=0){ ans-=(LL)((n-i)/2016+1)*((LL)(m-j)/2016+1); } } } cout<<ans<<endl; } return 0;}
1 0
- CSU 1803 2016 (逆向思维)
- CSU 1803 2016(思维)
- 逆向思维(域外箴言)
- Colorful Tree(逆向思维)
- 逆向思维
- 逆向思维
- 逆向思维
- 逆向思维
- 逆向思维
- 2016 CSU 1803 (思路)
- CSU 1803:2016(数论)
- FZU1607 Greedy division(逆向思维)
- hdu4503(概率的逆向思维)
- hdu5200 Trees(逆向思维+离线处理)
- hdu5386 Cover(逆向思维+模拟)
- hdu 5386 Cover(逆向思维+模拟)
- UVALive 6897Exploration(逆向思维)
- 【UVALive 7364】Robots(逆向思维+搜索)
- AJAX验证是否重复
- HTML5 data-* 自定义属性
- ANSIC标准6个预定义宏
- python tkinter 编写心理学试验程序干扰任务之四则运算 psychopy
- 【雅礼联考GDOI2017模拟9.2】Ztxz16学图论
- CSU 1803 2016 (逆向思维)
- zsh shell (oh my zsh)搭建
- html input readonly 和 disable的区别
- Git2.初次运行 Git 前的配置&获取帮助
- 素数判定的一些讨论(Miller-Rabin算法)
- RecyclerView
- vm虚拟机中fedora无法全屏显示解决
- tomcat源码:Context容器和Wrapper容器
- 和柘榎诗一首