随笔分类 -  BestCoder

摘要:Dylans loves tree Problem Description Dylans is given a tree with N nodes.All nodes have a value A[i].Nodes on tree is numbered by 1∼N.Then he is give 阅读全文
posted @ 2017-04-10 15:01 meekyan 阅读(219) 评论(0) 推荐(0)
摘要:Fxx and game Fxx and game 问题描述 青年理论计算机科学家Fxx给的学生设计了一款数字游戏。 一开始你将会得到一个数\:XX,每次游戏将给定两个参数\:k,tk,t, 任意时刻你可以对你的数执行下面两个步骤之一: 1.\:X = X - i(1 <= i <= t)1.X=X 阅读全文
posted @ 2016-10-29 21:53 meekyan 阅读(388) 评论(0) 推荐(1)
摘要:Keep In Touch Problem Description There are n cities numbered with successive integers from 1 to n in Byteland. Also, there are m one-way roads connec 阅读全文
posted @ 2016-08-12 17:38 meekyan 阅读(322) 评论(0) 推荐(0)
摘要:Lucky Problem Description WLD is always very lucky.His secret is a lucky number K.k is a fixed odd number. Now he meets a stranger with N numbers:a1,a 阅读全文
posted @ 2016-07-29 11:38 meekyan 阅读(417) 评论(0) 推荐(0)
摘要:XOR 游戏 Problem Description 众所周知,度度熊喜欢XOR运算[(XOR百科)](http://baike.baidu.com/view/674171.htm)。今天,它发明了一种XOR新游戏,最开始,它有一个长度为N的数组,度度熊可以任意添加分割线,将数组划分为M段,且每段长 阅读全文
posted @ 2016-05-30 18:08 meekyan 阅读(334) 评论(0) 推荐(0)
摘要:D Game Problem Description 众所周知,度度熊喜欢的字符只有两个:B 和D。今天,它发明了一个游戏:D游戏。度度熊的英文并不是很高明,所以这里的D,没什么高深的含义,只是代指等差数列[(等差数列百科)](http://baike.baidu.com/view/62268.ht 阅读全文
posted @ 2016-05-22 22:06 meekyan 阅读(684) 评论(2) 推荐(0)
摘要:1001 区间的价值: RMQ+扫描法 我们预处理RMQ求任意区间的最大值 预处理出以a[i]为最小值 能向左延伸 向右延伸的 L[i], R[i] 那么对于 一个答案 (L[i], R[i]) *rmq(L[i],R[i]) 为此长度的答案,我们可以发现他是可以更新到小于其长度的所有长度答案的,更 阅读全文
posted @ 2016-05-22 16:48 meekyan 阅读(1277) 评论(4) 推荐(0)
摘要:Sitting in Line Problem Description 度度熊是他同时代中最伟大的数学家,一切数字都要听命于他。现在,又到了度度熊和他的数字仆人们玩排排坐游戏的时候了。游戏的规则十分简单,参与游戏的N个整数将会做成一排,他们将通过不断交换自己的位置,最终达到所有相邻两数乘积的和最大的 阅读全文
posted @ 2016-05-21 20:33 meekyan 阅读(587) 评论(0) 推荐(0)
摘要:题目链接: http://bestcoder.hdu.edu.cn/contests/contest_show.php?cid=701 1001 : 矩阵快速幂 #include <iostream> #include <algorithm> #include <cstdio> #include < 阅读全文
posted @ 2016-05-21 17:51 meekyan 阅读(789) 评论(2) 推荐(3)
摘要:zxa and leaf Problem Description zxa have an unrooted tree with n nodes, including (n−1) undirected edges, whose nodes are numbered from 1 to n. The d 阅读全文
posted @ 2016-05-15 22:44 meekyan 阅读(208) 评论(0) 推荐(1)
摘要:String Problem Description There is a string S.S only contain lower case English character.(10≤length(S)≤1,000,000)How many substrings there are that 阅读全文
posted @ 2016-04-22 22:23 meekyan 阅读(462) 评论(0) 推荐(0)
摘要:xiaoxin and his watermelon candy Problem Description During his six grade summer vacation, xiaoxin got lots of watermelon candies from his leader when 阅读全文
posted @ 2016-03-30 13:36 meekyan 阅读(212) 评论(0) 推荐(0)
摘要:Bomber Man wants to bomb an Array. Problem Description Given an array and some positions where to plant the bombs, You have to print the Total Maximum 阅读全文
posted @ 2016-03-29 22:39 meekyan 阅读(309) 评论(0) 推荐(0)
摘要:India and China Origins Problem Description A long time ago there are no himalayas between India and China, the both cultures are frequently exchanged 阅读全文
posted @ 2016-03-28 22:30 meekyan 阅读(204) 评论(0) 推荐(0)
摘要:ZYB's Premutation Memory Limit: 131072/131072 K (Java/Others) ZYB's Premutation Memory Limit: 131072/131072 K (Java/Others) Memory Limit: 131072/13107 阅读全文
posted @ 2016-03-24 23:00 meekyan 阅读(215) 评论(0) 推荐(0)
摘要:Toposort 问题描述 给出nn个点mm条边的有向无环图. 要求删掉恰好kk条边使得字典序最小的拓扑序列尽可能小. 输入描述 输入包含多组数据. 第一行有一个整数TT, 表示测试数据组数. 对于每组数据: 第一行包含3个整数nn, mm和kk (1 \le n \le 100000, 0 \le 阅读全文
posted @ 2016-03-05 21:34 meekyan 阅读(575) 评论(2) 推荐(0)
摘要:Jam's balance Problem Description Jim has a balance and N weights. (1≤N≤20)The balance can only tell whether things on different side are the same wei 阅读全文
posted @ 2016-01-30 23:39 meekyan 阅读(278) 评论(0) 推荐(0)
摘要:Sit sit sit问题描述在一个XX大学中有NN张椅子排成一排,椅子上都没有人,每张椅子都有颜色,分别为蓝色或者红色。 接下来依次来了NN个学生,标号依次为1,2,3,...,N。 对于每个学生,他会找一张还没有人坐的椅子坐下来。但是如果这张椅子满足以下三个条件他就不会去坐。1. 这张椅子左右两... 阅读全文
posted @ 2015-12-25 16:20 meekyan 阅读(179) 评论(0) 推荐(0)
摘要:GTW likes functionMemory Limit: 131072/131072 K (Java/Others)问题描述现在给出下列两个定义: f(x)=f_{0}(x)=\sum_{k=0}^{x}(-1)^{k}2^{2x-2k}C_{2x-k+1}^{k},f_{n}(x)=f(f_... 阅读全文
posted @ 2015-12-13 13:34 meekyan 阅读(356) 评论(0) 推荐(0)
摘要:GTW likes gtMemory Limit: 131072/131072 K (Java/Others)问题描述从前,有nn只萌萌的GT,他们分成了两组在一起玩游戏。他们会排列成一排,第ii只GT会随机得到一个能力值b_ib​i​​。在第ii秒的时候,第ii只GT可以消灭掉所有排在他前面的和他... 阅读全文
posted @ 2015-12-13 13:30 meekyan 阅读(271) 评论(0) 推荐(0)