其实就是求1-n所有数的最小公倍数。1-n中所有的合数都能由质数相乘得到,筛选出所有的质数q[i],并计算出q[i]^k<=n,将所有的q[i]^k相乘即为所求结果。
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
const int countn = 100000000;
const int mod = 987654321;
int n, cnt, p[100000];
bool