﻿﻿

## How many integers can you find

0<n<2^31,0<m1，m2<=10。

12 2 3

7
容斥原理：
#include<stdio.h>
int gcd(int a,int b)
{
if(b==0)
return a;
else
return gcd(b,a%b);
}
int main()
{
int a,b,c;
while(scanf("%d%d%d",&a,&b,&c)!=-1)
{
int sum=0;
if(a%b==0)
sum+=a/b-1;
else
sum+=a/b;
if(a%c==0)
sum+=a/c-1;
else
sum+=a/c;
int l;
l=gcd(b,c);
int g;
g=b*c/l;
if(a%g==0)
sum-=a/g-1;
else
sum-=a/g;
printf("%d\n",sum);
}
}


#### HDU 1796 How many integers can you find (容斥定理 + 二进制)

2015-08-15 09:25:59

#### HDU 1796 How many integers can you find 容斥原理

2015-03-26 20:33:24

#### HDU 1796 How many integers can you find（组合数学-容斥原理）

2014-07-29 16:22:48

#### hdu 2266 How Many Equations Can You Find

2015-07-06 13:42:49

#### DFS hdu2266（How Many Equations Can You Find）

2016-10-15 16:56:24

#### hdoj 1796 How many integers can you find 【容斥原理】

2015-06-14 21:30:39

#### HDU 2138 How many prime numbers【素数判断，卡时间！！】

2016-01-15 18:07:57

#### FZU 1012 Relatives

2009-09-04 10:10:00

#### 【CodeForces - 919E】 Congruence Equation 【费马小定理 + 思维】

2018-02-05 23:12:37

#### HDU：2266 How Many Equations Can You Find（深搜+DFS）

2016-10-10 22:32:25

## 不良信息举报

How many integers can you find