poj 1719Shooting Contest】的更多相关文章

//本题大意是对于一个r*c的矩阵,每一列有两个是白色的 //如今选c个位置,要求每一行至少有一个白色的方格被选上 //每一列仅仅能选一个 //用二分匹配求出最大匹配,假设最大匹配等于r,则满足 //每一行至少有一个白色的格子被选上 //注意c>r的情况 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int maxn = 1010; int line…
题目链接:http://poj.org/problem?id=3660 有n头奶牛还有m种关系a,b表示a牛逼b彩笔,所以a排名比b高 最后问你给出的关系最多能确定多少头奶牛的排名,而且给出的数据不会有矛盾 其实就是给出了一个无环的有向图,只要有一点他能跟所有点有联系那么这个点的排名就知道了. 可以用一下floyd的思想还是能简单实现的. 其实这题简单来说就是能走完所有点的路都经过哪些点,最容易想到的就是floyd求多源点的最短路 然后稍微改一下就好了. #include <iostream>…
Ikki's Story I - Road Reconstruction Time Limit: 2000MS   Memory Limit: 131072K Total Submissions: 7659   Accepted: 2215 Description Ikki is the king of a small country – Phoenix, Phoenix is so small that there is only one city that is responsible fo…
分段的概率DP+矩阵快速幂                        Scout YYF I Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4180   Accepted: 1076 Description YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate into the enemy's base. Af…
The merchant Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 4556   Accepted: 1576 Description There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and w…
传送门 Time Limit: 3000MS Memory Limit: 65536K Description There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and wants to earn as much money as possible in each path.…
Scout YYF I Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5565   Accepted: 1553 Description YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate into the enemy's base. After overcoming a series difficulties,…
Description YYF -p. Here is the task, given the place of each mine, please calculate the probality that YYF can go through the "mine road" safely. Input The input contains many test cases ended with EOF. Each test case contains two lines. The Fi…
Blocks Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3997   Accepted: 1775 Description Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of paint…
Description There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and wants to earn as much money as possible in each path. When he move along a path, he can choose on…