摘要:
一道典型的搜索题。#include<iostream>#include<cstdio>#include<cstring>using namespace std;char map[124][124];int n,m;int d[8][2] = { -1,-1,0,-1,1,-1,-1,0,1,0,-1,1,0,1,1,1 };void DFS( int x, int y ){ for( int i = 0 ; i< 8 ; i++ ) { int dx = x + d[i][0]; int dy = y + d[i][1]; if( map[dx][dy 阅读全文
摘要:
该题是一道,成段更新,单点查询(简单线段树+简单DP),这个题与http://poj.org/problem?id=1436思想差不多,这里我就不重复了,这里就是要处理最大值的问题也就是DP;我有的方法就是以该条边的两个端点往下搜索,如果下面有可见的边,选择值的那条边,然后再进行更新;#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;class Node{public: int l ,r , sum,cover; }; 阅读全文