摘要: 天梯赛每年有大量参赛队员,要保证同一所学校的所有队员都不能相邻,分配座位就成为一件比较麻烦的事情。为此我们制定如下策略:假设某赛场有 N 所学校参赛,第 i 所学校有 M[i] 支队伍,每队 10 位参赛选手。令每校选手排成一列纵队,第 i+1 队的选手排在第 i 队选手之后。从第 1 所学校开始, 阅读全文
posted @ 2018-12-02 21:46 lu_nacy 阅读(1831) 评论(0) 推荐(0) 编辑
摘要: 给定一个完全由小写英文字母组成的字符串等差递增序列,该序列中的每个字符串的长度固定为 L,从 L 个 a 开始,以 1 为步长递增。例如当 L 为 3 时,序列为 { aaa, aab, aac, ..., aaz, aba, abb, ..., abz, ..., zzz }。这个序列的倒数第27 阅读全文
posted @ 2018-12-02 20:57 lu_nacy 阅读(979) 评论(0) 推荐(0) 编辑
摘要: A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Specification: Each inp 阅读全文
posted @ 2018-11-30 21:52 lu_nacy 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 你在一栋楼房下面,楼房一共有n层,第i层每秒有pi的概率会扔下一个东西并砸到你 求第一秒内你被砸到的概率 输入描述: 第一行一个整数n之后有n行,第i+1行有两个整数a i ,b i ,表示 输出描述: 设答案为 ,你只需要找到一个最小的非负整数T,使得 输出这个T就行了 示例1 输入 复制 2 1 阅读全文
posted @ 2018-11-24 22:17 lu_nacy 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Problem Statement We have a sequence of length N consisting of non-negative integers. Consider performing the following operation on this sequence unt 阅读全文
posted @ 2018-11-24 22:11 lu_nacy 阅读(203) 评论(0) 推荐(0) 编辑
摘要: As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some ro 阅读全文
posted @ 2018-11-22 09:27 lu_nacy 阅读(289) 评论(0) 推荐(0) 编辑
摘要: Description:Goldbach's conjecture is one of the oldest and best-known unsolved problems in number theory and all of mathematics. It states:Every even 阅读全文
posted @ 2018-11-16 23:21 lu_nacy 阅读(252) 评论(0) 推荐(0) 编辑
摘要: Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game, player #1 阅读全文
posted @ 2018-11-16 23:16 lu_nacy 阅读(569) 评论(0) 推荐(0) 编辑
摘要: Vasiliy has an exam period which will continue for n days. He has to pass exams on m subjects. Subjects are numbered from 1 to m.About every day we kn 阅读全文
posted @ 2018-11-16 23:12 lu_nacy 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input ... 阅读全文
posted @ 2018-11-08 08:50 lu_nacy 阅读(182) 评论(0) 推荐(0) 编辑