摘要:
http://poj.org/problem?id=1562 水题。code:#include<cstdio>#include<cstring>inttur[8][2]={-1,-1,-1,0,-1,1,1,-1,1,0,1,1,0,1,0,-1};charmap[101][101];intn,m,ans,num;boolvis[101][101];structnode{intx,y;}coor[10005];boolinmap(nodep){if(p.x>=0&&p.x<n&&p.y>=0&&p.y&l 阅读全文
摘要:
http://poj.org/problem?id=2907 挺简单的一题,但是上来就给想错了。应该是按各个可用点搜索,累加各点间距离取最小,我想的是按坐标全搜,标记过程值。code:#include<cstdio>#include<cstring>usingnamespacestd;constintMAX=1e8;intn,m,sx,sy,num,ans;structnode{intx,y;boolvis;}bee[11];intdis(intp,intq){intdx=bee[p].x-bee[q].x<0?bee[q].x-bee[p].x:bee[p].x 阅读全文