Live2d Test Env

12 2017 档案

摘要:反正就是12.30左右知道他们有比赛,赶紧注册的。。14.30AK,(其中还有E题耽误的不少时间)排名第7。。。可见其题难道。。。难道我是难题渣。。。水题王。。。打表。。。贪心。。。 E题比赛时错了很多次,后来刷新后就A了。。。可能数据有点极端。(耽误了我20分钟。比完才告诉我A了,我以为10题挂机 阅读全文
posted @ 2017-12-30 21:57 nimphy 阅读(433) 评论(0) 推荐(1) 编辑
摘要:Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate 阅读全文
posted @ 2017-12-30 21:33 nimphy 阅读(181) 评论(0) 推荐(0) 编辑
摘要:The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For e 阅读全文
posted @ 2017-12-29 22:41 nimphy 阅读(282) 评论(0) 推荐(0) 编辑
摘要:描述 程序员常常需要给变量命名、给函数命名、给项目命名、给团队命名…… 好的名字可以大大提高程序员的主观能动性,所以很多程序员在起名时都会陷入纠结和烦恼。 小Hi希望给新的项目起个完美的名字。首先小Hi给出了新项目的N个长度相等(均为L)的关键字,他希望能找到一个完美名字:这个名字的长度恰好为N+L 阅读全文
posted @ 2017-12-28 09:30 nimphy 阅读(803) 评论(0) 推荐(0) 编辑
摘要:描述 小Ho居住的城市有N条公交车线路,其中第i条线路上有Ki个车站。 某些线路之间会有公共的车站,小Ho可以在这些车站从一条线路换乘到另一条线路。 现在给定N条公交车线路以及两个车站S和E,你能帮助小Ho计算从S到E最少换乘几次公交车吗? 输入 第一行包含三个整数N,S和E。 以下N行每行描述一条 阅读全文
posted @ 2017-12-28 09:28 nimphy 阅读(578) 评论(0) 推荐(0) 编辑
摘要:描述 如下图所示,在X轴上方一共有N个等腰直角三角形。这些三角形的斜边与X轴重合,斜边的对顶点坐标是(Xi, Yi)。 (11,5) (4,4) /\ /\(7,3) \ / \/\/ \ / /\/\ \ / / /\ \ \ > 你能求出这些三角形覆盖的面积之和吗? (重叠部分只算一次) 输入 阅读全文
posted @ 2017-12-28 09:27 nimphy 阅读(221) 评论(0) 推荐(0) 编辑
摘要:描述 1 2 3 ABC DEF 4 5 6 GHI JKL MNO 7 8 9 PQRS TUV WXYZ * 0 # 我们知道电话拨号盘上数字会有若干字母对应,例如2对应ABC,7对应PQRS。 这是因为在北美尤其是在美国,一些大公司常常把代表其企业名称、产品名称、行业名称等的特定英文单词或字母 阅读全文
posted @ 2017-12-28 09:25 nimphy 阅读(766) 评论(0) 推荐(0) 编辑
摘要:描述 如下图所示,在X轴上方一共有N个三角形。这些三角形的底边与X轴重合,底边上两个顶点的坐标分别是(Li, 0)和(Ri, 0),底边的对顶点坐标是(Xi, Yi)。其中Li ≤ Xi ≤ Ri 且 Li < Ri。 你能求出这些三角形覆盖的面积之和吗? (重叠部分只算一次) 输入 第一行包含一个 阅读全文
posted @ 2017-12-27 17:34 nimphy 阅读(244) 评论(0) 推荐(0) 编辑
摘要:描述 小Ho面前有N个小球排成了一排。每个小球可以被染成M种颜色之一。 为了增强视觉效果,小Ho希望不存在连续K个或者K个以上的小球颜色一样。 你能帮小Ho计算出一共有多少种不同的染色方法么? 例如N=4, M=2, K=3,则有10种染色方法: 0010 0011 0100 0101 0110 1 阅读全文
posted @ 2017-12-27 17:19 nimphy 阅读(471) 评论(0) 推荐(0) 编辑
摘要:描述 小Hi的公司包括CEO在内一共有N名员工。这N名员工的上下级关系形成树形结构,CEO处于树根,普通员工处于叶子节点。 现在公司希望管理扁平化,要求树形结构中的层级不超过L层。此外,假设A是B的直接上级,那么B管理的下属数目必须少于A管理的下属数目。 请你判断CEO至少要管理多少名下属? 例如N 阅读全文
posted @ 2017-12-27 17:17 nimphy 阅读(187) 评论(0) 推荐(0) 编辑
摘要:描述 小A今年刚上幼儿园,正在学习写100以内的数字。幼儿园的老师留了一项作业,要求小A从某个100以内的数X开始一直写到另一个100以内的数Y(Y - X > 1)。 不过粗心的小A在作业中漏写了一个整数(好在小A漏写的不是X,并且至少写下了2个整数)。给定小A写下的数字串,你能求小A漏写的数字是 阅读全文
posted @ 2017-12-27 17:16 nimphy 阅读(237) 评论(0) 推荐(0) 编辑
摘要:描述 给定一个包含N个单词的字典:{W1, W2, W3, ... WN},其中第i个单词Wi有具有一个权值Vi。 现在小Hi要进行M次查询,每次查询包含一个前缀字符串Pi和一个后缀字符串Si。他希望知道同时以Pi为前缀并且以Si为后缀的单词中,权值最大的单词的权值是多少? 假设字典包含"hihoc 阅读全文
posted @ 2017-12-26 20:37 nimphy 阅读(467) 评论(0) 推荐(0) 编辑
摘要:描述 给一个整数N,请你求出以N为分母的最简(既约)真分数中第K小的是多少? 输入 两个整数N个K。 对于30%的数据,1 <= N <= 1000000 对于100%的数据,1 <= N <= 10000000000 且 1 <= K <= φ(N)。其中φ(N)是欧拉函数,也即1~N中与N互质的 阅读全文
posted @ 2017-12-26 20:36 nimphy 阅读(721) 评论(0) 推荐(0) 编辑
摘要:描述 如下图所示,在4x4的棋盘上有X和Y两种棋子各若干枚;O表示空格。 OXXY YOOX XOOY XOXX 小Hi每次可以选择任意一枚棋子,将它移动到上下左右相邻的空格中。 小Hi想知道最少移动多少次可以达到胜利局面:有4个X或者4个Y连成一行、一列或者对角线(两条对角线都算胜利)。 输入 4 阅读全文
posted @ 2017-12-26 20:35 nimphy 阅读(412) 评论(0) 推荐(0) 编辑
摘要:描述 小Hi和小Ho在玩一个战争游戏。游戏中2N个战斗单位,其中第i个单位的战斗力是Ai。 现在小Hi和小Ho要各选N个单位组成队伍,当然他们都希望自己队伍的总战斗力越大越好。 为了使分队更加公平,经过亲切友好的磋商,小Hi和小Ho达成共识按照以下步骤确定分队: 1. 小Ho将2N个单位分成两队,每 阅读全文
posted @ 2017-12-26 20:34 nimphy 阅读(199) 评论(0) 推荐(0) 编辑
摘要:Organizing a programming contest is not an easy job. To avoid making the problems too difficult, the organizer usually expect the contest result satis 阅读全文
posted @ 2017-12-26 16:39 nimphy 阅读(390) 评论(0) 推荐(0) 编辑
摘要:背景 树剖大概算是入门了,树上乱搞系列(直径,重心,树剖,分治,倍增等)可以说都是一种思想,一种手段,而不是一种数据结构。 树剖通过树上面划分链,在链上静态操作(使用线段树,树状态数组,主席树等等工具),实现两点路径上值改变,最值查询,和查询,第k大查询(对象可能是点,可能是边)等功能。 但是如果轻 阅读全文
posted @ 2017-12-26 10:49 nimphy 阅读(199) 评论(0) 推荐(1) 编辑
摘要:The shorter, the simpler. With this problem, you should be convinced of this truth. You are given an array AA of NN postive integers, and MM queries i 阅读全文
posted @ 2017-12-25 09:38 nimphy 阅读(148) 评论(0) 推荐(0) 编辑
摘要:There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and wants to 阅读全文
posted @ 2017-12-24 21:08 nimphy 阅读(482) 评论(0) 推荐(0) 编辑
摘要:描述 给定一个N × M的01矩阵,小Hi希望从中找到一个01间隔的子矩阵,并且子矩阵的面积越大越好。 例如对于 0101010 1000101 0101010 1010101 0101010 在右侧有一个5 × 4的01间隔子矩阵,在下方有一个3 × 7的01间隔子矩阵。 输入 第一行包含两个整数 阅读全文
posted @ 2017-12-24 19:22 nimphy 阅读(496) 评论(0) 推荐(0) 编辑
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定N个区间[Ai, Bi],请你找到包含元素最少的整数集合S,使得每个区间都至少有两个整数在S中。 例如给定三个区间[1, 3], [1, 4], 阅读全文
posted @ 2017-12-24 19:17 nimphy 阅读(460) 评论(0) 推荐(0) 编辑
摘要:描述 给定一个只包含括号和小写字母的字符串S,例如S="a(bc(de)fg)hijk"。 其中括号表示将里面的字符串翻转。(注意括号可能嵌套) 请你输出翻转之后的字符串。 输入 字符串S。 对于50%的数据,|S| ≤ 1000 对于100%的数据, |S| ≤ 5000000 输出 输出反转后的 阅读全文
posted @ 2017-12-24 19:15 nimphy 阅读(712) 评论(0) 推荐(0) 编辑
摘要:描述 H国编程联赛中有N只队伍,编号1~N。 他们计划在2018年一共进行M场一(队)对一(队)的比赛。 为了让参赛队员能得到充分的休息,联赛组委会决定:每支队伍连续两场比赛之间至少间隔一天。也就是如果A队1月1日参加了一场比赛,那么下一场比赛最早安排在1月3日。 给定M场比赛的时间和参赛的两支队伍 阅读全文
posted @ 2017-12-24 19:14 nimphy 阅读(397) 评论(0) 推荐(0) 编辑
摘要:Yixght is a manager of the company called SzqNetwork(SN). Now she's very worried because she has just received a bad news which denotes that DxtNetwor 阅读全文
posted @ 2017-12-21 21:45 nimphy 阅读(376) 评论(0) 推荐(0) 编辑
摘要:A game-board consists of N fields placed around a circle. Fields are successively numbered from1 to N clockwise. In some fields there may be obstacles 阅读全文
posted @ 2017-12-21 16:48 nimphy 阅读(481) 评论(0) 推荐(0) 编辑
摘要:You are given a tree with N nodes. The tree’s nodes are numbered 1 through N and its edges are numbered 1 through N − 1. Each edge is associated with 阅读全文
posted @ 2017-12-21 15:39 nimphy 阅读(198) 评论(0) 推荐(0) 编辑
摘要:After their royal wedding, Jiajia and Wind hid away in XX Village, to enjoy their ordinary happy life. People in XX Village lived in beautiful huts. T 阅读全文
posted @ 2017-12-20 17:30 nimphy 阅读(325) 评论(0) 推荐(0) 编辑
摘要:Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decided to arres 阅读全文
posted @ 2017-12-20 09:06 nimphy 阅读(388) 评论(0) 推荐(0) 编辑
摘要:Give a tree with n vertices,each edge has a length(positive integer less than 1001).Define dist(u,v)=The min distance between node u and v. Give an in 阅读全文
posted @ 2017-12-19 21:47 nimphy 阅读(283) 评论(0) 推荐(0) 编辑
摘要:You are given a tree (an undirected acyclic connected graph) with N nodes, and edges numbered 1, 2, 3...N-1. Each edge has an integer value assigned t 阅读全文
posted @ 2017-12-18 22:26 nimphy 阅读(178) 评论(0) 推荐(0) 编辑
摘要:You are given a node-labeled rooted tree with n nodes. Define the query (x, k): Find the node whose label is k-th largest in the subtree of the node x 阅读全文
posted @ 2017-12-18 22:26 nimphy 阅读(242) 评论(0) 推荐(0) 编辑
摘要:ιYou are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3...N-1. We will ask you to perfrom some instruct 阅读全文
posted @ 2017-12-18 21:57 nimphy 阅读(195) 评论(0) 推荐(0) 编辑
摘要:When ?? was born, seven crows flew in and stopped beside him. In its childhood, ?? had been unfortunately fall into the sea. While it was dying, seven 阅读全文
posted @ 2017-12-17 21:14 nimphy 阅读(270) 评论(0) 推荐(0) 编辑
摘要:Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following: Choo 阅读全文
posted @ 2017-12-17 19:12 nimphy 阅读(229) 评论(0) 推荐(0) 编辑
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Ho在玩一款类似俄罗斯方块的游戏。与原版俄罗斯方块不同的是,落下方块都是长度不一的横向长条,并且不能移动也不能变成竖直方向。 XXXXXX <- 长 阅读全文
posted @ 2017-12-17 16:40 nimphy 阅读(304) 评论(0) 推荐(0) 编辑
摘要:给定一个NxM的01矩阵,小Hi希望从中找到一个01间隔的子方阵,并且方阵的边长越大越好。 例如对于 0100100 1000101 0101010 1010101 0101010 在右下角有一个4x4的01间隔方阵。 Input 第一行包含两个整数N和M。 以下N行M列包含一个NxM的01矩阵。 阅读全文
posted @ 2017-12-17 16:38 nimphy 阅读(282) 评论(2) 推荐(0) 编辑
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定正整数x和k,判断是否存在正整数1 ≤ y ≤ x使得x与y同奇偶且(x!!)/(y!!)的个位数字为k。 其中x!! = x × (x-2) × 阅读全文
posted @ 2017-12-17 16:37 nimphy 阅读(422) 评论(0) 推荐(0) 编辑
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一个N x M的矩阵,请你数一数其中有多少个3 x 3的子矩阵可以构成三阶幻方? 如果3 x 3的矩阵中每一行、每一列和两条对角线上的3个数之和都相等,我们就认为其构成一个三阶幻方。 输入 第一行包含两个整数N和M。( 阅读全文
posted @ 2017-12-17 16:35 nimphy 阅读(723) 评论(0) 推荐(0) 编辑
摘要:One day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥下游过一群鸭,快来快来 数一数,二四六 阅读全文
posted @ 2017-12-17 09:42 nimphy 阅读(622) 评论(0) 推荐(0) 编辑
摘要:Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical, emotiona 阅读全文
posted @ 2017-12-16 20:22 nimphy 阅读(416) 评论(0) 推荐(0) 编辑
摘要:>On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave becau 阅读全文
posted @ 2017-12-16 16:31 nimphy 阅读(335) 评论(0) 推荐(0) 编辑
摘要:Problem Description Although winter is far away, squirrels have to work day and night to save beans. They need plenty of food to get through those lon 阅读全文
posted @ 2017-12-16 14:43 nimphy 阅读(257) 评论(0) 推荐(0) 编辑
摘要:(From:离殇灬孤狼) 这个Lucas定理是解决组合数的时候用的,当然是比较大的组合数了。比如C(1000000,50000)% mod,这个mod肯定是要取的,要不算出来真的是天文数字了。 对于一个组合数C(n,k),它等于 n! / ( k! * ( n - k)! ) 我们要求一个mod。但 阅读全文
posted @ 2017-12-15 23:41 nimphy 阅读(257) 评论(0) 推荐(1) 编辑
摘要:495. Kids and Prizes Time limit per test: 0.25 second(s) Memory limit: 262144 kilobytes input: standard output: standard ICPC (International Cardboard 阅读全文
posted @ 2017-12-15 22:39 nimphy 阅读(923) 评论(1) 推荐(0) 编辑
摘要:The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains to watch fairies dancing i 阅读全文
posted @ 2017-12-15 21:31 nimphy 阅读(468) 评论(0) 推荐(0) 编辑
摘要:BuggyD loves to carry his favorite die around. Perhaps you wonder why it's his favorite? Well, his die is magical and can be transformed into an N-sid 阅读全文
posted @ 2017-12-15 14:12 nimphy 阅读(2062) 评论(2) 推荐(2) 编辑
摘要:There is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. Die1 has K1 faces. Die2 has K2 faces. Die3 has K3 阅读全文
posted @ 2017-12-15 12:57 nimphy 阅读(801) 评论(0) 推荐(0) 编辑
摘要:In 0th day, there are n-1 people and 1 bloodsucker. Every day, two and only two of them meet. Nothing will happen if they are of the same species, tha 阅读全文
posted @ 2017-12-15 10:52 nimphy 阅读(685) 评论(0) 推荐(0) 编辑
摘要:Akemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl). Homura wants to help her friend Madoka save the world. But because of the plot of the Boss 阅读全文
posted @ 2017-12-14 20:53 nimphy 阅读(740) 评论(1) 推荐(2) 编辑
摘要:When wake up, lxhgww find himself in a huge maze. The maze consisted by N rooms and tunnels connecting these rooms. Each pair of rooms is connected by 阅读全文
posted @ 2017-12-14 20:17 nimphy 阅读(749) 评论(0) 推荐(1) 编辑
摘要:Background If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and t 阅读全文
posted @ 2017-12-14 15:45 nimphy 阅读(878) 评论(4) 推荐(1) 编辑
摘要:问题: Amateur astronomers Tom and Bob try to find radio broadcasts of extraterrestrial civilizations in the air. Recently they received some strange sig 阅读全文
posted @ 2017-12-13 19:39 nimphy 阅读(193) 评论(0) 推荐(0) 编辑
摘要:Beside other services, ACM helps companies to clearly state their “corporate identity”, which includes company logo but also other signs, like tradema 阅读全文
posted @ 2017-12-13 18:02 nimphy 阅读(272) 评论(1) 推荐(0) 编辑
摘要:后缀家族已知成员 后缀树 后缀数组 后缀自动机 后缀仙人掌 后缀预言 后缀Splay ? 后缀树是后缀数组和后缀自动机的祖先? 功能还是比较强大的,在回文串或者字典序方面还是有用处。 而且现在已经有了线性的建树方法。 (但其实我也没用过后缀树。)下面对比后缀自动机和后缀数组 单个字符串问题 不等号是 阅读全文
posted @ 2017-12-13 08:22 nimphy 阅读(2289) 评论(0) 推荐(3) 编辑
摘要:Oimaster and sevenk love each other. 题意: 给定一些模板串,询问每个匹配串在多少个模板串里出现过。 思路: 后缀数组办法: 全部模板串连接在一起SA排序,SA数组附件的串里面去验证原串,还没写,我说不清楚,大概是后缀数组+RMQ处理。 后缀自动机办法: 1,广义 阅读全文
posted @ 2017-12-11 17:54 nimphy 阅读(537) 评论(0) 推荐(0) 编辑
摘要:You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, ey 阅读全文
posted @ 2017-12-11 17:42 nimphy 阅读(585) 评论(0) 推荐(0) 编辑
摘要:Background Before Albanian people could bear with the freedom of speech (this story is fully described in the problem "Freedom of speech"), another fr 阅读全文
posted @ 2017-12-11 09:42 nimphy 阅读(276) 评论(0) 推荐(0) 编辑
摘要:Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate 阅读全文
posted @ 2017-12-10 14:39 nimphy 阅读(455) 评论(0) 推荐(0) 编辑
摘要:问题: The little cat is majoring in physics in the capital of Byterland. A piece of sad news comes to him these days: his mother is getting ill. Being w 阅读全文
posted @ 2017-12-10 11:17 nimphy 阅读(220) 评论(0) 推荐(0) 编辑
摘要:Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20;Each test case consists of one strin 阅读全文
posted @ 2017-12-10 09:22 nimphy 阅读(327) 评论(0) 推荐(0) 编辑
摘要:个人感觉: 之前觉得后缀自动机会了,就忽略了后缀数组,现在发现后缀数组+二分的功能很强,而且后缀自动机好像很难实现。 后缀数组可以结合二分,结合树状数组,甚至结合splay等数据结构来处理rmq,lca等问题。。。所以又从头开始搞后缀数组了。 (找不到原博主网站了,失误) 后缀数组解题总结: 单个字 阅读全文
posted @ 2017-12-10 00:25 nimphy 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Time limit per test: 2.0 seconds Memory limit: 512 megabytes Time limit per test: 2.0 seconds Memory limit: 512 megabytes Time limit per test: 2.0 sec 阅读全文
posted @ 2017-12-09 13:05 nimphy 阅读(520) 评论(8) 推荐(0) 编辑
摘要:Time limit per test: 1.0 seconds Memory limit: 256 megabytes Time limit per test: 1.0 seconds Memory limit: 256 megabytes Time limit per test: 1.0 sec 阅读全文
posted @ 2017-12-09 12:57 nimphy 阅读(287) 评论(0) 推荐(0) 编辑
摘要:Time limit per test: 1.0 seconds Memory limit: 256 megabytes Time limit per test: 1.0 seconds Memory limit: 256 megabytes Time limit per test: 1.0 sec 阅读全文
posted @ 2017-12-09 12:54 nimphy 阅读(358) 评论(0) 推荐(0) 编辑
摘要:Time limit per test: 2.0 seconds Memory limit: 256 megabytes Time limit per test: 2.0 seconds Memory limit: 256 megabytes Time limit per test: 2.0 sec 阅读全文
posted @ 2017-12-09 12:50 nimphy 阅读(756) 评论(0) 推荐(0) 编辑
摘要:Time limit per test: 1.0 seconds Memory limit: 256 megabytes Time limit per test: 1.0 seconds Memory limit: 256 megabytes Time limit per test: 1.0 sec 阅读全文
posted @ 2017-12-09 12:44 nimphy 阅读(194) 评论(0) 推荐(0) 编辑
摘要:问题: Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets 阅读全文
posted @ 2017-12-08 12:21 nimphy 阅读(220) 评论(0) 推荐(0) 编辑
摘要:问题: You live in a village but work in another village. You decided to follow the straight path between your house (A) and the working place (B), but t 阅读全文
posted @ 2017-12-08 10:21 nimphy 阅读(1110) 评论(0) 推荐(0) 编辑
摘要:A substring of a string T is defined as: T( i, k)= TiTi +1... Ti+k -1, 1≤ i≤ i+k-1≤| T|. Given two strings A, B and one integer K, we define S, a set 阅读全文
posted @ 2017-12-06 22:35 nimphy 阅读(205) 评论(0) 推荐(0) 编辑
摘要:Once upon a time there was a famous actress. As you may expect, she played mostly Antique Comedies most of all. All the people loved her. But she was 阅读全文
posted @ 2017-12-06 17:31 nimphy 阅读(151) 评论(0) 推荐(0) 编辑
摘要:时间限制:24000ms 单点时限:3000ms 内存限制:256MB 时间限制:24000ms 单点时限:3000ms 内存限制:256MB 描述 给定 n 和 k。计算有多少长度为 k 的数组 a1, a2, ..., ak,(0≤ai) 满足: a1 + a2 + ... + ak = n。 阅读全文
posted @ 2017-12-05 11:11 nimphy 阅读(370) 评论(0) 推荐(0) 编辑
摘要:描述 小Hi和小Ho正在进行一项基因工程实验。他们要修改一段长度为N的DNA序列,使得这段DNA上最前面的K个碱基组成的序列与最后面的K个碱基组成的序列完全一致。 例如对于序列"ATCGATAC"和K=2,可以通过将第二个碱基修改为"C"使得最前面2个碱基与最后面两个碱基都为"AC"。当然还存在其他 阅读全文
posted @ 2017-12-05 10:07 nimphy 阅读(297) 评论(0) 推荐(0) 编辑
摘要:题意: 给出一个矩阵,初始每个位置上的值都为0,然后有两种操作 一种是更改某个位置上的值 另一种是求某个位置附近曼哈顿距离不大于K的所有位置的值的总和 技巧: 坐标旋转,使得操作之后菱形变成方方正正的矩形,(即“曼哈顿距离”转化为“切比雪夫距离”)方便使用树状数组进行计算。 利用哈希进行离散,节约空 阅读全文
posted @ 2017-12-04 13:57 nimphy 阅读(357) 评论(0) 推荐(0) 编辑
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 You are given an N × N matrix. At the beginning every element is 0. Write a 阅读全文
posted @ 2017-12-04 08:02 nimphy 阅读(255) 评论(0) 推荐(0) 编辑
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Given a directed graph containing n vertice (numbered from 1 to n) and m edges. Can you tell us how many differ 阅读全文
posted @ 2017-12-03 21:53 nimphy 阅读(260) 评论(0) 推荐(1) 编辑
摘要:问题: Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where h 阅读全文
posted @ 2017-12-03 19:51 nimphy 阅读(579) 评论(0) 推荐(0) 编辑
摘要:问题 Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atom 阅读全文
posted @ 2017-12-03 16:24 nimphy 阅读(375) 评论(0) 推荐(0) 编辑
摘要:问题 The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hir 阅读全文
posted @ 2017-12-03 15:24 nimphy 阅读(247) 评论(0) 推荐(0) 编辑
摘要:问题描述 司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示 阅读全文
posted @ 2017-12-03 12:14 nimphy 阅读(351) 评论(0) 推荐(0) 编辑
摘要:Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some 阅读全文
posted @ 2017-12-03 10:49 nimphy 阅读(250) 评论(0) 推荐(0) 编辑
摘要:描述 兔子们在玩k个串的游戏。首先,它们拿出了一个长度为n的数字序列,选出其中的一个连续子串,然后统计其子串中所有数字之和(注意这里重复出现的数字只被统计一次)。 兔子们想知道,在这个数字序列所有连续的子串中,按照以上方式统计其所有数字之和,第k大的和是多少。 输入 第一行,两个整数n和k,分别表示 阅读全文
posted @ 2017-12-03 09:37 nimphy 阅读(323) 评论(0) 推荐(0) 编辑
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 What is possibility of rolling N dice and the sum of the numbers equals to  阅读全文
posted @ 2017-12-02 21:29 nimphy 阅读(257) 评论(0) 推荐(0) 编辑
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Little Hi and Little Ho are playing a game. There is an integer array in fr 阅读全文
posted @ 2017-12-02 21:02 nimphy 阅读(262) 评论(0) 推荐(0) 编辑
摘要:描述 小Hi和小Ho破解了一道又一道难题,终于来到了最后一关。只要打开眼前的宝箱就可以通关这个游戏了。 宝箱被一种奇怪的机关锁住: 这个机关是一个圆环,一共有2^N个区域,每个区域都可以改变颜色,在黑白两种颜色之间切换。 小Ho控制主角在周围探索了一下,果然又发现了一个纸片: 机关黑色的部分表示为1 阅读全文
posted @ 2017-12-02 20:36 nimphy 阅读(335) 评论(0) 推荐(0) 编辑
摘要:描述 在上一回中小Hi和小Ho控制着主角收集了分散在各个木桥上的道具,这些道具其实是一块一块骨牌。 主角继续往前走,面前出现了一座石桥,石桥的尽头有一道火焰墙,似乎无法通过。 小Hi注意到在桥头有一张小纸片,于是控制主角捡起了这张纸片,只见上面写着: 将M块骨牌首尾相连放置于石桥的凹糟中,即可关闭火 阅读全文
posted @ 2017-12-02 19:35 nimphy 阅读(369) 评论(0) 推荐(0) 编辑
摘要:Problem Description Jimmy wants to make a special necklace for his girlfriend. He bought many beads with various sizes, and no two beads are with the 阅读全文
posted @ 2017-12-02 14:52 nimphy 阅读(376) 评论(0) 推荐(0) 编辑
摘要:之前总结了一下我觉得有用的erase,lower_bound,upper_bound。 现在总结一下unique,unique的作用是“去掉”容器中相邻元素的重复元素(不一定要求数组有序),它会把重复的元素添加到容器末尾(所以数组大小并没有改变),而返回值是去重之后的尾地址,下面举个例子。 由于返回 阅读全文
posted @ 2017-12-01 18:33 nimphy 阅读(27000) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示