-
PTA 1167 Cartesian Tree (30 分)
##1167 Cartesian Tree (30 分) A Cartesian tree is a binary tree constructed from a sequence of distinct numbers. The tree is heap-ordered, and an inord -
PTA 1166 Summit (25 分)
##1166 Summit (25 分) A summit (峰会) is a meeting of heads of state or government. Arranging the rest areas for the summit is not a simple job. The idea -
PTA 1165 Block Reversing (25 分)
###1165 Block Reversing (25 分) Given a singly linked list L. Let us consider every K nodes as a block (if there are less than K nodes at the end of th -
PTA 1163 Dijkstra Sequence (30 分)
###1163 Dijkstra Sequence (30 分) Dijkstra's algorithm is one of the very famous greedy algorithms. It is used for solving the single source shortest p -
PTA 1162 Postfix Expression (25 分)
###1162 Postfix Expression (25 分) Given a syntax tree (binary), you are supposed to output the corresponding postfix expression, with parentheses refl -
PTA 1161 Merging Linked Lists (25 分)
###1161 Merging Linked Lists (25 分) Given two singly linked lists L1 = a1 → a2 → ⋯ →an-1 →a n and L2 =b 1 → b2→ ⋯ → bm-1 → bm.If n≥2m, you are suppo -
PTA 1160 Forever (20 分)
###1160 Forever (20 分) "Forever number" is a positive integer A with K digits, satisfying the following constrains: the sum of all the digits of A is