摘要: 首先接触的就是欧几里得求最大公约数(GCD) 递归的写法: 在扩展欧几里得中,设法求 ax + by = gcd(a, b) 中的一组 x 和 y 的解 当 b = 0 的时候, gcd(a, b) = a,此时的 x = 1, y = 0为其中的一组的解 当 b ≠ 0 的时候 , 设 ax1 + 阅读全文
posted @ 2018-06-02 19:05 ouyang_wsgwz 阅读(167) 评论(0) 推荐(1) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 typedef long long ll; 5 6 int a[20]; 7 int dp[20][15][3]; 8 9 //pos:当前位置 10 //mod:余数 11 //have :0:前一位不是1 1:前一位是1 2:有13 12 ll dfs(int pos,in... 阅读全文
posted @ 2018-06-02 18:16 ouyang_wsgwz 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 using namespace std; 9 10 #define LL long long 11 const int MOD = 2520; 12 ... 阅读全文
posted @ 2018-06-02 17:42 ouyang_wsgwz 阅读(167) 评论(0) 推荐(0) 编辑