给定n和m个数,询问在小于n的数中 有多少个能整除m中的某个数.. 容斥原理. PS:注意64位整数! /* 容斥原理 */ #include<stdio.h> #include<string.h> #include<stdlib.h> #include<iostream> using namespace std; typedef long long int64; ; int64 num[ maxn ]; int64 ans; int n, m; int g…
Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integers in the set. For example, N=12, and M-integer set is {2,3}, so there is another set {2,3,4,6,8,9,…