![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
Yi_Qing_Z
这个作者很懒,什么都没留下…
展开
-
HDU 4089 Activation(概率dp)
题面After 4 years' waiting, the game "Chinese Paladin 5" finally comes out. Tomato is a crazy fan, and luckily he got the first release. Now he is at home, ready to begin his journey.But before start...原创 2019-08-05 20:28:01 · 166 阅读 · 0 评论 -
ZOJ 2760 How Many Shortest Path (初学最大流)
题面Given a weighted directed graph, we define the shortest path as the path who has the smallest length among all the path connecting the source vertex to the target vertex. And if two path is said t...转载 2019-07-06 22:38:22 · 193 阅读 · 0 评论 -
UVA 1039(UVALive 3270) Simplified GSM Network (计算几何二分+最短路)
题面Mobile phones have changed our lifestyle dramatically in the last decade. Mobile phones have a variety of protocols to connect with one another. One of the most popular networks for mobile phones ...原创 2019-07-06 22:37:45 · 241 阅读 · 0 评论 -
UVA 1063 Marble Game(模拟+搜索)
题面A Marble Game is played with M marbles on a square board. The board is divided into N ×N unit squares, and M of those unit squares contain holes. Marbles and holes are numbered from 1 to M. The go...原创 2019-07-06 22:39:23 · 575 阅读 · 0 评论 -
ZOJ 2477 Magic Cube (IDA*)
题面This is a very popular game for children. In this game, there's a cube, which consists of 3 * 3 * 3 small cubes. We can unwrap the cube, it will become like this:w w ww w ww ...原创 2019-04-02 21:55:08 · 442 阅读 · 0 评论 -
HDU 3535 AreYouBusy (多组背包综合)
题面Happy New Term!As having become a junior, xiaoA recognizes that there is not much time for her to AC problems, because there are some other things for her to do, which makes her nearly mad.What'...转载 2019-03-23 10:52:14 · 214 阅读 · 0 评论 -
POJ 2449 Remmarguts' Date(Dijkstra+A*)
题面Description"Good man never makes girls wait or breaks an appointment!" said the mandarin duck father. Softly touching his little ducks' head, he told them a story."Prince Remmarguts lives in h...转载 2019-03-13 19:37:14 · 158 阅读 · 0 评论 -
HDU 3466 Proud Merchants (01背包+排序)
题面Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are still very proud even if the...转载 2019-03-20 11:37:19 · 178 阅读 · 1 评论 -
UVA 1051 Bipartite Numbers(构造)
题面 The executive officers of the company where you work want to send each other encrypted messages. Rather than use off-the-shelf encryption software such as PGP, they have tasked the IT staff ...原创 2019-03-06 19:20:17 · 980 阅读 · 0 评论 -
HDU 1560 DNA sequence(初学IDA*)
题面The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases from which DNA is built are A(adenine), C(cytosine), G(guanine), and T...转载 2019-03-13 21:27:01 · 130 阅读 · 0 评论 -
BFS与DFS的比较
问题1:什么时候用BFS,什么时候用DFS?链接:九章算法:能不能系统讲讲什么时候用BFS和DFS?1.BFS是用来搜索最短径路的解是比较合适的,比如求最少步数的解,最少交换次数的解,因为BFS搜索过程中遇到的解一定是离根最近的,所以遇到一个解,一定就是最优解,此时搜索算法可以终止。这个时候不适宜使用DFS,因为DFS搜索到的解不一定是离根最近的,只有全局搜索完毕,才能从所有解中找出离根的...转载 2019-03-09 10:15:25 · 957 阅读 · 0 评论 -
HDU 3085 Nightmare Ⅱ(初学双向BFS)
题面Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately. More terribly, there are two ghosts in the maze. They will kill t...转载 2019-04-17 22:54:21 · 160 阅读 · 0 评论 -
HDU 1067 Gap(bfs+哈希)
题面Let's play a card game called Gap.You have 28 cards labeled with two-digit numbers. The first digit (from 1 to 4) represents the suit of the card, and the second digit (from 1 to 7) represents th...转载 2019-04-18 12:03:36 · 147 阅读 · 0 评论 -
HDU 6590 Code (求两个凸包是否相离)
题面After returning with honour from ICPC(International Cat Programming Contest) World Finals, Tom decides to say goodbye to ICPC and start a new period of life. He quickly gets interested in AI.In t...原创 2020-11-11 15:09:48 · 132 阅读 · 0 评论 -
2019牛客暑期多校训练营(第一场)E:ABBA
题面Bobo has a string of length 2(n + m) which consists of characters `A` and `B`. The string also has a fascinating property: it can be decomposed into (n + m) subsequences of length 2, and among the...转载 2020-11-11 15:13:34 · 118 阅读 · 0 评论 -
HDU 6581 Vacation(思维)
题面 Problem Description Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are n cars in front of t...原创 2020-11-11 15:14:19 · 118 阅读 · 0 评论 -
HDU 6370 Werewolf 狼人杀(dfs)
题面"The Werewolves" is a popular card game among young people.In the basic game, there are 2 different groups: the werewolves and the villagers.Each player will debate a player they think is a werew...原创 2020-11-11 15:14:55 · 193 阅读 · 0 评论 -
Codeforces 1191E(Codeforces Round #573 (Div. 2) E)Tokitsukaze and Duel (博弈论)
题面"Duel!"Betting on the lovely princess Claris, the duel between Tokitsukaze and Quailty has started.There are nn cards in a row. Each card has two sides, one of which has color. At first, some ...原创 2020-11-11 14:55:38 · 163 阅读 · 0 评论 -
POJ 2096 Collecting Bugs(期望DP)
题面Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he classifies all possible bugs int...原创 2020-11-11 15:08:33 · 688 阅读 · 0 评论 -
HDU 6595 Everything Is Generated In Equal Probability(概率+组合数)
题面One day, Y_UME got an integer NN and an interesting program which is shown below:Y_UME wants to play with this program. Firstly, he randomly generates an integer n∈[1,N]n∈[1,N] in equal proba...原创 2020-11-11 15:10:24 · 169 阅读 · 0 评论 -
CodeForces 1121E Once in a casino(思维+模拟)
题面One player came to a casino and found a slot machine where everything depends only on how he plays. The rules follow.A positive integer aa is initially on the screen. The player can put a coin i...原创 2019-07-06 22:39:00 · 282 阅读 · 0 评论 -
POJ 2318 TOYS (计算几何+叉积)
题面Calculate the number of toys that land in each bin of a partitioned toy box.Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave...原创 2019-05-03 17:24:19 · 259 阅读 · 0 评论 -
UVA1052 Bit Compressor(DFS)
题面The aim of data compression is to reduce redundancy in stored or communicated data. This increases effective data density and speeds up data transfer rates. One possible method to compress any bina...原创 2019-03-06 16:12:10 · 1789 阅读 · 1 评论 -
Codeforces 526D Om Nom and Necklace(kmp+数学)
题面One day Om Nom found a thread with n beads of different colors. He decided to cut the first several beads from this thread to make a bead necklace and present it to his girlfriend Om Nelly.Om ...转载 2019-02-20 20:38:05 · 304 阅读 · 0 评论 -
Codefroces 527D Clique Problem(贪心)
题面The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of...转载 2019-02-20 14:43:04 · 149 阅读 · 0 评论 -
POJ 3122 Pie(二分法)
My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of ...原创 2019-02-13 11:36:42 · 146 阅读 · 0 评论 -
HihoCoder 1514 偶像的条件(二分法)
小Hi的学校正面临着废校的大危机。面对学校的危机,小Hi同学们决定从ABC三个班中各挑出一名同学成为偶像。 成为偶像团体的条件之一,就是3名团员之间的身高差越小越好。 已知ABC三个班同学的身高分别是A1..AN, B1..BM 和 C1..CL。请你从中选出3名同学Ai, Bj, Ck使得D=|Ai-Bj|+|Bj-Ck|+|Ck-Ai|最小。Input第一行包含3个整数,N...转载 2019-02-13 11:36:18 · 136 阅读 · 0 评论 -
HDU 5857 Median(归并排序)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=58把一个数组不断地合并,合成数组1<=i<=mid mid+1<=j<=N在合并过程中会产生逆序数用i 来控制前一个序列,用j 来控制后一个序列①如果a[i]<=a[j]时,a[i]比后序列中的a[j]以后的数都小,同时小于前序列中的a[i]以后的数②如...原创 2019-02-13 11:35:34 · 150 阅读 · 0 评论 -
Codeforces 559C Gerald and Giant Chess(dp+组合数)
题面Giant chess is quite common in Geraldion. We will not delve into the rules of the game, we'll just say that the game takes place on an h × w field, and it is painted in two colors, but not like in...转载 2019-02-18 20:22:17 · 322 阅读 · 0 评论 -
CodeForces 985D Sand Fortress(二分查找)
You are going to the beach with the idea to build the greatest sand castle ever in your head! The beach is not as three-dimensional as you could have imagined, it can be decribed as a line of spots to...原创 2019-02-13 11:22:49 · 225 阅读 · 0 评论 -
HDU 1043 Eight (八数码问题 康托展开 bfs)
题面The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all pa...转载 2019-02-13 11:17:45 · 286 阅读 · 0 评论 -
Codeforces 560D Equivalent Strings(暴力递归)
题面Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b of equal length are called equivalent in one of the two cases:They are equal. If we s...原创 2019-02-18 17:07:59 · 243 阅读 · 0 评论 -
HDU 3533 Escape (预处理+BFS)
题目The students of the HEU are maneuvering for their military training.The red army and the blue army are at war today. The blue army finds that Little A is the spy of the red army, so Little A has ...原创 2019-02-15 14:11:21 · 230 阅读 · 0 评论 -
HDU 3567 Eight II (BFS+映射+康托展开)
题面Eight-puzzle, which is also called "Nine grids", comes from an old game.In this game, you are given a 3 by 3 board and 8 tiles. The tiles are numbered from 1 to 8 and each covers a grid. As you s...原创 2019-02-14 22:08:02 · 747 阅读 · 0 评论 -
codeforces 448D Multiplication Table(二分法)
Bizon the Champion isn't just charming, he also is very smart.While some of us were learning the multiplication table, Bizon the Champion had fun in his own manner. Bizon the Champion painted an n ×...原创 2019-02-13 11:37:04 · 235 阅读 · 0 评论 -
Codeforces 83B Docter (二分)
https://blog.csdn.net/a540524095/article/details/51984698二分查找每个人最多看几次病后,时间结束通过二分法来获得最后每个人最多看?(middle)次即最后看完的那个人(lucky dog)的被看的次数当num[i]<middle时,那么第i个一定已经看完病了。lucky dog也不一定看完了病①如果lucky dog看完...转载 2019-02-13 11:37:30 · 128 阅读 · 0 评论 -
ZeptoLab Code Rush 2015/Codeforces 526C Om Nom and Candies(贪心+思维)
题面A sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that required him to think a bit in order to enjoy candies the most. Would you succeed ...原创 2019-02-20 13:24:15 · 240 阅读 · 0 评论 -
Codeforces 527C Glass Carving(set和multiset)
题面Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectangular w mm × h mm sheet of glass, a diamond glass cutter and lots o...转载 2019-02-20 09:46:37 · 250 阅读 · 0 评论 -
Codeforces 558D Guess Your Way Out! II(区间的交+并+补)
题面Amr bought a new video game "Guess Your Way Out! II". The goal of the game is to find an exit from the maze that looks like a perfect binary tree of height h. The player is initially standing at t...原创 2019-02-19 22:59:13 · 200 阅读 · 0 评论 -
Codeforces 558C Amr and Chemistry(暴力+贪心)
题面Amr loves Chemistry, and specially doing experiments. He is preparing for a new interesting experiment.Amr has n different types of chemicals. Each chemical i has an initial volume of ai liters....原创 2019-02-18 21:37:32 · 305 阅读 · 0 评论