- 博客(8)
- 收藏
- 关注
原创 快速幂取模(c++实现)
快速幂取模就是快速的求一个幂式的模(余)。下面给出c++语言实现ab mod c = (a mod c)c mod c;/*以求13^13%10为例*/#include<iostream>using namespace std;long long pow_mod(long long a,long long i,long long n){if(i==0) return 1%n;...
2018-06-14 21:01:14
1978
转载 c语言输入输出格式
//最近被某题的输入输出卡了。。。转一波随时看。。。菜哭<span style="font-family:KaiTi_GB2312;font-size:18px;">本小节介绍的是向标准输出设备显示器输出数据的语句。在C语言中,所有的数据输入/输出都是由库函数完成的。因此都是函数语句。本小节先介绍printf函数和putchar函数。printf函数printf函数称为格式输出函数,其...
2018-06-11 20:39:58
23724
2
原创 poj1979 Red and Black(简单dfs)
Red and BlackTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 41888 Accepted: 22685DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black....
2018-06-11 19:17:41
208
原创 poj2258 The Settlers of Catan(简单dfs)
The Settlers of CatanTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1435 Accepted: 936DescriptionWithin Settlers of Catan, the 1995 German game of the year, players attempt to dominate an i...
2018-06-10 21:27:15
275
原创 最小生成树-Kruskal算法
N个点M条边的无向连通图,每条边有一个权值,求该图的最小生成树。Input第1行:2个数N,M中间用空格分隔,N为点的数量,M为边的数量。(2 <= N <= 1000, 1 <= M <= 50000)第2 - M + 1行:每行3个数S E W,分别表示M条边的2个顶点及权值。(1 <= S, E <= N,1 <= W <= 10000)Ou...
2018-05-28 23:34:04
264
转载 C++ STL--vector
在STL的<vector>头文件中定义了vector(向量容器模版类),vector容器以连续数组的方式存储元素序列,可以将vector看作是以顺序结构实现的线性表。当我们在程序中需要使用动态数组时,vector将会是理想的选择,vector可以在使用过程中动态地增长存储空间。 vector模版类需要两个模版参数,第一个参数是存储元素的数据类型,第二个参数是存储分配器的类型,其中第二个...
2018-03-28 19:33:37
181
原创 POJ 1207,UVA 100 The 3n+1 problem
DescriptionProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an alg
2018-01-28 21:23:33
240
原创 2017-2018学年寒假大一新生训练
用的书是机械工业出版社吴永辉,王建德编写的《数据结构编程实验》,1月25日晚举行了开幕式,2月10日结束回家。数据结构在大一下学期才开始接触,因此感觉有些困难。
2018-01-27 20:54:44
385
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人