• 等级
  • 11461 访问
  • 26 原创
  • 0 转发
  • 273976 排名
  • 8 评论
  • 14 获赞

最大流和最小割问题

以下是根据个人的理解用大白话解释的定义:设有一个有向带边权图G,并确定图中一个结点作为源点(可以理解成起点),再确定另一个点作为汇点(可以理解成终点),在这个图中找到一个边集A,使得在这个图G中删掉A后有且仅有两个子图,且两个子图分别包含源点和汇点。其中这个点集A成为割集。当这个割集里的所有边的权值之和达到最小的时候,称其为最小割。从源点开始按照后一边的流量不得大于前一边(后一边和前一边之间由...

2019-05-17 23:44:21

打印杨辉三角的四种方法(C语言版)

方法一:(最简单粗暴的二维数组版)#include<stdio.h>#definemaxn1000longlonga[maxn][maxn];intmain(){intn;scanf("%d",&n);memset(a,0,sizeof(a));inti,j;for(i=0;i<n;++i){...

2019-05-12 12:04:11

寻找文本中的ip地址(正则表达式)

#include<iostream>#include<cstdio>#include<regex>usingnamespacestd;intmain(){ regexreg1("(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]...

2018-12-11 00:30:05

文本处理简记

#include<iostream>#include<cstdio>#include<string>#include<sstream>usingnamespacestd;//实验三模板template<classout_t,classin_t>out_tconvert(constin_t&val...

2018-12-09 20:00:26

Different Circle Permutation HDU – 5868题解

Youmaynotknowthisbutit'safactthatXinghaiSquareisAsia'slargestcitysquare.ItislocatedinDalianand,ofcourse,alandmarkofthecity.It'sanidealplaceforoutinganytimeofthe...

2018-11-21 15:40:31

I Count Two Three题解

IwillshowyouthemostpopularboardgameintheShanghaiIngressResistanceTeam.Itallstartedseveralmonthsago. WefoundoutthehomeaddressoftheenlightenedagentIcount2threeanddecided...

2018-07-24 19:24:50

hdu 6227 Rabbits题解

HereN(N≥3)rabbitsareplayingbytheriver.Theyareplayingonanumberline,eachoccupyingadifferentinteger.Inasinglemove,oneoftheouterrabbitsjumpsintoaspacebetweenanyother...

2018-07-19 17:19:26

array array array题解

Oneday,KaitouKiddohadstolenapricelessdiamondring.ButdetectiveConanblockedKiddo'spathtoescapefromthemuseum.ButKiddodidn'twanttogiveitback.So,KiddoaskedConanaquestion....

2018-07-17 15:15:26

cable cable cable题解

Connectingthedisplayscreenandsignalsourceswhichproducedifferentcolorsignalsbycables,thenthedisplayscreencanshowthecolorofthesignalsource.Noticethateverysignalsourcecanon...

2018-07-16 20:45:17

Color it题解

Doyoulikepainting?LittleDdoesn'tlikepainting,especiallymessycolorpaintings.NowLittleBispainting.Topreventhimfromdrawingmessypainting,LittleDasksyoutowriteaprogramtoma...

2018-07-15 12:06:16

A Math Problem题解

Youaregivenapositiveintegern,pleasecounthowmanypositiveintegersksatisfy kk≤nkk≤n. InputTherearenomorethan50testcases. Eachcaseonlycontainsapositivseintegerninaline. 1≤n≤...

2018-07-14 21:22:00

CCF 火车购票 题解

试题编号:201609-2试题名称:火车购票时间限制:1.0s内存限制:256.0MB问题描述:问题描述  请实现一个铁路购票系统的简单座位分配算法,来处理一节车厢的座位分配。  假设一节车厢有20排、每一排5个座位。为方便起见,我们用1到100来给所有的座位编号,第一排是1到5号,第二排是6到10号,依次类推,第20排是96到100号。  购票时,一个人可能购一张或多张票,最多不超过5张。如果这...

2018-03-15 09:06:23

Reading comprehension题解

TimeLimit:2000/1000MS(Java/Others)    MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):1286    AcceptedSubmission(s):515ProblemDescriptionReadtheprogrambelowcarefullythenansw...

2018-03-06 21:13:01

Fast Matrix Calculation题解

Oneday,AliceandBobfeltboredagain,BobknowsAliceisagirlwholovesmathandisjustlearningsomethingaboutmatrix,sohedecidedtomakeacrazyproblemforher. Bobhasasix-faceddicew...

2018-03-05 21:13:51

M斐波那契数列

M斐波那契数列F[n]是一种整数数列,它的定义如下: F[0]=a F[1]=b F[n]=F[n-1]*F[n-2](n>1) 现在给出a,b,n,你能求出F[n]的值吗?Input输入包含多组测试数据; 每组数据占一行,包含3个整数a,b,n(0<=a,b,n<=10^9)Output对每组测试数据请输出一个整数F[n],由于...

2018-03-04 11:51:25

233 Matrix题解

TimeLimit:10000/5000MS(Java/Others)    MemoryLimit:65536/65536K(Java/Others)TotalSubmission(s):1355    AcceptedSubmission(s):806ProblemDescriptionInourdailylifeweoftenuse233toexp...

2018-03-02 23:45:07

Jzzhu and Sequences题解

Jzzhuhasinventedakindofsequences,theymeetthefollowingproperty:Youaregiven x and y,pleasecalculate fn modulo 1000000007 (109 + 7).InputThefirstlinecontainstwointegers x and y (|x|, ...

2018-03-02 12:54:51

Error Correction题解

Abooleanmatrixhastheparitypropertywheneachrowandeachcolumnhasanevensum,i.e.containsanevennumberofbitswhichareset.Here'sa4x4matrixwhichhastheparityproperty: 1010...

2018-03-01 16:39:33

Modular multiplication of polynomials 题解

Considerpolynomialswhosecoefficientsare0and1.Additionoftwopolynomialsisachievedby'adding'thecoefficientsforthecorrespondingpowersinthepolynomials.Theadditionofcoefficients...

2018-02-28 16:20:12

codevs1011数的计算

#includeusingnamespacestd;intn,s=1;intcount(inttt){inti;if(tt/2==0)return0;else{for(i=1;i<=tt/2;++i){++s;if(i>=2)count(i);elsecontinue;}}}intmain(){cin>>n;count(n);cout<

2017-12-01 22:04:44

专属晴天娃娃

关注
  • 计算机软件/学生
  • 中国
奖章
  • 持之以恒
  • 勤写标兵Lv1