摘要: 先建立一颗二叉搜索树,然后先序遍历一下,就可以出答案了。我用了比较奇葩的写法。。。二叉搜索树结构体模拟了一下。先序遍历用的DFS。。。。。。#include#includestruct abc{ int left; int right; int date;}node[100010]... 阅读全文
posted @ 2015-04-19 11:35 Fighting_Heart 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 简单的二叉搜索树建树过程#include#includeint tree1[1500], tree2[1500];char s[1000], k[1000];void build1(){ int i; tree1[1] = s[0] - '0'; int y = strlen(s)... 阅读全文
posted @ 2015-04-19 09:05 Fighting_Heart 阅读(173) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeint flag[100005];int a[100005];int main(){ int sb; scanf("%d", &sb); int u; for (u = 1; u = maxn) maxn = a[i]; ... 阅读全文
posted @ 2015-04-19 06:04 Fighting_Heart 阅读(185) 评论(0) 推荐(0) 编辑