随笔分类 -  传统算法

摘要:大佬博客:https://www.jianshu.com/p/e136ec79235c 这颗红黑树是我看了大佬博客的原理之后的手撸版本,代码实在是不够优雅. 这里只是留作纪念,相信等我看完HashMap源码以后一定会有不一样的感觉吧 经过测试,这颗红黑树复杂度还达不到完全的log,但是数量级是一样的 阅读全文
posted @ 2020-03-17 23:59 断腿三郎 阅读(233) 评论(0) 推荐(0)
摘要:题面 John is the only priest in his town. September 1st is the John's busiest day in a year because there is an old legend in the town that the couple w 阅读全文
posted @ 2019-09-27 19:56 断腿三郎 阅读(270) 评论(0) 推荐(0)
摘要:题面 It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, 阅读全文
posted @ 2019-09-22 22:39 断腿三郎 阅读(303) 评论(0) 推荐(0)
摘要:题面 The Smart Beaver has recently designed and built an innovative nanotechnologic all purpose beaver mass shaving machine, "Beavershave 5000". Beavers 阅读全文
posted @ 2019-09-12 19:18 断腿三郎 阅读(251) 评论(0) 推荐(0)
摘要:题面 Having endured all the hardships, Lara Croft finally found herself in a room with treasures. To her surprise she didn't find golden mountains there 阅读全文
posted @ 2019-09-12 15:17 断腿三郎 阅读(228) 评论(0) 推荐(0)
摘要:题面 Vasya has a tree consisting of n vertices with root in vertex 1. At first all vertices has 0 written on it. Let d(i,j) be the distance between vert 阅读全文
posted @ 2019-09-06 13:18 断腿三郎 阅读(196) 评论(0) 推荐(0)
摘要:题面 One day Polycarp decided to rewatch his absolute favourite episode of well known TV series "Tufurama". He was pretty surprised when he got results 阅读全文
posted @ 2019-09-05 14:31 断腿三郎 阅读(302) 评论(0) 推荐(0)
摘要:题面 Bash likes playing with arrays. He has an array a1, a2, ... an of n integers. He likes to guess the greatest common divisor (gcd) of different segm 阅读全文
posted @ 2019-09-03 20:00 断腿三郎 阅读(262) 评论(0) 推荐(0)
摘要:题面: Alice and Bob are trying to communicate through the internet. Just assume that there are N routers in the internet and they are numbered from 0 to 阅读全文
posted @ 2019-08-23 09:41 断腿三郎 阅读(233) 评论(0) 推荐(0)
摘要:题面: Last night you robbed a bank but couldn't escape and when you just got outside today, the police started chasing you. The city, where you live in, 阅读全文
posted @ 2019-08-22 20:00 断腿三郎 阅读(256) 评论(0) 推荐(0)
摘要:题面: You are given a 3D grid, which has dimensions X, Y and Z. Each of the X x Y x Z cells contains a light. Initially all lights are off. You will hav 阅读全文
posted @ 2019-08-22 14:46 断腿三郎 阅读(207) 评论(0) 推荐(0)
摘要:You are in a reality show, and the show is way too real that they threw into an island. Only two kinds of animals are in the island, the tigers and th 阅读全文
posted @ 2019-08-20 20:54 断腿三郎 阅读(262) 评论(0) 推荐(0)
摘要:Problem Description Acesrc is a famous tourist at Nanjing University second to none. During this summer holiday, he, along with Zhang and Liu, is goin 阅读全文
posted @ 2019-08-15 01:09 断腿三郎 阅读(471) 评论(0) 推荐(0)
摘要:Mr. Zstu and Mr. Hdu are taking a boring class , Mr. Zstu comes up with a problem to kill time, Mr. Hdu thinks it’s too easy, he solved it very quickl 阅读全文
posted @ 2019-08-13 22:06 断腿三郎 阅读(228) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/888/E来源:牛客网 Gromah and LZR have entered the fifth level. Unlike the first four levels, they should do some move 阅读全文
posted @ 2019-08-13 09:50 断腿三郎 阅读(285) 评论(0) 推荐(0)
摘要:You are given an array a of size n, and q queries to it. There are queries of two types: 1 li ri — perform a cyclic shift of the segment [li, ri] to t 阅读全文
posted @ 2019-08-07 19:39 断腿三郎 阅读(203) 评论(0) 推荐(0)
摘要:Kakuro puzzle is played on a grid of "black" and "white" cells. Apart from the top row and leftmost column which are entirely black, the grid has some 阅读全文
posted @ 2019-08-06 22:19 断腿三郎 阅读(239) 评论(0) 推荐(0)
摘要:Recently Maxim has found an array of n integers, needed by no one. He immediately come up with idea of changing it: he invented positive integer x and 阅读全文
posted @ 2019-08-06 10:39 断腿三郎 阅读(210) 评论(0) 推荐(0)
摘要:It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-emp 阅读全文
posted @ 2019-07-27 11:05 断腿三郎 阅读(299) 评论(0) 推荐(1)
摘要:链接:https://ac.nowcoder.com/acm/contest/882/F来源:牛客网 Given 2N people, you need to assign each of them into either red team or white team such that each 阅读全文
posted @ 2019-07-20 17:55 断腿三郎 阅读(575) 评论(1) 推荐(0)