Welcome, Guest! Sign Up RSS

Clever Space

Friday, 11.22.2024
Main » 2013 » October » 14


每个串中的数两两不同

Views: 247 | Added by: dhy0077 | Date: 10.14.2013

这道题的关键是快速分解质因数

可以预处理出每个数最小的因子
然后依次除以它

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<set>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<iostream>
#include<string>
#include<cmath>
#define N 1000100
#define FOR(i,a,b) for(i=(a);i<=(b);i++)
#define ROF(i,a,b) for(i=(a); ... Read more »
Views: 510 | Added by: dhy0077 | Date: 10.14.2013