摘要: 756: 破解 D-H 协议 题目描述 Diffie-Hellman密钥交换协议是一种简单有效的密钥交换方法。它可以让通讯双方在没有事先约定密钥(密码)的情况下,通过不安全的信道(可能被窃听)建立一个安全的密钥K,用于加密之后的通讯内容。假定通讯双方名为Alice和Bob,协议的工作过程描述如下(其 阅读全文
posted @ 2018-08-07 21:18 lglh 阅读(465) 评论(0) 推荐(0) 编辑
摘要: 6760: 九连环 题目描述 九连环是一种源于中国的传统智力游戏。如图所示,九个圆环套在一把“剑”上,并且互相牵连。游戏的目标是把九个圆环从“剑”上卸下。 圆环的装卸需要遵守两个规则。第一个(最右边)环任何时候都可以装上或卸下。如果第k个环没有被卸下,且第k个环右边的所有环都被卸下,则第k+1个环( 阅读全文
posted @ 2018-08-07 20:30 lglh 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.nowcoder.com/acm/contest/163/A来源:牛客网 时间限制:C/C++ 5秒,其他语言10秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 时间限制:C/C++ 5秒,其他语言10秒 空 阅读全文
posted @ 2018-08-06 10:52 lglh 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 问题 D: Distinct Values 题目描述 Chiaki has an array of n positive integers. You are told some facts about the array: for every two elements ai and aj in th 阅读全文
posted @ 2018-08-04 23:48 lglh 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 问题 B: Harvest of Apples 题目描述 There are n apples on a tree, numbered from 1 to n.Count the number of ways to pick at most m apples. 输入 The first line o 阅读全文
posted @ 2018-08-02 11:46 lglh 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 6597: Don't Be a Subsequence 题目描述 A subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without chan 阅读全文
posted @ 2018-08-01 12:39 lglh 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 6603: ConvexScore 题目描述 You are given N points (xi,yi) located on a two-dimensional plane. Consider a subset S of the N points that forms a convex poly 阅读全文
posted @ 2018-08-01 01:00 lglh 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 6888: 守卫 题目描述 九条可怜是一个热爱运动的女孩子。 这一天她去爬山,她的父亲为了她的安全,雇了一些保镖,让他们固定地呆在在山的某些位置,来实时监视九条可怜,从而保护她。 具体来说,一座山可以描述为一条折线,折线的下方是岩石。这条折线有n个折点,每个折点上有一个亭子,第i个折点的坐标是(i, 阅读全文
posted @ 2018-07-31 20:38 lglh 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 问题 H: Trie树 题目描述 字母(Trie)树是一个表示一个字符串集合中所有字符串的前缀的数据结构,其有如下特征:1.树的每一条边表示字母表中的一个字母2.树根表示一个空的前缀3.树上所有其他的节点都表示一个非空前缀,每一个节点表示的前缀为树根到该节点的路径上所有字母依次连接而成的字符串。4. 阅读全文
posted @ 2018-07-31 10:04 lglh 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 6349: Talent Show 题目描述 Farmer John is bringing his N cows, conveniently numbered 1…N, to the county fair, to compete in the annual bovine talent show! 阅读全文
posted @ 2018-07-23 19:21 lglh 阅读(558) 评论(0) 推荐(0) 编辑