上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 46 下一页
摘要: 推荐博客 :https://www.cnblogs.com/frog112111/archive/2012/08/19/2646012.html 欧几里得又称为辗转相除法,是用来求最大公约数的一种高效的算法。 核心就是一点 gcd(a, b) = gcd(b, a%b) ; 扩展欧几里得 两个不定方 阅读全文
posted @ 2017-11-14 09:39 楼主好菜啊 阅读(311) 评论(0) 推荐(0)
摘要: One day, Alice and Bob felt bored again, Bob knows Alice is a girl who loves math and is just learning something about matrix, so he decided to make a 阅读全文
posted @ 2017-11-13 22:27 楼主好菜啊 阅读(323) 评论(0) 推荐(0)
摘要: Read the program below carefully then answer the question. #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include<iostream 阅读全文
posted @ 2017-11-13 18:18 楼主好菜啊 阅读(293) 评论(0) 推荐(0)
摘要: Jzzhu has invented a kind of sequences, they meet the following property: You are given x and y, please calculate fn modulo 1000000007 (109 + 7). Inpu 阅读全文
posted @ 2017-11-11 20:32 楼主好菜啊 阅读(258) 评论(0) 推荐(0)
摘要: 这里先引入一个快速幂 正常我们计算 x^22次方的话,要怎么去计算,暴力的话平方22次,这里想一个简单的方法,x^22要怎么计算出来, x^22 = x^16 * x^4 * x^2,折几个数怎么来的呢 ? 将22转换为 2进制的数 10110 ,正好不就是2^4 = 16, 2^2 = 4, 2^ 阅读全文
posted @ 2017-11-11 13:17 楼主好菜啊 阅读(217) 评论(0) 推荐(0)
摘要: 1 . 数论的基本定理 阅读全文
posted @ 2017-11-10 21:50 楼主好菜啊 阅读(282) 评论(0) 推荐(0)
摘要: const int inf = 1 n2.c; } }; int ans, ans2; void prim(){ priority_queueque; while(!que.empty()) que.pop(); memset(mm, 0, sizeof(mm)); memset(pre, 0, sizeof(pre)); memset(used... 阅读全文
posted @ 2017-11-10 17:18 楼主好菜啊 阅读(240) 评论(0) 推荐(0)
摘要: const int inf = 1 n2.c; } }; int ans; void prim(){ priority_queueque; while(!que.empty()) que.pop(); memset(vis, false, sizeof(vis)); for(int i = 1; i >t; while(t--){ ... 阅读全文
posted @ 2017-11-10 16:21 楼主好菜啊 阅读(434) 评论(0) 推荐(0)
摘要: Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but 阅读全文
posted @ 2017-11-09 18:56 楼主好菜啊 阅读(240) 评论(0) 推荐(0)
摘要: const int inf = 1que; for(int i = 1; i d[i]){ d[i] = edge[v][i]; que.push(node(i, d[i])); } } } } int main() { int t; int a, b, ... 阅读全文
posted @ 2017-11-09 09:13 楼主好菜啊 阅读(233) 评论(0) 推荐(0)
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 46 下一页