- 博客(5)
- 收藏
- 关注
原创 c++ stl泛型(一)
1.向量vector向量容器不但能想数组一样随机访问元素,还能在尾部插入元素,简单,高效,完全可以代替数组#include#include#include//reverse反向排列算法需要此头文件using namespace std;int main(){ vectorv(3);//创建vector对象 v[0]=0; v[1]=
2015-08-11 15:36:09
385
原创 HDU1875 畅通工程再续
Wrong了无数次,最后改了一个的地方就AC了,一直不知道为什么此题典型的最小生成树的应用,我用的Kruskal算法,一直偏爱它#include#include#include#include#includeusing namespace std;struct node{ int x,y;}a[110];struct no{
2015-04-30 19:11:41
364
原创 hdu 4550
今天学了下stl的一些东西,就找来这个题练练手,当时这个题写得挺复杂,现在换种方式,对于菜鸟的我来说,也是蛮开心的一件事。(ps:省赛快来了,别被虐就好)#include#include#include#include#includeusing namespace std;int main(){ int t,x; scanf("%d",&
2015-04-27 21:12:05
336
原创 poj 3083
bfs+dfs题目要求从起点走到终点,优先左拐需要多少步,优先往右拐需要多少步,最少需要多少步三个结果需要注意的就是左右不能拐时向其他方向拐的先后顺序#include#include#includeusing namespace std;int m,n,x1,x2,y1,y2,cnt,lstep,rstep,ans;char map[50][50];int mo
2014-12-11 19:17:56
451
原创 省赛总结
第一次知道解放军信息工程大学还是跟园园一起看电影,电影院就在信工对面,当时并不知道今年省赛就在信工,还跟园园开玩笑说莫非省赛就在这里,没想到真是这样! 将近一个月的集训,学到了不少东西,
2014-06-03 22:41:04
583
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人