POJ
追风者_
要我自我介绍,挺秃然的
展开
-
【POJ 2186】 Popular Cows Tarjan 缩点 详解
DescriptionEvery cow’s dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordered pairs of the form (A, B) that tell you that cow A thinks that cow B is popular原创 2020-06-03 15:50:20 · 174 阅读 · 0 评论 -
【POJ 2823】 Feel Good 单调栈 详解
DescriptionBill is developing a new mathematical theory for human emotions. His recent investigations are dedicated to studying how good or bad days influent people’s memories about some period of life.A new idea Bill has recently developed assigns a non原创 2020-05-18 16:56:03 · 129 阅读 · 0 评论 -
【POJ 2823】 Sliding Window 单调队列 双端队列 STL
DescriptionAn array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves rightwards by one原创 2020-05-18 13:49:49 · 177 阅读 · 0 评论 -
【POJ 3984】 迷宫问题 简单DFS + 路径记录
Description定义一个二维数组:int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二维数组,表示一个迷宫。数据保证有唯一解。Output左上角到右下角的最短路径,格式如样例所示。Sam原创 2020-05-15 23:28:24 · 473 阅读 · 0 评论 -
【POJ 3279】 Fliptile 黑白棋翻转 DFS
DescriptionFarmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an M × N grid (1 ≤ M ≤ 15; 1 ≤ N ≤ 15) of square tiles, each of which is colored原创 2020-05-15 16:50:51 · 303 阅读 · 0 评论 -
【POJ 1321】 棋盘问题 DFS 详解
Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n当为-1 -1时表示输入结束。随后的n行描述了棋盘的形状:每行有n个字符,其中 # 表示棋原创 2020-05-14 13:09:47 · 447 阅读 · 0 评论 -
【POJ 2001】 Shortest Prefixes 字典树 哈希
DescriptionA prefix of a string is a substring starting at the beginning of the given string. The prefixes of “carbon” are: “c”, “ca”, “car”, “carb”, “carbo”, and “carbon”. Note that the empty string is not considered a prefix in this problem, but every n原创 2020-05-11 16:02:50 · 160 阅读 · 0 评论 -
【POJ 1730】 Perfect Pth Powers 唯一分解定理 枚举
DescriptionWe say that x is a perfect square if, for some integer b, x = b2. Similarly, x is a perfect cube if, for some integer b, x = b3. More generally, x is a perfect pth power if, for some integ...原创 2020-05-06 18:42:07 · 273 阅读 · 0 评论 -
【POJ 2739】 Sum of Consecutive Prime Numbers 前缀和预处理 打表 线性筛
DescriptionSome positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer have? For example, the integer 53 h...原创 2020-05-06 15:26:16 · 155 阅读 · 0 评论 -
【POJ 3579】 Median 二分答案 + lowerbound
Given N numbers, X1, X2, … , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) differences through this work, and now your task is to find the ...原创 2020-05-01 11:23:15 · 293 阅读 · 0 评论 -
【POJ 3258】 River Hopscotch 二分答案
DescriptionEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight riv...原创 2020-04-30 18:54:17 · 169 阅读 · 0 评论 -
【POJ 3252】 Round Numbers 数位dp
DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone’ (also known as ‘Rock, Paper, Scissors’, ‘Ro, Sham, Bo’, and a host of other names) in o...原创 2020-04-27 19:18:56 · 158 阅读 · 0 评论 -
【POJ 1797】 Heavy Transportation 最短路变型 Dijkstra堆优化
BackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his cust...原创 2020-04-17 22:26:19 · 188 阅读 · 0 评论 -
【POJ 3321】 Apple Tree 树状数组 + DFS序(详解)
DescriptionThere is an apple tree outside of kaka’s house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.The ...原创 2020-04-13 12:13:58 · 486 阅读 · 0 评论 -
【POJ Balanced Lineup】 RMQ算法
DescriptionFor the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To ...原创 2020-03-25 22:20:01 · 138 阅读 · 0 评论 -
【校队排位赛#5 F】 POJ 3259 Wormholes SPFA +负权环
DescriptionWhile 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 to its destination at a...原创 2020-03-08 23:04:14 · 130 阅读 · 0 评论 -
【校队排位赛#6 I】POJ Crashing Robots
DescriptionIn a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinations without crashing into each other. Of course, al...原创 2020-03-08 20:36:38 · 121 阅读 · 0 评论