题目描述 Every year,prince prepares a birthday gift for princess.The gift is a box,which is decorated with jewel.As princess grows older,the level of the jewelry box gradually increase from A to Y.Every level N jewelry box will be packed in level (N-1)
D: 399. Who Is Joyful 时间限制 3000 ms 内存限制 65536 KB 题目描述 There are several little buddies standing in a line. We say someone is a joyful little buddy, if there exists a little buddy whose height is smaller than him in the front of him and there exists a
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">完全没状态的新生归来赛,虐的很惨</span> A Hard Game And it's now going to be a hard game. N piles of coins are put down on the ground, where each piles co
前言:之前我的iptv能够用,可是有次我安装了realplayer,它就偷偷把iptv文件的默认打开方式给篡改了,卸载了 realplayer之后,iptv不能直接用WindowsMediaplayer打开. 原因:mms文件的打开方式被篡改(比方CCTV-5:mms://officetv.bupt.edu.cn/CCTV-5) 解决的方法:Win7下控制面板→程序→默认程序→将文件类型或协议与程序关联 找到mms: 找到mms 关联到 Windows Medi
I. Beautiful Array 2017- BUPT Collegiate Programming Contest - sync 时间限制 1000 ms 内存限制 65536 KB 题目描述 We call an array "beautiful array of level L", when all its adjacent number pairs have common factor greater than or equal to L. Obviously, a &qu
H. Black-white Tree 2017- BUPT Collegiate Programming Contest - sync 时间限制 1000 ms 内存限制 65536 KB 题目描述 Alice and Bob take turns to perform operations on a rooted tree of size n. The tree is rooted at node 1, with each node colored either black or white
F. Gabriel's Pocket Money 2017- BUPT Collegiate Programming Contest - sync 时间限制 2000 ms 内存限制 65536 KB 题目描述 For centuries, Heaven has required its young angels to live and study among humans in order to become full-fledged angels. This is no different
思路分析:思路应该比较简单也很容易想的来,就是比较两个节点的最近的祖先节点,要对每个节点依次记录下他的所有祖先节点,包括其自己,因为自己也算自己的祖先节点,这一点题目中没有明确指出 所以比较坑. 我们可以用一个数组表示某个节点的父节点是谁,在判断的时候顺着数组遍历下去就能达到根节点1,并依次记录下该节点的所有的祖先节点.再与另外一个节点的所有的祖先进行比较. Problem C. 最近公共祖先 题目描述 给出一棵有N个节点的有根树TREE(根的编号为1),对于每组查询,请输出树上节点u和v的
103. 反转单词 时间限制 1000 ms 内存限制 65536 KB 题目描述 给出一句英文句子(只由大小写字母和空格组成,不含标点符号,也不会出现连续的空格),请将其中的所有单词顺序翻转 输入格式 多组数据,以EOF结束. 每行一句英文句子(确保只由大小写字母和空格组成,不含标点符号,也不会出现连续的空格,字符串总长度1000以内) 输出格式 每组数据输出一行,为反转后的字符串 输入样例 It is a apple 输出样例 apple a is It eof: 在window下时是ctr