A题:
A题题目链接
题目描述: Fibonacci-ish TimeLimit:3000MS MemoryLimit:512MB64-bit integer IO format:%I64dProblem DescriptionYash has recently learnt about the Fibonacci sequence and is very excited about it. He calls a sequence Fi…
Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).
Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的…
Portal. A. Two Regular Polygons
Portal.
正 n n n 边形中心角为 36 0 ∘ n \dfrac{360^\circ}{n} n360∘,正 m m m 边形中心角为 36 0 ∘ m \dfrac{360^\circ}{m} m360∘,若能包含显然要 ( 36 0 ∘ n ) ∣ ( 36 0 ∘ m ) (\dfrac{360^\circ…
105. Construct Binary Tree from Preorder and Inorder Traversal105. Construct Binary Tree from Preorder and Inorder Traversal
题意:根据前序遍历和中序遍历来构造二叉树
我的思路
要用递归造树,要同时递归左子树和右子树,造树需要…
Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:
Emergency 911 Alice 97 625 999 Bob 91 12 54 26 In this case, it’s not possible to c…