题目描述 For their physical fitness program, N (2 ≤ N ≤ 1,000,000) cows have decided to run a relay race using the T (2 ≤ T ≤ 100) cow trails throughout the pasture. Each trail connects two different intersections (1 ≤ I1i ≤ 1,000; 1 ≤ I2i ≤ 1,000), each…
#include<stdio.h> #define inf 1000000000000000 #define N 100 long long tmp[N][N],ma[N][N]; int n; long long min(long long a,long long b) { return a<b?a:b; } void floy(long long a[N][N]) { int i,j,k; for(i=1;i<=n;i++) for(j…
题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=34985 We define a kind of strings as elegant string: among all the substrings of an elegant string, none of them is a permutation of "0, 1,…, k". Let function(n, k) be the number of elegant s…