摘要: http://www.acmore.net/problem.php?id=1467根据朴素的欧几里德原理有 gcd(a,b)=gcd(b,a mod b);则:ax1+by1=bx2+(a mod b)y2;即:ax1+by1=bx2+(a-[a/b]*b)y2=ay2+bx2-(a/b)*by2;根据恒等定理得:x1=y2; y1=x2-[a/b]*y2;本题直接利用这个结论。#include <iostream>#include <stdio.h>#include <string>#include <string.h>#include < 阅读全文
posted @ 2013-05-02 20:19 Roly Yu 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 二分+树状数组动态的寻找比a大k的数#include <stdio.h>#include <iostream>#include <string>#include <string.h>#include <algorithm>#include <stdlib.h>#include <math.h>#include <vector>#include <map>using namespace std;const int maxn = 100005;int c[maxn];int lowbit(i 阅读全文
posted @ 2013-05-02 13:20 Roly Yu 阅读(188) 评论(0) 推荐(0) 编辑