2012年5月5日
摘要:
http://poj.org/problem?id=3661二维DP#include<iostream>#include<cstring>#include<string>#include<cmath>#include<cstdio>using namespace std;const int N=10005;const int M=505;int L[N];int rest[N][M];int norest[N][M];int main(){ int n,m; while(scanf("%d %d",&n,& 阅读全文
摘要:
http://poj.org/problem?id=3660此题不是最短路 但可以用到 floydA牛可以打败B牛 B牛可以打败C牛 那么A牛一定可以打败C牛讲这个关系进行传递每一头牛打败别的牛(i头)和被别的牛打败(j头)的和(i+j)必须是n-1 才能确定其排名#include<iostream>#include<cstring>#include<string>#include<cmath>#include<cstdio>using namespace std;const int N=105;bool beat[N][N];int 阅读全文