題意:求從1到2的路徑中, 使得最長路盡量小。
細節參見代碼:
#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define Max(a,b) ((a)>(b)?(a):(b)) #define Min(a,b) ((a)<(b)?(a):(b)) using namespace std; typedef long long ll; typedef long double ld; const ld eps = 1e-9, PI = 3.1415926535897932384626433832795; const int mod = 1000000000 + 7; const int INF = int(1e9); // & 0x7FFFFFFF const int seed = 131; const ll INF64 = ll(1e18); const int maxn = 200 + 10; int T,n,m,cnt,p[maxn],kase=0; double ans[maxn][maxn],x[maxn],y[maxn]; struct node { int a, b; double dist; node(int a=0, int b=0, double dist=0):a(a), b(b), dist(dist) {} bool operator < (const node& rhs) const { return dist < rhs.dist; } }a[maxn*maxn]; vector g[maxn]; int _find(int x) { return p[x] == x ? x : p[x] = _find(p[x]); } void dfs(int u, int fa) { int len = g[u].size(); for(int i=0;i
題目: Write a m
C++設計模式之狀態模式(二) 2、智能空調的設計與實現
Contest2089,contest Problem E:
Windos_Hook_動態鏈接庫-CreateDllDem
poj 2538 WERTYU WERTYU
首先講講什麼是子類化,其實子類化很好理解,和以前一樣,