摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4046非线段树的方法,纯模拟。(AC)#include #include #include using namespace std;const int maxn = 50000+5;char str[maxn];int vis[5];int dp[maxn];int main(){ int t,ncas= 1; scanf("%d",&t); while( t-- ) { printf("Case %d:\n",ncas++); int n,m; ... 阅读全文
posted @ 2013-10-22 19:52 清风旋叶 阅读(180) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1754代码:#include#include#includeusing namespace std;#define maxn 200005int tree[4*maxn];void build(int left,int right,int root){ if(left==right) { scanf("%d",&tree[root]); } else { int mid=(left+right)/2; build(left,mid,ro... 阅读全文
posted @ 2013-10-22 19:42 清风旋叶 阅读(220) 评论(0) 推荐(0)