摘要: 可以用朴素算法,在TYVJ上2000ms,别的评测机可能超时,所以修改成了线段树的,代码如下:#include <stdio.h>#include <stdlib.h>struct tree{ int l, r; int ll, rr; int xor;}tree[100001];int end;int num[50000];int maketree(int s, int t){ int l = end++; tree[l].l = s; tree[l].r = t; if(s == t){ tree[l].ll = tree[l].rr = -1; tree[l].x 阅读全文
posted @ 2011-08-09 17:20 zqynux 阅读(217) 评论(0) 推荐(0) 编辑