
tree
轩怡沫
这个作者很懒,什么都没留下…
展开
-
uva 536 Tree Recovery
#include #include #include #include using namespace std;void build(int n, char *s1, char *s2, char *s){ if(n <= 0) return; int p = strchr(s2, s1[0]) - s2; build(p, s1+1, s2, s);原创 2013-06-13 21:57:09 · 518 阅读 · 0 评论 -
uva 122 - Trees on the level
#include #include #include #include #include #include using namespace std;char s[10010];typedef struct Tnode{ int have_value; int v; Tnode *left, *right;} Node;Node *root;int原创 2013-06-13 21:18:14 · 554 阅读 · 0 评论 -
uva 839 - Not so Mobile
#include #include #include #define maxn 20000+10using namespace std;struct node { int data; int ld, rd; node *l, *r;};bool ok;void dfs(node *t){ if(!ok) return; if(t == NU原创 2013-12-01 20:10:45 · 472 阅读 · 0 评论 -
UVA 699 - The Falling Leaves
#include #include #include #include using namespace std;int a[210][210];int sum[210];void creat(int dep, int mid){ int x; scanf("%d", &x); if(x == -1) return; else { a[原创 2013-12-02 07:39:12 · 498 阅读 · 0 评论 -
UVA 297 - Quadtrees
#include #include #include #include #define maxn 20000+10using namespace std;struct node{ int data, flag; node *ll, *l, *r, *rr;};int tmpi;node* &build(int cur, char *s){ node *原创 2013-12-01 20:08:26 · 493 阅读 · 0 评论 -
uva 10562 - Undraw the Trees
#include #include #include #include #include using namespace std;void dfs(char s[210][210], int x, int y, int dep){ for(int i = y; s[x][i] == '-'; ++i) if(s[x+1][i] != ' ' && s[x+1原创 2013-12-03 12:44:16 · 539 阅读 · 0 评论 -
uva 327 - Evaluating Simple C Expressions
#include #include #include #include #include #include using namespace std;int main(){ char s1[11000]; while(gets(s1) != NULL) { printf("Expression: %s\n", s1); int原创 2013-12-02 17:30:01 · 491 阅读 · 0 评论