Machine Schedule naked binary match two point overlay book = = match number

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.