摘要:
There is a kind of binary tree named red-black tree in the data structure. It has the following 5 properties: (1) Every node is either red or black. ( 阅读全文
摘要:
According to Wikipedia: "In mathematics and in particular in combinatorics, the Lehmer code is a particular way to encode each possible permutation of 阅读全文
摘要:
Have you ever played the game "Greedy Snake"? In the game, we control the movements of the snake to eat the fruits scattered in the game field, while 阅读全文
摘要:
A circle of friends is a network of friend relationships. If A is a friend of B, then B is considered a friend of A no matter B admits or not, and the 阅读全文
摘要:
Here is a simple intersting letter-moving game. The game starts with 2 strings S and T consist of lower case English letters. S and T contain the same 阅读全文
摘要:
In many research areas, one important target of analyzing data is to find the best "peak shape" out of a huge amount of raw data full of noises. A "pe 阅读全文
摘要:
There are some animals in a zoo which can be described as a grid with N rows and M columns. Your task is to place some obstacles so that no pairs of a 阅读全文
摘要:
There are a lot of tips telling us that some fruits must not be eaten with some other fruits, or we might get ourselves in serious trouble. For exampl 阅读全文
摘要:
An n-gon is a polygon with n sides. For example, a triangle is a 3-gon. Now you are asked to find the best n-gon in a given convex N-gon. The vertices 阅读全文
摘要:
Given a string which contains only lower case letters, how many different non-empty strings you can get if you can keep AT MOST 100 characters in the 阅读全文
摘要:
Larry just studied the algorithm to count number of inversions. He's very interested in it. He's considering another problem: Given a permutation of i 阅读全文
摘要:
真的没骗你,这道才是简单题 —— 对任意给定的不超过 10 的正整数 n,要求你输出 2n。不难吧? 输入格式: 输入在一行中给出一个不超过 10 的正整数 n。 输出格式: 在一行中按照格式 2^n = 计算结果 输出 2n 的值。 输入样例: 5 输出样例: 2^5 = 32 1 i 阅读全文
摘要:
这次真的没骗你 —— 这道超级简单的题目没有任何输入。 你只需要在一行中输出事实:This is a simple problem. 就可以了。 输入样例: 无 输出样例: This is a simple problem. 1 print("This is a simple problem.") 阅读全文
摘要:
这道超级简单的题目没有任何输入。 你只需要把这句很重要的话 —— “I'm gonna WIN!”——连续输出三遍就可以了。 注意每遍占一行,除了每行的回车不能有任何多余字符。 输入样例: 无 输出样例: I'm gonna WIN! I'm gonna WIN! I'm gonna WIN! 1 阅读全文
摘要:
这道超级简单的题目没有任何输入。 你只需要把这句很重要的话 —— “I Love GPLT”——竖着输出就可以了。 所谓“竖着输出”,是指每个字符占一行(包括空格),即每行只能有1个字符和回车。 输入样例: 无 输出样例: I L o v e G P L T 注意:输出的两个空行中各有一个空格。 f 阅读全文
摘要:
一群人坐在一起,每人猜一个 100 以内的数,谁的数字最接近大家平均数的一半就赢。本题就要求你找出其中的赢家。 输入格式: 输入在第一行给出一个正整数N(≤)。随后 N 行,每行给出一个玩家的名字(由不超过8个英文字母组成的字符串)和其猜的正整数(≤ 100)。 输出格式: 在一行中顺序输出:大家平 阅读全文