摘要: for (i = 1; i = 2 is the set of irreducible rational numbers a/b with 0 #include #include #include using namespace std;#define maxn 1000006long long phi[maxn], num[maxn];int n;int main(){ //freopen("t.txt", "r", stdin); int i, j; for (i = 1; i <= maxn; i++) phi[i] = i; for (i 阅读全文
posted @ 2014-03-05 20:47 哥的笑百度不到 阅读(347) 评论(0) 推荐(0)
摘要: 一般:int gcd(int x,int y){ if(!x || !y) return x>y:x?y; for(int t;t=x%y;x=y,y=t) return y;}快速int kgcd(int a,int b){ if(a==0) return b; if(b==0) return a; else if(!(a&1) && !(b&1)) { return kgcd(a>>1,b>>1)>1,b); } else return kgcd(ans(a-b),min(a,b));} 阅读全文
posted @ 2014-03-05 19:52 哥的笑百度不到 阅读(3667) 评论(0) 推荐(0)