POJ

POJ 1466 Girls and Boys

## [$POJ$ $1466$ $Girls$ $and$ $Boys$](http://poj.org/problem?id=1466) ### 一、题目描述 大意就是有$n$个人,每个人与其他的某几个人有关系,这个关系且称为 **浪漫关系**,然后最后求一个最大的集合,使得 **集合中所有的人 ......
Girls 1466 Boys POJ and

POJ 2594 Treasure Exploration

**[$POJ$ $2594$ $Treasure$ $Exploration$](http://poj.org/problem?id=2594)** ```cpp {.line-numbers} #include #include #include using namespace std; con ......
Exploration Treasure 2594 POJ

POJ 3692 Kindergarten

## [$POJ$ $3692$ $Kindergarten$](http://poj.org/problem?id=3692) ### 一、题目大意 在幼儿园中,有许多小孩。其中有男孩,也有女孩。女孩之间相互认识,男孩之间也相互认识。同时,一些男孩和女孩之间也相互认识,有一天,老师希望从所有人之中 ......
Kindergarten 3692 POJ

POJ - Buy Tickets

Smiling & Weeping 你看这个人,嘴里说着喜欢我 却又让我这么难过 Description Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early ......
Tickets POJ Buy

POJ 1548 Robots

## [$POJ$ $1548$ $Robots$](http://poj.org/problem?id=1548) ### 题意 相当于给出$N$个坐标点,因为机器人只能向下或者向右走,所以如果能到达其他点,则连接这两个点,即`line[i][j]=1` **最小路径覆盖数**: 对于一个$DAG ......
Robots 1548 POJ

POJ1904 King's Quest

## [$POJ1904$ $King's$ $Quest$](http://poj.org/problem?id=1904) ### 一、题目描述 有$n$个王子,每个王子都有$k$个喜欢的妹子,每个王子只能和喜欢的妹子结婚。现有一个匹配表,将每个王子都与一个自己喜欢的妹子配对。请你根据这个表得出 ......
Quest 1904 King POJ 39

POJ 3694 Network

##[POJ 3694 Network](http://poj.org/problem?id=3694) ### 一、题目大意 $n$个点,$m$个边,连通图。 点与点之间通过边连接,如果切断某个边使得有点与其他点连接断开(连通分支增加),则称这种边为 **桥梁**(离散上叫 **割边**)。 接下 ......
Network 3694 POJ

题解 POJ3318【Matrix Multiplication】

posted on 2022-10-21 19:56:08 | under 题解 | [source](https://www.luogu.com.cn/blog/_post/494348) ## problem 判断三个 $n\times n$ 的矩阵是否满足 $A\times B=C$,$n\l ......
题解 Multiplication Matrix 3318 POJ

POJ3468 A Simple Problem with Integers

# A Simple Problem with Integers 题目链接:[A Simple Problem with Integers](http://poj.org/problem?id=3468 "A Simple Problem with Integers") ## 题意 给定$N$个数, ......
Integers Problem Simple 3468 with

POJ 3728 The merchant

题意好像不清楚: > 给定一棵 $n​$ 个点的树,每个点有点权 $val_i​$,现在有 $q​$ 个询问,每次询问给出 $u,v​$,设 $u​$ 到 $v​$ 的路径上的点编号为 $a_1,a_2\cdots a_{len}​$,求 $\max\limits_{1 \le x #include ......
merchant 3728 POJ The

分治/质因数分解 POJ1845 求pow(a, b)的所有约数之和

//POJ1845 求pow(a, b)的所有约数之和//方法:1,分解质因数,将a分解成p1^ k1* p2^ k2^...*pn^ kn//2, 那么pow(a, b)为p1 ^ (k1* b)* p2 ^ (k2* b)^...*pn ^ (kn* b)//3,对于单独的pi ^ (ki * ......
质因数 约数 之和 1845 POJ

POJ2117 Electricity 题解 tarjan点双连通分量 割点

题目链接:[http://poj.org/problem?id=2117](http://poj.org/problem?id=2117) 题目大意: 给定一个由 $n$个点 $m$ 条边构成的无向图,请你求出该图删除一个点之后,连通块最多有多少。 解题思路: tarjan,判断 $u$ 的子节点有 ......
题解 分量 Electricity tarjan 2117

POJ 3131 - Cubic Eight-Puzzle

很明显可以看出是一道搜索题。 首先考虑 $bfs$,第一种思路是每次从给定的初始状态都进行一次 $bfs$,直到 $30$ 停止。然后我们发现,初始状态根据一开始空格的位置不同,一共只有 $9$ 种。而一个状态可以用空格的位置、所有位置上方的颜色、所有位置左方的颜色唯一确定,一共 $6^8\cdot ......
Eight-Puzzle Puzzle Cubic Eight 3131

POJ1714 - The Cave

首先,我们需要读懂这个图是什么图。 第一,忽略外面的环,由“任意两点可到达且路径唯一”的条件可知这是一棵树。 第二,因为每个点的度数是三,所以如果只考虑中间的树,除了 $k$ 以内的点都是叶子,其他的点度数都是三。 考虑什么样的树有很多点度数是三:完全二叉树。但是这个和完全二叉树还有个不同,就是完全 ......
1714 Cave POJ The

Pie(poj 3122)

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 ......
3122 Pie poj

POJ--2229 Sumsets(DP)

**记录** 16:29 2023-5-26 http://poj.org/problem?id=2229 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 这个问题是https://oeis.org/A018819 Binary partition function: ......
Sumsets 2229 POJ DP

POJ--2385 Apple Catching(DP)

**记录** 16:06 2023-5-26 http://poj.org/problem?id=2385 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 ....提交了好几天了,POJ挂了一直没出结果,现在出了才写,都有点忘了。 dp[i][j] 定义为 i为进行移动 ......
Catching Apple 2385 POJ DP

Tallest Cow(最高的牛)poj3263

题目描述:FJ's N (1 ≤ N ≤ 10,000) cows conveniently indexed 1..N are standing in a line. Each cow has a positive integer height (which is a bit of secret). ......
Tallest 3263 Cow poj

POJ1737 Connected Graph ( n点无向连通图计数

题意说明:求 $n$ 个点的无向连通图个数 据说已经非常典了,但是我太菜了不会组合数学,最近补档时看到这道题,决定记录下来理理思路 ![image](https://img2023.cnblogs.com/blog/3146663/202305/3146663-20230520234501796-1 ......
Connected Graph 1737 POJ

POJ--3190 Stall Reservations(贪心+最小堆)

记录 23:15 2023-5-7 http://poj.org/problem?id=3190 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 Description Oh those picky N (1 <= N <= 50,000) cows! They are ......
Reservations Stall 3190 POJ

POJ2739 Sum of Consecutive Prime Numbers&&Acwing4938 连续质数之和

方法:单调队列 为什么是单调队列?因为这里让我们求连续的质数和,我们可以利用欧拉筛来维护质数,再利用单调队列来维护连续的质数。 代码( ~~POJ 不支持 C++ 11 差评~~): #include<cstdlib> #include<cstring> #include<cstdio> #incl ......
质数 之和 Consecutive amp Numbers

POJ1177 Picture.md

题目链接 题目 Description A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertic ......
Picture 1177 POJ md

color a tree poj2054

color a tree(贪心) 题目描述 可以得到一个确定性的结论,最大值的结点一定是在父节点染色后立即染色。 但是此时依结论不好在复杂的情况正推,先考虑简单情况: 假如有权值x,y,z三个点,已知x,y一定一起染色,则有两种可能方案: 先x,y,再z,代价为X=x+2y+3z 先z,再x,y,代 ......
color 2054 tree poj

POJ--1328 Radar Installation(贪心)

记录 0:50 2023-5-1 http://poj.org/problem?id=1328 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 Description Assume the coasting is an infinite straight line. L ......
Installation Radar 1328 POJ

Brackets Sequence POJ - 1141

题意 咕咕是一只神奇的咕咕,虽然他很讨厌字符串但是他喜欢看别人做字符串的题目,现在咕咕给了你一个只含有'(’ 和‘)’和'['和']'的字符串,现在让你把他变成正则序列。 正则序列: 空序列是正则序列。 如果S是正则序列,那么(S)和[S]也是。 如果A是B也是,那么AB也是正则序列。 输入一个只含 ......
Brackets Sequence 1141 POJ

POJ-1143

给定一个序列,轮到谁,取出一个数k删除,并删除i*k(i=1,2,3,.....), 设k1为已经删除的数,同时删除k1*i+k*j,(i=1,2,3,.....;j同上 ),轮到谁没数删除时谁就输了。。 求先手取数 可以取那些数字 ,能保证获胜 #include<iostream> #includ ......
1143 POJ

POJ--2376 Cleaning Shifts(贪心)

记录 15:57 2023-4-20 http://poj.org/problem?id=2376 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 Description Farmer John is assigning some of his N (1 <= N <= ......
Cleaning Shifts 2376 POJ

POJ--3050 Hopscotch(暴搜)

记录 21:36 2023-4-16 http://poj.org/problem?id=3050 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 Description The cows play the child's game of hopscotch in a ......
Hopscotch 3050 POJ

kuangbin专题一 简单搜索 迷宫问题(POJ-3984)

#迷宫问题 Time Limit: 1000MS Memory Limit: 65536K ####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, ......
迷宫 kuangbin 专题 问题 3984

kuangbin专题一 简单搜索 罐子(POJ-3414)

#Pots Time Limit: 1000MS Memory Limit: 65536K ####Description You are given two pots, having the volume of A and B liters respectively. The following ......
罐子 kuangbin 专题 3414 POJ