Codeforces 9D How many trees? LINK 题目大意就是给你一个n和一个h 问你有多少个n个节点高度不小于h的二叉树 n和h的范围都很小 感觉有无限可能 考虑一下一个很显然的DP dpn,h表示n个节点组成的高度为h的树的方案数dp_{n,h}表示n个节点组成的高度为h的树的方案数dpn,h表示n个节点组成的高度为h的树的方案数 然后考虑咋转移 首先我们可以肆无忌惮地,枚举一下,因为左右子树的高度至少有一个是h-1,所以我们需要枚举一个子树的大小和另一个子树的高,但是…
Coloring Trees Problem Description: ZS the Coder and Chris the Baboon has arrived at Udayland! They walked in the park where n trees grow. They decided to be naughty and color the trees in the park. The trees are numbered with integers from 1 to n fr…
Problem H. ICPC QuestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/attachments Description Noura Boubou is a Syrian volunteer at ACM ACPC (Arab Collegiate Programming Contest) since 2011. She graduated from Tishreen Un…
C. Writing Code Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/544/problem/C Description Programmers working on a large project have just received a task to write exactly m lines of code. There are n programmers working o…