摘要: Similarity of Subtrees 题目描述 Define the depth of a node in a rooted tree by applying the following rules recursively:·The depth of a root node is 0.·Th 阅读全文
posted @ 2019-09-02 21:07 SpringYEP 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Holy Grail 限制 1000 ms 256 MB As the current heir of a wizarding family with a long history,unfortunately, you fifind yourself forced to participate in 阅读全文
posted @ 2019-09-01 19:58 SpringYEP 阅读(414) 评论(0) 推荐(0) 编辑
摘要: Greedy Sequence 限制 5000 ms 256 MB You're given a permutation a of length n (1 ≤ n ≤ 105). For each i ∈ [1, n], construct a sequence si by the followin 阅读全文
posted @ 2019-09-01 19:53 SpringYEP 阅读(480) 评论(0) 推荐(0) 编辑
摘要: 1 //输入 2 template<class T> 3 inline void read(T&x) 4 { 5 T ans=0,f=1; 6 char ch=getchar(); 7 while(ch>'9'||ch<'0') 8 { 9 if(ch=='-') 10 f=-1; 11 ch=getchar(); 12 } 13 while(ch<='9'&&ch>='0') 14 { 15 a 阅读全文
posted @ 2019-08-26 09:55 SpringYEP 阅读(208) 评论(0) 推荐(0) 编辑
摘要: J: Just Repeat 题目描述 When Cuber QQ was chatting happily in a QQ group one day, he accidentally noticed that there was a counterfeit of him, who stole h 阅读全文
posted @ 2019-08-23 10:23 SpringYEP 阅读(312) 评论(0) 推荐(0) 编辑
摘要: C: Prime-Factor Prime 题目描述 A positive integer is called a "prime-factor prime" when the number of its prime factors is prime. For example, 12 is a pri 阅读全文
posted @ 2019-08-20 22:21 SpringYEP 阅读(233) 评论(0) 推荐(0) 编辑
摘要: permutation 2 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Problem Description You are given three positive inte 阅读全文
posted @ 2019-08-05 20:05 SpringYEP 阅读(182) 评论(0) 推荐(0) 编辑
摘要: [题目大意] n个物品及其体积,用k个相同的箱子装,求能装下这n个物品的箱子的最小容积。 对于一个箱子,每次都先装能装下的最大的物品,不能满足则开始装下一个箱子。 [思路] ans = max ( vol [i] , ceil(sum ( vol [i]] ) / k )) ,while(ans++ 阅读全文
posted @ 2019-08-05 09:23 SpringYEP 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 扶桑号战列舰 题目描述 众所周知,一战过后,在世界列强建造超无畏级战列舰的竞争之中,旧日本海军根据“个舰优越主义”,建造了扶桑级战列舰,完工时为当时世界上武装最为强大的舰只。同时,扶桑号战列舰也是舰岛最为科幻的战列舰。当然,要建造这样的舰船,科技水平是必须的。同样众所周知的是,德意志科学技术天下第一 阅读全文
posted @ 2019-08-05 09:11 SpringYEP 阅读(1063) 评论(0) 推荐(0) 编辑
摘要: [题目大意] 给你n个128位二进制IP地址,输出压缩后的最短的IP地址,如果长度相同,输出字典序最小的那一个。 压缩规则:每16位二进制数为一个域,例如0000000110001111为一个域(压缩后相邻两个域之间用 “:” 分隔开),然后将四位二进制数转换成一位16进制数,如0000000110 阅读全文
posted @ 2019-08-04 16:28 SpringYEP 阅读(286) 评论(0) 推荐(0) 编辑