码迷,mamicode.com
首页 >  
搜索关键字:int    ( 143001个结果
java学习笔记
1 class A 2 { 3 public static final int VAL = 3; // 不会导致A被加载 4 static 5 { 6 System.out.println("load A"); 7 } 8 public A(...
分类:编程语言   时间:2015-05-28 00:15:14    阅读次数:166
poj 1324 Holedox Moving A*算法对bfs的优化
题意: 迷宫里有一条贪食蛇,求它的蛇头到迷宫左上角最少要多少步。 分析: 关键是将蛇的状态压缩编码,然后bfs,超时就改A*,这题有类似最短路径的性质,A*发现节点重复后不需要更新直接舍弃即可。 代码: //poj 1324 //sep9 #include #include #include using namespace std; struct state { int x[1...
分类:编程语言   时间:2015-05-27 23:02:04    阅读次数:277
指针的点运算和箭头运算(->)
指针的点运算和箭头运算(->) 突然发现指针的两个运算符我是不太清楚的,就翻书搞了下:其实点运算和箭头运算都是访问指针所指向的 结构体或者类对象 的成员是用的操作符。比如: struct song { int a; } 有这样一个结构体,定义: song s; s.a=1; song *p; p=&s; 那么要访问指针p所指向的内存: (*)p.a  和  p->a...
分类:其他好文   时间:2015-05-27 22:57:46    阅读次数:190
opencv高效访问图像像素(遍历像素的方法总结)
一、Accessingpixel values访问像素值。(用类自带的方法:方便,但效率不高) 1.      cv::Mat has the a templatemethod at(int y, int x) 用法image.at(j,i)[channel]= value; 注意事项:the programmer needs to specify the return type ...
分类:其他好文   时间:2015-05-27 22:57:10    阅读次数:594
POJ 3984 逃离迷宫
迷宫问题 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10001   Accepted: 5939 Description 定义一个二维数组:  int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, ...
分类:其他好文   时间:2015-05-27 22:54:55    阅读次数:161
hdu 2091 空心三角形
这题还是比较坑的首先要注意两点: 1.行末没有多余的空格; 2.就是当n==1的时候单独判断;#include using namespace std; int main() { char ch; int n,flag=0; while(cin>>ch) { if(ch=='@') break; cin>>n;...
分类:其他好文   时间:2015-05-27 22:54:34    阅读次数:182
有n个整数,使前面各数顺序向后移m个位置,最后m个数变成最前面m个数。编写一个函数实现上述功能,在主函数中输入n个整数,并输出调整后的n个数
第一种方法:指针法 #include #include int  w(int *d,int e,int g) {      int i,j,t;      int *r;      j=0;    for(i=0;i    {      t=*(d+i);     *(d+i)=*(d+e-g+j);     *(d+e-g+j)=t;       j++;       ...
分类:其他好文   时间:2015-05-27 22:50:16    阅读次数:159
poj1274 匈牙利算法 二分图最大匹配
poj1274题意: 有n个奶牛, m个畜舍, 每个畜舍最多装1头牛,每只奶牛只有在自己喜欢的畜舍里才能产奶。 求最大产奶量。 分析: 其实题意很明显, 二分图的最大匹配, 匈牙利算法。#include#include#include#includeusing namespace std;int.....
分类:编程语言   时间:2015-05-27 22:46:28    阅读次数:149
转换操作符(conversion operator)
转换操作符(conversion operator) 是一种特殊的类成员函数。它定义将类类型值转变为其它类型值的转换。 1 classSmallInt 2 { 3 public: 4 SmallInt(int i =0): val(i) 5 { 6 if( i 255...
分类:其他好文   时间:2015-05-27 22:45:28    阅读次数:234
winform禁用标题栏
protected override void WndProc(ref Message m) { if (m.Msg == 0x112) { switch ((int)m.WParam) ...
分类:Windows程序   时间:2015-05-27 22:43:45    阅读次数:323
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!