- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 HDU - 4771 Stealing Harry Potter's Precious (dfs + bfs,dfs 暴力 tsp)
Stealing Harry Potter's PreciousHarry Potter has some precious. For example, his invisible robe, his wand and his owl. When Hogwarts school is in holiday, Harry Potter has to go back to uncle Vernon...
2018-10-16 23:46:43 167
原创 HDU - 5521 Meeting (最短路 ,技巧建图)
MeetingBessie and her friend Elsie decide to have a meeting. However, after Farmer John decorated hisfences they were separated into different blocks. John's farm are divided intonnblocks labell...
2018-10-16 15:11:24 200
原创 区间素数筛
给定整数a和b,请问区间[a,b)内有多少个素数?a<b<=10^12b-a<=10^6因为b以内合数的最小质因数一定不超过sqrt(b),如果有sqrt(b)以内的素数表的话,就可以把筛选法用在[a,b)上了,先分别做好[2,sqrt(b))的表和[a,b)的表,然后从[2,sqrt(b))的表中筛得素数的同时,也将其倍数从[a,b)的表中划去,最后剩下的就是区间...
2018-10-11 20:12:42 473
原创 HDU - 5952 Counting Cliques (暴力dfs)
Counting Cliques A clique is a complete graph, in which there is an edge between every pair of the vertices. Given a graph with N vertices and M edges, your task is to count the number of cliques ...
2018-10-10 10:51:39 199
原创 HDU - 5950 Recursive sequence (构造矩阵 + 矩阵快速幂)
Recursive sequenceFarmer John likes to play mathematics games with his N cows. Recently, they are attracted by recursive sequences. In each turn, the cows would stand in a line, while John writes tw...
2018-10-09 23:03:41 221 1
原创 洛谷 P3390 (矩阵快速幂模版)
题目背景矩阵快速幂题目描述给定n*n的矩阵A,求A^k输入输出格式输入格式:第一行,n,k第2至n+1行,每行n个数,第i+1行第j个数表示矩阵第i行第j列的元素输出格式:输出A^k共n行,每行n个数,第i行第j个数表示矩阵第i行第j列的元素,每个元素模10^9+7输入输出样例输入样例#1:复制2 11 11 1...
2018-10-09 20:27:44 233
原创 codeforces 1005D Polycarp and Div 3
Polycarp likes numbers that are divisible by 3.He has a huge number ss. Polycarp wants to cut from it the maximum number of numbers that are divisible by 33. To do this, he makes an arbitrary number...
2018-10-02 13:17:52 186 1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人