Tiny Wong the chef used to be a mathematics teacher in a senior high school. At that time, he always used to tell his students that when there is a square root of some number in one’s final result, it should be simplified by factoring out the largest…
J. Sum 26.87% 1000ms 512000K A square-free integer is an integer which is indivisible by any square number except 11. For example, 6 = 2 \cdot 36=2⋅3 is square-free, but 12 = 2^2 \cdot 312=22⋅3 is not, because 2^222 is a square number. Some integer…
#include<bits/stdc++.h> using namespace std; const int maxn = 1e6+11; const int N = 1e6; typedef long long ll; bitset<maxn> isnprime; ll prime2[maxn>>2]; int sai(){ isnprime[0]=isnprime[1]=1; for(int i = 2; i*i < maxn; i++){ if(!isnpr…