- 博客(73)
- 收藏
- 关注
原创 2016HDU多校赛第4场(hdu5765 hdu5769 hdu5772)
2016HDU多校赛第4场(hdu5765 hdu5769 hdu5772)
2016-07-30 00:47:49
1321
原创 Codeforces 482C Game with Strings
Game with Str You play the game with your friend. The description of this game is listed below.Your friend creates n distinct strings of the same length m and tells you all the strings.
2016-07-27 10:45:49
738
原创 2016HDU多校赛第1场
1005 Necklace (hdu5727)题目SJX has 2*N magic gems. N of them have Yin energy inside while others have Yang energy. SJX wants to make a necklace with these magic gems for his beloved BHB. To avoid making
2016-07-20 11:30:12
1582
原创 std::set::lower_bound与std::lower_bound的效率问题
lower_bound是大家很常使用的函数,但是在对容器使用时,尽量使用容器本身的lower_bound / upper_bound.std::set::lower_bound与std::lower_bound的效率问题这个问题可能大家觉得只差那么一点点,恰恰相反,两者效率相差大的几乎是天壤之别。在最近的cf round359(div2)的D题里,我和标程解法一模一样,但是一个是700msAC但是我
2016-06-24 14:00:14
6297
原创 Ubuntu16.04安装中文输入法
秉承着原生的原则,我安装了英文版的ubuntu,然后就会有一个很脑残的问题,没有中文输入法。其实我最后也不太清楚怎么搞出来的,就是把fcitx相关的各种包一顿乱装,最后也调不出来。后来网上有人说要添加一下语言,在语言支持那里安装完中文之后,又搞了一个fcitx-rime?没记错的话。反正最后能用了。
2016-06-17 23:15:32
2731
原创 Ubuntu 16.04安装GNOME3 + ARC主题
今天看到同学的GNOME3 + ARC主题感觉很赞。 自己也想弄一个。安装GNOME3其实有一个更简单粗暴的办法是直接装 UBUNTU GNOME发行版,但是当我安装完UBUNTU16的时候,我真的不想重新装一遍系统。所以就在原有基础上安装gnome3,很多人觉得用不习惯,其实桌面环境这个还是挺方便的。sudo apt-get install gnome-shellsudo apt-get ins
2016-06-17 23:11:05
66149
1
原创 github配置ssh
github配置ssh配置ssh时候老是把命令忘掉,写个博客记录一下。在~/.ssh目录下: ssh-keygen -t rsa -C “your_email@example.com”生成了id_rsa.pub然后 clip < ~/.ssh/id_rsa.pub粘贴到github上,大功告成。
2016-04-26 21:43:53
563
原创 Ubuntu 15.10安装Swift
下载SWIFT起初在Linux公社看复杂的安装步骤把我吓了一跳,其实没有那么复杂。1.下载很简单,去swift.org下载一个就好了。2. 解压缩不多讲tar -zxvf安装必须的软件包sudo apt-get install git cmake ninja-build clang uuid-dev libicu-dev icu-devtools libbsd-dev配置环境变量先cd ~然后ged
2016-03-13 22:31:24
684
原创 CodeForces 479E E. Riding in a Lift
CodeForces 479E E. Riding in a Lift题目 Imagine that you are in a building that has exactly n floors. You can move between the floors in a lift. Let’s number the floors from bottom to top with integers
2016-02-26 19:00:57
1095
原创 BestCoder Round #71 (div.1)题解
BestCoder Round #71 (div.1)1004 题目描述 我们可爱的KK有一道困难的社会性题目:他所在的地区发生了一场大地震(如此老套的出题思路~!),一共有N( 2<= N<= 2000)个城市受到了牵连,N个城市间所有道路都已损坏,现在KK受委托要重修这些道路。然而,经过KK的实地考察发现,很多城市间道路的地基都被破坏了,无法再重修道路,因此可供修建的道路只有MM(0≤M≤1
2016-02-06 21:59:54
555
原创 卡特兰数
出栈序列问题其实这个假期学长讲过了,给忘了,还是自己写一遍记一下出栈次序问题。一个栈(无穷大)的进栈序列为1、2、3、…、n,有多少个不同的出栈序 类似:一位大城市的律师在他住所以北n个街区和以东n个街区处工作,每天她走2n个街区去上班。如果他从不穿越(但可以碰到)从家到办公室的对角线,那么有多少条可能的道路?(引用自http://blog.csdn.net/hackbuteer1/artic
2016-01-23 10:51:53
540
原创 Codeforces Round #323
B. Once Again…题面 You are given an array of positive integers a1, a2, …, an × T of length n × T. We know that for any i > n it is true that ai = ai - n. Find the length of the longest non-decreasing s
2015-10-06 16:13:11
688
原创 涨了两个大姿势
这几天被代码折磨。最后终于涨了一个大姿势二分中的精度问题昨晚cf怒A三题以为是要上100分的节奏,就够system judge还是跪了一个三分。这是明明是PQ god 教过的, 写题时候完全抛在脑后了- - 开心的A掉pretest,又开心的WA一定要用for循环!!! 来个100次。 精度到 log10(2^100) 妥妥的。从此while与我无关 //专业立flagmemset问题!!!虽
2015-09-17 21:30:15
577
原创 Codeforces掉分记 round318(div2)
codeforces round318 Bear and Elections Limak is a grizzly bear who desires power and adoration.Lim He wants to win in upcoming election Bear and Drawing Limak is a little bear who learns to draw. People usually
2015-08-30 11:55:13
1275
原创 2014ACM/ICPC亚洲区北京站
2014ACM/ICPC亚洲区北京站(HDU5112-5122)(以下题目描述摘自UVA LIVE)H题题目描述 Matt has N friends. They are playing a game together. Each of Matt’s friends has a magic number. In the game, Matt selects some (could be z
2015-08-29 17:14:35
787
原创 RGCDQ (HDU5317)
RGCDQ题目描述 Mr. Hdu is interested in Greatest Common Divisor (GCD). He wants to find more and more interesting things about GCD. Today He comes up with Range Greatest Common Divisor Query (RGCDQ). What
2015-08-26 21:52:46
656
原创 HDU4497 GCD and LCM
HDU4497 GCD and LCM题目描述 Given two positive integers G and L, could you tell me how many solutions of (x, y, z) there are, satisfying that gcd(x, y, z) = G and lcm(x, y, z) = L? Note, gcd(x, y, z)
2015-08-17 22:47:32
827
原创 ACM ICPC 2013-2014. NEERC. Eastern Subregional Contest
ACM ICPC 2013-2014. NEERC. Eastern Subregional Contest今 Cloners from the Kamino planet breed some of the finest clones. Such good results are due to the careful management
2015-08-16 01:13:34
1753
原创 HDU1466 计算直线的交点数
计算直线的交点数 HDU1466题目描述 平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。 比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。Sample Input 2 3Sample Output 0 1 0 2 3 解法动态规划的思想,考虑dp[i]:dp[i]代表有 i 条直线时交点个数的集合 先将前 i - 1 条直线分为两
2015-08-15 01:05:01
554
原创 Codeforces 掉分记 round316(div2)
Codeforces 掉分记 round316(div2) Roman planted a tree consisting of n vertices. Each vertex contains a lowercase English letter. Vertex 1 is the root of the tree, each of the n - 1 remaining vertices has a pare
2015-08-14 18:20:15
1323
原创 最大连续子段和、M子段和
最大子段和 (HDU1231)题目就是给你一个序列,你找到其中和最大的子序列。最大M子段和:HDU1024这是最基础的DP:dp[i] 表示当最大子序列包括a[i]时最大子段和。如果dp[i-1] #includeusing namespace std;const int SIZE = 10005;int N;int A[SIZE];int dp[SIZE];int main
2015-08-10 12:17:50
644
原创 HDU5353 Average
HDU5353 Average here are n soda sitting around a round table. soda are numbered from 1 to n and i-th soda is adjacent to (i+1)-th soda, 1-st soda is adjacent
2015-08-08 23:34:07
507
原创 HDU1561 树形DP The more, The Better
Problem DescriptionACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗? 查了一些博客都说是裸背包,
2015-08-08 10:18:24
462
原创 Number Sequence HDU1711 (kmp)
Problem DescriptionGiven 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 number K which make a[K] =
2015-08-05 10:05:09
677
1
原创 N骑士问题 HDU4529
最近,郑厂长对八皇后问题很感兴趣,拿着国际象棋研究了好几天,终于研究透了。兴奋之余,坐在棋盘前的他又开始无聊了。无意间,他看见眼前的棋盘上只摆了八个皇后,感觉空荡荡的,恰好又发现身边还有几个骑士,于是,他想把这些骑士也摆到棋盘上去,当然棋盘上的一个位置只能放一个棋子。因为受八皇后问题的影响,他希望自己把这些骑士摆上去之后,也要满足每2个骑士之间不能相互攻击。 现在郑厂长想知道共有多少种摆法,你能
2015-08-04 10:37:55
1113
原创 矩形包围起来的面积最小的矩形的面积(HDU5251)
Problem Description 小度熊有一个桌面,小度熊剪了很多矩形放在桌面上,小度熊想知道能把这些矩形包围起来的面积最小的矩形的面积是多少。Input 第一行一个正整数 T,代表测试数据组数(1≤T≤20),接下来 T 组测试数据。每组测试数据占若干行,第一行一个正整数 N(1≤N<≤1000),代表矩形的数量。接下来 N 行,每行 8 个整数x1,y1,x2,y2,x3,y3,x4,
2015-08-03 11:48:54
833
转载 计算几何中的精度问题
转自:http://www.cnblogs.com/acsmile/archive/2011/05/09/2040918.html计算几何的精度问题说到底其实是浮点数的精度问题,但我觉得“计算几何”比“浮点数”更能吸引眼球,所以选了这个标题。1.浮点数为啥会有精度问题:浮点数(以C/C++为准),一般用的较多的是float, double。占
2015-08-02 23:34:40
673
原创 BestCoder 1st Anniversary 1003(HDU5312)
问题描述 BestCoder 1st Anniversary 1003(HDU5312) Soda习得了一个数列, 数列的第n(n≥1)项是3n(n-1)+1. 现在他想知道对于一个给定的整数m, 是否可以表示成若干项上述数列的和. 如果可以, 那么需要的最小项数是多少? 输出最小花费这道题很容易被当成贪心,然后就跪了。后来看了题解也理解了很久,是三角形数的题,构造很巧妙。 这个题
2015-08-01 18:36:57
665
原创 POJ3177 求边双连通分量
POJ这两天真是专业坑人啊,每次被坑都是被POJ坑,累觉不爱。从输出double用%fWA了一天,到OJ垃圾判个题要十分钟,还有scanf里面多打个z RE了2个小时,总之被坑永远在POJ.多了就不吐槽了,也是我过于相信同学,最开始没有计算重边(一位AK大神不计算重边就AC了)和没有建双向边(另一个大神说建单向边就过了,觉得这个最假)。思路还是用tarjan算法,找出边的双连通分量,缩点,然后答案就
2015-07-30 09:56:16
734
原创 HDU3049 逆元
HDU3049 题目描述: Chinachen is a football fanatic, and his favorite football club is Juventus fc. In order to buy a ticket of Juv, he finds a part-time job in Professor Qu’s lab.And now, Chinachen ha
2015-07-30 09:39:14
701
原创 查询区间内不同数字的个数 lydsy1878
lydsy1878 HH有一串由各种漂亮的贝壳组成的项链。HH相信不同的贝壳会带来好运,所以每次散步 完后,他都会随意取出一段贝壳,思考它们所表达的含义。HH不断地收集新的贝壳,因此, 他的项链变得越来越长。有一天,他突然提出了一个问题:某一段贝壳中,包含了多少种不同 的贝壳?这个问题很难回答。。。因为项链实在是太长了。于是,他只好求助睿智的你,来解 决这个问题。
2015-07-25 11:31:48
4175
1
原创 CodeForces#round308C解题报告
题目描述:Vanya has a scales for weighing loads and weights of masses w0, w1, w2, ..., w100 grams where w is some integer not less than 2(exactly one weight of each nominal value). Vanya wonder
2015-06-20 01:00:27
656
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅