ZOJ3963-Heap Partition
Heap PartitionTime Limit: 2 Seconds Memory Limit: 65536 KB Special JudgeA sequence S = {s1, s2, ..., sn} is called heapable if there exists a binary tree T with n nodes such that