自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Tony5t4rk的博客

Welcome to Tony5t4rk's blog

原创 博客搬家

博客搬迁至 tony5t4rk.cn

2019-03-26 14:01:27 250

原创 Codeforces Round #548 (Div. 2)

A. Even SubstringsDescription:You are given a string s=s1s2…sns=s_1s_2\dots s_ns=s1​s2​…sn​ of length nnn, which only contains digits 111, 222, …, 999.A substring s[l…r]s[l \dots r]s[l…r] of sss is...

2019-03-22 18:17:14 319

原创 2018 ICPC Asia Jakarta Regional Contest

A. Edit DistanceDescription:A binary string is a non-empty sequence of 000's and 111's, e.g., 010110, 1, 11101, etc. The edit distance of two binary strings SSS and TTT, denoted by edit(S,T)edit(S, ...

2019-03-22 18:02:56 502

原创 Codeforces Round #547 (Div. 3)

A. Game 23Description:Polycarp plays “Game 23”. Initially he has a number nnn and his goal is to transform it to mmm. In one move, he can multiply nnn by 222 or multiply nnn by 333. He can perform a...

2019-03-20 22:01:09 430

原创 2018-2019 ACM-ICPC, Asia Seoul Regional Contest

题目链接Problems:https://codeforces.com/gym/101987/attachments/download/7921/20182019-acmicpc-asia-seoul-regional-contest-en.pdfProblem A Circuits求两条与 xxx 轴平行的线与矩形相交的最大数目两条线必定在某个矩形的上边界或下边界上,离散上下边界纵坐标...

2019-03-15 10:58:51 1583

原创 Codeforces Round #501 (Div. 3)

文章地址:http://henuly.top/?p=659A. Points in Segments题目:You are given a set of nnn segments on the axis OxOxOx, each segment has integer endpoints between 111 and mmm inclusive. Segments may in...

2019-03-12 22:42:56 879

原创 POJ 3259 Wormholes(BellmanFord)

文章地址:http://henuly.top/?p=554题目:While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you...

2019-03-12 22:32:45 854

原创 POJ 3046 Ant Counting(dp)

文章地址:http://henuly.top/?p=545题目:Bessie was poking around the ant hill one day watching the ants march to and fro while gathering food. She realized that many of the ants were siblings, indistingui...

2019-03-12 22:32:09 837

原创 BZOJ 3196 洛谷 P3380 二逼平衡树(线段树套伸展树)

Description:您需要写一种数据结构(可参考题目标题),来维护一个有序数列,其中需要提供以下操作:查询k在区间内的排名查询区间内排名为k的值修改某一位值上的数值查询k在区间内的前驱(前驱定义为严格小于x,且最大的数,若不存在输出-2147483647)查询k在区间内的后继(后继定义为严格大于x,且最小的数,若不存在输出2147483647)Input:第一行两个数 n,...

2019-03-10 19:24:31 81

原创 BZOJ 1208 洛谷 P2286 [HNOI2004]宠物收养所(伸展树Splay)

Description:凡凡开了一间宠物收养场。收养场提供两种服务:收养被主人遗弃的宠物和让新的主人领养这些宠物。每个领养者都希望领养到自己满意的宠物,凡凡根据领养者的要求通过他自己发明的一个特殊的公式,得出该领养者希望领养的宠物的特点值a(a是一个正整数,a<2^31),而他也给每个处在收养场的宠物一个特点值。这样他就能够很方便的处理整个领养宠物的过程了,宠物收养场总是会有两种情况发生...

2019-03-09 19:42:20 54

原创 洛谷 P3834 【模板】可持久化线段树 1(主席树)

Description:这是个非常经典的主席树入门题——静态区间第K小数据已经过加强,请使用主席树。同时请注意常数优化如题,给定N个整数构成的序列,将对于指定的闭区间查询其区间内的第K小值。Input:第一行包含两个正整数N、M,分别表示序列的长度和查询的个数。第二行包含N个整数,表示这个序列各项的数字。接下来M行每行包含三个整数 l,r,kl, r, kl,r,k , 表示查询区间...

2019-03-09 14:49:27 112

原创 HDU 5306 Gorgeous Sequence(线段树)

Description:There is a sequence aaa of length nnn. We use aia_iai​ to denote the iii-th element in this sequence. You should do the following three types of operations to this sequence.0 x&nbsp...

2019-03-08 19:26:34 69

原创 BZOJ 1568 洛谷 P4254 [JSOI2008]Blue Mary开公司(李超线段树)

Description:万事开头难,经营公司更是如此。开始的收益往往是很低的,不过随着时间的增长会慢慢变好。也就是说,对于一个金融顾问 iii ,他设计的经营方案中,每天的收益都比前一天高,并且均增长一个相同的量 PiP_iPi​ 。由于金融顾问的工作效率不高,**所以在特定的时间,Blue Mary 只能根据他已经得到的经营方案来估算某一时间的最大收益。**由于 Blue Mary 是很没有...

2019-03-08 15:23:37 78

原创 洛谷 P3459 [POI2007]MEG-Megalopolis(dfs序+线段树)

Description:Byteotia has been eventually touched by globalisation, and so has Byteasar the Postman, who once roamedthe country lanes amidst sleepy hamlets and who now dashes down the motorways. But i...

2019-03-08 13:48:48 74

原创 2018-2019 ACM-ICPC Pacific Northwest Regional Contest (Div. 1)

题目链接Problems:https://codeforces.com/gym/101982/attachments/download/7897/20182019-acmicpc-pacific-northwest-regional-contest-div-1-en.pdfProblem A. Exam你和朋友一起写一些判断题,现知两人答案以及朋友正确题数,求你最多正确的题数分别统计和朋...

2019-03-07 20:33:48 934 3

原创 CodeForces 145 E. Lucky Queries(线段树)

E. Lucky QueriesDescription:Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, nu...

2019-03-07 09:57:26 96 1

原创 洛谷 P3373 【模板】线段树 2

Description:如题,已知一个数列,你需要进行下面三种操作:1.将某区间每一个数乘上x2.将某区间每一个数加上x3.求出某区间每一个数的和Input:第一行包含三个整数N、M、P,分别表示该数列数字的个数、操作的总个数和模数。第二行包含N个用空格分隔的整数,其中第i个数字表示数列第i项的初始值。接下来M行每行包含3或4个整数,表示一个操作,具体如下:操作1: 格式:1 x...

2019-03-06 21:12:26 87

原创 2018 China Collegiate Programming Contest Final (CCPC-Final 2018)

A. Mischievous Problem SetterDescription:Mr. Sheep is participating in a programming contest. Mr. Panda, the mischievous problem setter gives him some “hints” on the difficulty level of the problems...

2019-03-01 12:42:52 992

原创 CodeForces 887 E. Little Brother(计算几何+二分)

E. Little BrotherDescription:Masha’s little brother draw two points on a sheet of paper. After that, he draws some circles and gave the sheet to his sister.Masha has just returned from geometry les...

2019-03-01 12:27:08 185

原创 SGU 124 Broken line(计算几何)

Description:There is a closed broken line on a plane with sides parallel to coordinate axes, without self-crossings and self-contacts. The broken line consists of K segments. You have to determine, w...

2019-02-27 17:54:55 142

原创 SGU 120 SGU 228 Archipelago(计算几何)

Description:Archipelago Ber-Islands consists of NNN islands that are vertices of equiangular and equilateral NNN-gon. Islands are clockwise numerated. Coordinates of island N1N1N1 are (x1,y1)(x1, y1)...

2019-02-25 14:07:41 71

原创 Codeforces Round #541 (Div. 2)

A. Sea BattleDescription:In order to make the “Sea Battle” game more interesting, Boris decided to add a new ship type to it. The ship consists of two rectangles. The first rectangle has a width of ...

2019-02-24 18:10:36 257

原创 SGU 110 Dungeon(立体几何)

Description:The mission of space explorers found on planet M the vast dungeon. One of the dungeon halls is fill with the bright spheres. The explorers find out that the light rays reflect from the su...

2019-02-22 18:37:40 99

原创 HDU 1542 Atlantis(扫描线)

Description:There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps ...

2019-02-22 13:17:29 69

原创 BNUOJ 12887 isumi(计算几何+最大流)

Description:isumi是个斐波那契数迷。他是如此的酷爱这个数列,因此他想知道很多关于这个数列的东西,比方说第N个斐波那契数是多少啊、前N项的和是多少啊如何用若干个斐波那契数的和表示一个自然数啊之类之类的。今天他希望能想出一个有关斐波那契数的问题能难倒易牛。当然,这需要想相当长的时间,他想到该去吃饭了依然没想出题来,因此他决定边去吃饭边想。isumi的宿舍到食堂之间的路可以看做一个矩...

2019-02-21 17:44:05 79 1

原创 HDU 3126 Nova(计算几何+二分+最大流)

Description:The Lich is a powerful hero that he can kill a wisp with his skill Frost Nova. The Burning Legion wants to conquer the forest so they sent some liches to kill all the wisps. A lich can ki...

2019-02-21 16:31:13 90

原创 CodeForces 1030 D. Vasya and Triangle(简单几何)

D. Vasya and TriangleDescription:Vasya has got three integers nnn, mmm and kkk. He’d like to find three integer points (x1,y1)(x_1, y_1)(x1​,y1​), (x2,y2)(x_2, y_2)(x2​,y2​), (x3,y3)(x_3, y_3)(x3​,y...

2019-02-21 11:50:34 200 2

原创 洛谷 P2521 [HAOI2011]防线修建(动态凸包)

Description:近来A国和B国的矛盾激化,为了预防不测,A国准备修建一条长长的防线,当然修建防线的话,肯定要把需要保护的城市修在防线内部了。可是A国上层现在还犹豫不决,到底该把哪些城市作为保护对象呢?又由于A国的经费有限,所以希望你能帮忙完成如下的一个任务:给出你所有的A国城市坐标A国上层经过讨论,考虑到经济问题,决定取消对i城市的保护,也就是说i城市不需要在防线内了A国上层询问...

2019-02-20 19:45:46 126 2

原创 CodeForces 70D Professor's task(动态凸包)

D. Professor’s taskDescription:Once a walrus professor Plato asked his programming students to perform the following practical task.The students had to implement such a data structure that would su...

2019-02-20 16:29:47 168

原创 POJ 2187 Beauty Contest(旋转卡壳)

Description:Bessie, Farmer John’s prize cow, has just won first place in a bovine beauty contest, earning the title ‘Miss Cow World’. As a result, Bessie will make a tour of N (2 <= N <= 50,000...

2019-02-20 10:16:48 73

原创 Codeforces Round #539 (Div. 2)

A. Sasha and His TripDescription:Sasha is a very happy guy, that’s why he is always on the move. There are nnn cities in the country where Sasha lives. They are all located on one straight line, and...

2019-02-19 17:46:35 83

原创 Codeforces Round #533 (Div. 2)

A. Salem and SticksDescription:Salem gave you nnn sticks with integer positive lengths a1,a2,…,ana_1, a_2, \ldots, a_na1​,a2​,…,an​.For every stick, you can change its length to any other positive ...

2019-02-13 18:11:00 103 2

原创 Codeforces Round #538 (Div. 2)

要不是杰哥抬了一手这场又要掉分……菜是原罪A. Got Any Grapes?Description:The Duck songFor simplicity, we’ll assume that there are only three types of grapes: green grapes, purple grapes and black grapes.Andrew, Dmitry ...

2019-02-12 01:04:07 228 2

原创 Educational Codeforces Round 59 (Rated for Div. 2)

A. Digits Sequence DividingDescription:You are given a sequence sss consisting of nnn digits from 111 to 999.You have to divide it into at least two segments (segment — is a consecutive sequence of...

2019-02-11 22:46:02 142

原创 AtCoder Yahoo Programming Contest 2019

A - Anti-AdjacencyDescription:Determine if we can choose KKK different integers between 111 and NNN (inclusive) so that no two of them differ by 111 .Input:Input is given from Standard Input in th...

2019-02-10 14:23:22 200

原创 Codeforces Global Round 1

蒟蒻的再一次血崩A. ParityDescription:You are given an integer nnn (n≥0n \ge 0n≥0) represented with kkk digits in base (radix) bbb. So,n=a1⋅bk−1+a2⋅bk−2+…ak−1⋅b+ak.n = a_1 \cdot b^{k-1} + a_2 \cdot b^{k-2}...

2019-02-08 15:26:47 663 1

原创 CCPC-Wannafly Winter Camp Day7 (Div2, onsite)

A. 迷宫Description:有一个 nnn 个点 n−1n-1n−1 条边的无向连通图迷宫,其中有些点上面有人现在所有人的目标都是逃离这个迷宫,而迷宫的出口是 111 号点,每一时刻,会依次发生以下的事情:在点 xxx 上的人选择一个点 f(x)f(x)f(x) 作为目标,要求 f(x)f(x)f(x) 必须是 xxx ,或者与 xxx 有边相连的点,且对于 x≠yx\neq yx...

2019-02-08 15:20:02 167 2

原创 CCPC-Wannafly Winter Camp Day5 (Div2, onsite)

A. Cactus DrawDescription:你有一棵树,你想把它画在平面上,使得没有边相交。Input:第一行两个整数 n,m(1≤n≤1000,1≤m≤2000)n, m (1\leq n\leq 1000, 1\leq m \leq 2000)n,m(1≤n≤1000,1≤m≤2000) ,表示点数和边数。接下来 mmm 行,每行两个正整数 u,v(1≤u,v≤n,u≠v)u...

2019-02-08 13:24:36 185

原创 CCPC-Wannafly Winter Camp Day4 (Div2, onsite)

A. 夺宝奇兵Description:wls正在玩一个寻宝游戏。宝藏一共有 nnn 种,都藏在一个 mmm 行 mmm 列的网格中。每种宝藏都恰好有两个。wlswlswls 只能沿着网格走(上下左右四个方向)。他想依次获得 1...n1...n1...n 类宝藏,然后再以 n...1n...1n...1的顺序获得剩下的宝藏。wlswlswls 可以从任意点出发。当 wlswlswl...

2019-02-07 16:00:46 181

原创 CCPC-Wannafly Winter Camp Day3 (Div2, onsite)

B. 集合Description:最近放假了,可怜计划和她的好朋友 Sylvia 去公园玩。我们可以把地图抽象成一个二维平面,可怜最开始的位置是点 xxx ,Sylvia 最开始的位置是点 yyy,公园是一个以点 ooo 为圆心,半径为 rrr 的圆 OOO 。因为进入公园要买票,因此她们约好了先在不进入公园的情况下,在公园的边界上集合,然后在一起买票进公园。她们想要选择一个最优的集合地点...

2019-02-07 15:37:07 294

提示
确定要删除当前文章?
取消 删除