uva10714Ants Anarmyofantswalkonahorizontalpoleoflengthlcm,eachwithaconstantspeedof1cm/s.Whenawalking...

  qvce4elbFrsc   2023年11月12日   35   0   0 #includeACMC语言uvaMax

uva10600ACMContestandBlackout 题目大意:给你一张图,求最小生成树和次小生成树。 解题思路:次小生成树。 include<cstdio> include<cstring> include<algorithm> include<cmath> include<cstdlib> usingnamespacestd; typedeflonglongll; constintN=105; constintINF=0x3f3f3f3f; intn,m; boolvis[N],used[N][N]; intpre[N...

  qvce4elbFrsc   2023年11月02日   47   0   0 sed#includeMax

uva10740NottheBest 题目大意:求第K短路。 解题思路:A算法。这题数据量比较小,也可以暴力。 A算法 include<cstdio> include<cstring> include<algorithm> include<cmath> include<cstdlib> include<queue> usingnamespacestd; typedeflonglongll; constintN=105; constintINF=0x3f3f3f3f; intn,m; ints,t,K; inth[N]...

  qvce4elbFrsc   2023年11月02日   50   0   0 i++ios#include

uva10453MakePalindrome 题目大意:给出一段字符串,要求求出最少加入几个字符(任意位置),可以让该字符串变成会问字符串,并输出修改以后的回文字符串。 S[i]S[j],dp[i][j]=dp[i+1][j−1]当S[i]!=S[j],dp[i][j]=min(dp[i+1][j],dp[i][j−1])+1,在DP的过程中记录对该区间的操作类型,最后递归输出。 include<cstdio> include<cstring> include<algorithm> include<cmath> include<cstd...

  qvce4elbFrsc   2023年11月02日   54   0   0 字符串#include回文字符串

ACDREAM03CRobbers ProblemDescription Nrobbershaverobbedthebank.AstheresultoftheircrimetheychancedtogetMgoldencoins.Beforetherobberythebandhasmadeanagreementthataftertherobberyi-thgangsterwouldgetXi/Yofallmoneygained.However,itturnedoutthatMmaybenotdivisiblebyY. Theproblemwhichnowshouldbesolvedbyr...

  qvce4elbFrsc   2023年11月02日   44   0   0 i++#define#include

         uva10970BigChocolate   BigChocolate MohammadhasrecentlyvisitedSwitzerland.Asheloveshisfriendsverymuch,hedecidedtobuysomechocolateforthem,butasthisfinechocolateisveryexpensive(YouknowMohammadisalittleBITstingy!),hecouldonlyaffordbuyin...

  qvce4elbFrsc   2023年11月02日   71   0   0 sedBigc++ideuva

                            uva216 GettinginLine Computernetworkingrequiresthatthecomputersinthenetworkbelinked. Thisproblemconsidersa``linear"networkinw...

  qvce4elbFrsc   2023年11月02日   35   0   0 c++Networkideuva#include

                               uva10700 Cameltrading Background Aroud800A.D.,ElMamum,CalifofBaghdadwaspresentedtheformula1+234+5,whichhadi...

  qvce4elbFrsc   2023年11月02日   45   0   0 ACMC语言uva#includeMax

uva11324TheLargestClique 题目大意:给出一个有向图,要求出该图中的最大结点集。结点集满足下列条件,结点集中的每两个点u,v,要么u可以到达v,要么v可以到达u,要么互相可达。 解题思路:在原图的基础上,先求一次强连通分量。然后把每个强连通分量都缩成点之后,可以得到一个有向无环图,然后可以用dp,求出最大嵌套。 include<cstdio> include<cstring> include<algorithm> include<cmath> include<cstdlib> include<stack...

  qvce4elbFrsc   2023年11月02日   60   0   0 i++#includeMax

uva10025The?1?2?...?n=kproblem Theproblem Giventhefollowingformula,onecansetoperators'+'or'-'insteadofeach'?',inordertoobtainagivenk?1?2?...?n=k Forexample:toobtaink=12,theexpressiontobeusedwillbe:1+2+3+4+5+67=12withn=7 TheInput Thefirstlineisthenumberoftestcases,followedbyablankline. Eachtestcaseo...

  qvce4elbFrsc   2023年11月02日   39   0   0

                     uva350Pseudo-RandomNumbers Computersnormallycannotgeneratereallyrandomnumbers,butfrequentlyareusedtogeneratesequencesofpseudo-randomnumbers.Thesearegeneratedbysomealgorithm,...

  qvce4elbFrsc   2023年11月02日   69   0   0
关注 更多

空空如也 ~ ~

粉丝 更多

空空如也 ~ ~