Machine Schedule
1#include <iostream>2#include <cstdio>3#include <cstring>4#include <cmath>5#include <algorithm>6#include <string>7#include <vector>8#include <Set>9#include <map>Ten#include <stack> One#include <queue> A#include <sstream> -#include <iomanip> - using namespacestd; thetypedefLong LongLL; - Const intINF =0x4fffffff; - Const DoubleEXP = 1e-5; - Const intMS = the; + Const intSIZE =100005; - + //data struct A intEdges[ms][ms]; at intCx[ms],cy[ms]; - intMark[ms]; - - intn,m,k; - - intPathintu) in { - for(intv=1; v<m;v++) to { + if(edges[u][v]&&!Mark[v]) - { themark[v]=1; * if(cy[v]==-1||path (Cy[v])) $ {Panax Notoginsengcx[u]=v; -cy[v]=u; the return 1; + } A } the } + return 0; - } $ $ voidmatch () - { - intans=0; thememset (CX,0xFF,sizeof(CX)); -memset (CY,0xFF,sizeof(CY));Wuyi for(intu=1; u<n;u++) the { - if(cx[u]==-1) Wu { -memset (Mark,0,sizeof(Mark)); Aboutans+=path (u); $ } - } -printf"%d\n", ans); - } A + the intMain () - { $ while(SCANF ("%d", &n) &&N) the { thescanf"%d%d",&m,&k); thememset (Edges,0,sizeof(edges)); the intt,u,v; - for(intI=0; i<k;i++) in { thescanf"%d%d%d",&t,&u,&v); the if(u!=0&&v!=0) About { theedges[u][v]=1; the } the } + match (); - } the return 0;Bayi}
Machine Schedule naked binary match two point overlay book = = match number