E. Exposition time limit per test 1.5 seconds memory limit per test 64 megabytes input standard input output standard output There are several days left before the fiftieth birthday of a famous Berland's writer Berlbury. In this connection the local…
非原创,搬运至此以作笔记, 原地址:http://www.cnitblog.com/houcy/archive/2012/11/28/86801.html 1.用top命令查看哪个进程占用CPU高gateway网关进程14094占用CPU高达891%,这个数值是进程内各个线程占用CPU的累加值. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 14094 root 15 0 315m…
非原创.来自博客园老赵. public class ViewManager<T> where T : System.Web.UI.UserControl { private System.Web.UI.Page m_pageHolder; public T LoadViewControl(string path) { this.m_pageHolder = new System.Web.UI.Page(); return (T)this.m_pageHolder.LoadControl(pat…
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,所以我们需要枚举一个子树的大小和另一个子树的高,但是…
D. How many trees? time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output In one very old text file there was written Great Wisdom. This Wisdom was so Great that nobody could decipher it, even Phon…
E. Connected Components? time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an undirected graph consisting of n vertices and edges. Instead of giving you the edges that exist in…
Not long ago Billy came across such a problem, where there were given three natural numbers A, B and C from the range [1, N], and it was asked to check whether the equation AB = C is correct. Recently Billy studied the concept of a digital root of a…
C. Looking for Order time limit per test 4 seconds memory limit per test 512 megabytes input standard input output standard output Girl Lena likes it when everything is in order, and looks for order everywhere. Once she was getting ready for the Univ…
E. Bindian Signalizing time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Everyone knows that long ago on the territory of present-day Berland there lived Bindian tribes. Their capital was su…
D. Least Cost Bracket Sequence time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output This is yet another problem on regular bracket sequences. A bracket sequence is called regular, if by inserting…
C. Commentator problem time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for med…
C. Ancient Berland Circus time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different.…
最近在开发一个小的应用,遇到了一些Objective-c上面常用的单例模式,但是swift上面还是有一定区别的,反复倒来倒去发现不能按常理(正常的oc to swift的方式)出牌,因此搜索了一些帖子.可能是xcode或者sdk的问题吧(我相信他们不会把未经测试的代码展示,吧?...),一些帖子中的代码犯了明显的错误,编译失败.于是有了这篇文章,分享给大家. 原作者实现了一种单例,但是红色代码导致非线程安全: class var sharedInstance:TPScopeManager { g…