摘要: Problem Description A string is called a square string if it can be obtained by concatenating two copies of the same string. For example, "abab", "aa" 阅读全文
posted @ 2016-11-13 15:15 Gealo 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", 阅读全文
posted @ 2016-11-11 15:18 Gealo 阅读(308) 评论(0) 推荐(0) 编辑
摘要: Problem Description You are given two sequence {a1,a2,...,an} and {b1,b2,...,bn}. Both sequences are permutation of {1,2,...,n}. You are going to find 阅读全文
posted @ 2016-11-11 13:29 Gealo 阅读(192) 评论(0) 推荐(0) 编辑
摘要: Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表 阅读全文
posted @ 2016-11-10 21:51 Gealo 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Problem Description 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 p 阅读全文
posted @ 2016-11-10 20:48 Gealo 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Problem Description Given two positive integers a and b,find suitable X and Y to meet the conditions: X+Y=a Least Common Multiple (X, Y) =b Input Inpu 阅读全文
posted @ 2016-11-09 20:58 Gealo 阅读(931) 评论(0) 推荐(0) 编辑
摘要: Problem Description B君和G君聊天的时候想到了如下的问题。给定自然数l和r ,选取2个整数x,y满足l <= x <= y <= r ,使得x|y最大。其中|表示按位或,即C、 C++、 Java中的|运算。 Input 包含至多10001组测试数据。第一行有一个正整数,表示数据 阅读全文
posted @ 2016-11-08 20:57 Gealo 阅读(1039) 评论(0) 推荐(0) 编辑
摘要: 我们称一个有向图G是传递的,当且仅当对任意三个不同的顶点a,,若G中有 一条边从a到b且有一条边从b到c ,则G中同样有一条边从a到c。 我们称图G是一个竞赛图,当且仅当它是一个有向图且它的基图是完全图。换句 话说,将完全图每条边定向将得到一个竞赛图。下图展示的是一个有4个顶点的竞赛图。现在,给你两 阅读全文
posted @ 2016-11-07 21:56 Gealo 阅读(495) 评论(0) 推荐(0) 编辑
摘要: Problem Description Chinese always have the railway tickets problem because of its' huge amount of passangers and stations. Now goverment need you to 阅读全文
posted @ 2016-11-03 20:25 Gealo 阅读(529) 评论(0) 推荐(0) 编辑
摘要: Problem Description For a number,if the length of continuous odd digits is even and the length of continuous even digits is odd,we call it odd-even nu 阅读全文
posted @ 2016-11-03 13:07 Gealo 阅读(236) 评论(0) 推荐(0) 编辑