• 2024-10-02题解:UVA117 The Postal Worker Rings Once
    此题要求我们求欧拉回路的长度。使用Floyd算法计算图中任意两点之间的最短路径,对于度数为奇数的路口(最多有两个),找到它们之间的最短路径并将其加入总路径长度中。代码:#include<bits/stdc++.h>#defineINF1e8usingnamespacestd;intdegree[26];intpath[26][26];intal
  • 2024-07-10LeetCode --- 2103. Rings and Rods 解题报告
    Question:Thereare n ringsandeachringiseitherred,green,orblue.Theringsaredistributed acrosstenrods labeledfrom 0 to 9.Youaregivenastring rings oflength 2n thatdescribesthe n ringsthatareplacedontotherods.Everyt