Problem Statement Aoki loves numerical sequences and trees. One day, Takahashi gave him an integer sequence of length N, a1,a2,…,aN, which made him want to construct a tree. Aoki wants to construct a tree with N vertices numbered 1 through N, such th…
Tree Restoring Time limit : 2sec / Memory limit : 256MB Score : 700 points Problem Statement Aoki loves numerical sequences and trees. One day, Takahashi gave him an integer sequence of length N, a1,a2,…,aN, which made him want to construct a tree. A…
Binary Tree Restoring Time Limit: 1 Second Memory Limit: 65536 KB Special Judge Given two depth-first-search (DFS) sequences of a binary tree, can you find a binary tree which satisfies both of the DFS sequences? Recall that a binary tree i…
地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3965 题目: iven two depth-first-search (DFS) sequences of a binary tree, can you find a binary tree which satisfies both of the DFS sequences? Recall that a binary tree is a tree in which…
AtCoder Grand Contest 005 A - STring 翻译 给定一个只包含\(ST\)的字符串,如果出现了连续的\(ST\),就把他删去,然后所有位置前移.问最后剩下的串长. 题解 模拟栈,和维护括号一样的. #include<iostream> #include<cstring> using namespace std; #define MAX 200200 char ch[MAX]; int ans,tot; int main() { cin>>…