摘要: Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a 阅读全文
posted @ 2017-08-05 19:19 Hunter丶安 阅读(306) 评论(0) 推荐(0) 编辑
摘要: happy_code是一个logo设计的忠实粉丝,最近他爱上了用环设计的logo,不如我们来举几个你可能知道的著名例子: 环是一个二维图并且两个圆共享一个圆心,这两个圆的半径分别是r和R(r小于R), 具体请查看下图: happy_code最近想为集训队设计一个由两个环组成的logo。由于他的数学不 阅读全文
posted @ 2017-08-05 15:17 Hunter丶安 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 2017-08-04 The name of one small but proud corporation consists of n lowercase English letters. The Corporation has decided to try rebranding — an act 阅读全文
posted @ 2017-08-04 19:52 Hunter丶安 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 2017-08-03 20:33:21 You are one of the competitors of the Olympiad in numbers. The problem of this year relates to beatiful numbers. One integer is ca 阅读全文
posted @ 2017-08-03 20:26 Hunter丶安 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 2017-08-03 https://baike.baidu.com/item/%E6%AC%A7%E6%8B%89%E5%87%BD%E6%95%B0?fr=aladdin https://baike.baidu.com/item/%E6%AC%A7%E6%8B%89%E5%87%BD%E6%95 阅读全文
posted @ 2017-08-03 18:02 Hunter丶安 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 卡塔兰数是组合数学中一个常在各种计数问题中出现的数列。仍存有疑惑,之后再解释; As we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come 阅读全文
posted @ 2017-08-03 10:43 Hunter丶安 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 监狱有连续编号为1...N的N个房间,每个房间关押一个犯人,有M种宗教,每个犯人可能信仰其中一种。如果相邻房间的犯人的宗教相同,就可能发生越狱,求有多少种状态可能发生越狱 Input 输入两个整数M,N.1<=M<=10^8,1<=N<=10^12 Output 可能越狱的状态数,模100003取余 阅读全文
posted @ 2017-08-02 19:13 Hunter丶安 阅读(204) 评论(0) 推荐(0) 编辑
摘要: There is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlo 阅读全文
posted @ 2017-08-01 18:47 Hunter丶安 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 作为笔记写的,借鉴性不大。 快速排序是基于分治法基础上的,也就是说大概包含了三部分; 1.划分分区 我之前一直以为二分就是所谓的从中间分开,后来才知道,二分只是将属于不同的情况的以某一值或一点分开而已。而且分区的方法多种多样,我们在这里取一种较为简单的来阐述什么是快速排序。 2.递归求解 分开的区间 阅读全文
posted @ 2017-08-01 15:31 Hunter丶安 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 从数学的角度来说,假设我们有n个集合{{..},{..},.......},而每个集合内又有众多的元素{A,B,C.....},{1,2,3,4......}等等,每个集合的元素都存在这或多或少的联系,什么联系不清楚,但我们只需知道存在这样的关系即可;而突然,我们希望让集合之间也联系起来,而又不想一 阅读全文
posted @ 2017-07-31 16:27 Hunter丶安 阅读(230) 评论(0) 推荐(0) 编辑