- 博客(28)
- 收藏
- 关注
原创 luogu-p1129(匹配问题)
题目描述小QQ是一个非常聪明的孩子,除了国际象棋,他还很喜欢玩一个电脑益智游戏――矩阵游戏。矩阵游戏在一个N \times NN×N黑白方阵进行(如同国际象棋一般,只是颜色是随意的)。每次可以对该矩阵进行两种操作:行交换操作:选择矩阵的任意两行,交换这两行(即交换对应格子的颜色)列交换操作:选择矩阵的任意两列,交换这两列(即交换对应格子的颜色)游戏的目标,即通过若干次操作,使得方阵的主对角...
2020-01-31 23:13:11 151
原创 HDU 2063(匹配问题)
Problem DescriptionRPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或PQK做partner,Grass只愿意和linle或LL做partner,PrincessSnow愿意...
2020-01-31 21:51:34 119
原创 POJ 2060(最小路径覆盖)
DescriptionRunning a taxi station is not all that simple. Apart from the obvious demand for a centralised coordination of the cabs in order to pick up the customers calling to get a cab as soon as po...
2020-01-30 22:52:19 159
原创 HDU 4185(匈牙利算法)
Problem DescriptionThanks to a certain “green” resources company, there is a new profitable industry of oil skimming. There are large slicks of crude oil floating in the Gulf of Mexico just waiting t...
2020-01-30 22:02:55 166
原创 CodeForces 343D(树链剖分+线段树)
Mad scientist Mike has constructed a rooted tree, which consists of n vertices. Each vertex is a reservoir which can be either empty or filled with water.The vertices of the tree are numbered from 1 ...
2020-01-27 20:57:23 1398 2
原创 SCU - 4438(字符串hash)
Censorfrog is now a editor to censor so-called sensitive words (敏感词).She has a long text p. Her job is relatively simple – just to find the first occurence of sensitive word w and remove it.frog re...
2020-01-21 21:54:33 18227
原创 LightOJ - 1077(GCD)
Given two points A and B on the X-Y plane, output the number of the lattice points on the segment AB. Note that A and B are also lattice point. Those who are confused with the definition of lattice po...
2020-01-21 16:23:56 1328 3
原创 CodeForces - 514D (线段树+二分)
An army of n droids is lined up in one row. Each droid is described by m integers a1, a2, …, am, where ai is the number of details of the i-th type in this droid’s mechanism. R2-D2 wants to destroy th...
2020-01-21 16:17:52 186 3
原创 HDU-6534 (莫队算法+树状数组)
Problem DescriptionChika gives you an integer sequence a1,a2,…,an and m tasks. For each task, you need to answer the number of “friendly pairs” in a given interval.friendly pair: for two integers ai...
2020-01-16 20:55:54 182
原创 UVA - 11297(线段树套线段树)
放个链接在这里:UVA - 11297This year, there have been many problems with population calculations, since in some cities, thereare many emigrants, or the population growth is very high. Every year the ACM (fo...
2020-01-16 16:43:25 249
原创 BZOJ-2002(分块)
Description某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏。游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置设定初始弹力系数ki,当绵羊达到第i个装置时,它会往后弹ki步,达到第i+ki个装置,若不存在第i+ki个装置,则绵羊被弹飞。绵羊想知道当它从第i个装置起步时,被弹几次后会被弹飞。为了使得游戏更有趣,...
2020-01-16 11:06:16 139
原创 CodeForces - 356A(fhq-treap)
上个题目链接:CodeForces - 356AHooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to all knights in the kingdom and they in turn agreed to participate ...
2020-01-15 17:04:28 289
原创 Spoj 10628 (树上主席树+LCA)
You are given a tree with N nodes. The tree nodes are numbered from 1 to N. Each node has an integer weight.We will ask you to perform the following operation:u v k : ask for the kth minimum weight ...
2020-01-15 14:14:49 237
原创 Codeforces 853C(扫描线+树状数组)
Ilya is sitting in a waiting area of Metropolis airport and is bored of looking at time table that shows again and again that his plane is delayed. So he took out a sheet of paper and decided to solve...
2020-01-14 20:58:21 285
原创 CodeForces - 707D (离线+DFS模拟)
Recently in school Alina has learned what are the persistent data structures: they are data structures that always preserves the previous version of itself and access to it when it is modified.After ...
2020-01-14 16:38:56 180
原创 HDU-4417(可持续化线段树or莫队)
Problem DescriptionMario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble again and Mario needs to save his lover. W...
2020-01-14 11:23:49 179
原创 HDU-1828(扫描线+线段树)
Problem DescriptionA number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partially ...
2020-01-13 15:45:58 332
原创 Gym - 102439H(数位DP)
Fibonacci numbers — well-known integer sequence, where F0=0, F1=1 and Fn=Fn−1+Fn−2 for n>1.Lesha doesn’t like this sequence and all the numbers x, such that we can get positive Fibonacci number by...
2020-01-12 20:55:10 293 1
原创 ICPC Latin American Regional – 2017 B题(模拟+思维)
ICPC Latin American Regional – 2017Alan Curing is a famous sports programmer. He is the creator of the theoretical model of computationknown as the Alan Curing Machine (ACM). He’s most famous for cr...
2020-01-12 20:37:35 257
原创 Codefroces-510D
Fox Ciel is playing a game. In this game there is an infinite long tape with cells indexed by integers (positive, negative and zero). At the beginning she is standing at the cell 0.There are also n c...
2020-01-12 16:04:10 1461
原创 Codeforces-356A(STL运用)
Hooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to all knights in the kingdom and they in turn agreed to participate in this grand event.As f...
2020-01-12 14:07:57 238
原创 HDU-1074(状压DP)
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in t...
2020-01-11 21:03:56 220
原创 HDU-5945(DP+单调队列优化)
Problem DescriptionYoung theoretical computer scientist Fxx designed a game for his students.In each game, you will get three integers X,k,t.In each step, you can only do one of the following moves:...
2020-01-11 20:46:59 249
原创 HDU-2196(树形DP)
Problem DescriptionA school bought the first computer some time ago(so this computer’s id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one of...
2020-01-08 20:59:45 140
原创 HDU-4607(树形DP)
Problem DescriptionClaire and her little friend, ykwd, are travelling in Shevchenko’s Park! The park is beautiful - but large, indeed. N feature spots in the park are connected by exactly (N-1) undir...
2020-01-08 20:10:41 120
原创 luogu-P2899
题目描述Farmer John has decided to give each of his cows a cell phone in hopes to encourage their social interaction. This, however, requires him to set up cell phone towers on his N (1 ≤ N ≤ 10,000) pas...
2020-01-07 14:47:51 106 1
原创 luogu-p1880
题目描述在一个圆形操场的四周摆放 NN 堆石子,现要将石子有次序地合并成一堆.规定每次只能选相邻的2堆合并成新的一堆,并将新的一堆的石子数,记为该次合并的得分。试设计出一个算法,计算出将 NN 堆石子合并成 11 堆的最小得分和最大得分。输入格式数据的第 11 行是正整数 NN,表示有N堆石子。第 2 行有 N 个整数,第 i 个整数 ai 表示第 i 堆石子的个数。输出格式输出共...
2020-01-06 18:10:39 102
原创 luogu-p1603
题目描述在MarsMars星球上,每个MarsMars人都随身佩带着一串能量项链。在项链上有NN颗能量珠。能量珠是一颗有头标记与尾标记的珠子,这些标记对应着某个正整数。并且,对于相邻的两颗珠子,前一颗珠子的尾标记一定等于后一颗珠子的头标记。因为只有这样,通过吸盘(吸盘是MarsMars人吸收能量的一种器官)的作用,这两颗珠子才能聚合成一颗珠子,同时释放出可以被吸盘吸收的能量。如果前一颗能量珠的头...
2020-01-06 17:58:05 103
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人