@[双连通分量] 题意: 有一个 n 个点 m 条边的无向图,问至少添加几条边,能让该图任意缺少一条边后还能相互连通。 双连通分量定义: 在无向连通图中,如果删除该图的任何一个结点都不能改变该图的连通性,则该图为双连通的无向图。一个连通的无向图是双连通的,当且仅当它没有关节点(这里面节点可换成边:分 ...
分类:
其他好文 时间:
2020-04-06 11:45:21
阅读次数:
62
Given a non empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti ...
分类:
其他好文 时间:
2020-04-06 09:48:06
阅读次数:
63
Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege ...
分类:
移动开发 时间:
2020-04-06 09:24:09
阅读次数:
91
A.Majestic 10 签到题。 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<bitset> #include<cassert> #include<cctype> #incl ...
分类:
其他好文 时间:
2020-04-05 20:25:53
阅读次数:
73
1、使用reverse函数 #include <algorithm> //添加头文件 reverse(s.begin(), s.end()); //具体用法 (s是一个string) ...
分类:
编程语言 时间:
2020-04-05 18:26:30
阅读次数:
63
01背包问题 而我们所求的结果就是$f[n][m]$。 1 #include <iostream> 2 #include <algorithm> 3 4 using namespace std; 5 6 7 const int N = 1010; 8 int v[N], w[N]; 9 int f[ ...
分类:
其他好文 时间:
2020-04-05 18:17:00
阅读次数:
73
"POJ 2502 题目链接" 写题过程 这道题目的输入算是一个点了,有点晕一开始看到这题的时候,后面写着写着发现还行。 这题一定要注意单位,题目给的是xx(km/h),一定要转化为xx(m/s)。 还有就是输出的数据我wa了无数遍 思路 不难发现这就是一道最短路的问题,有地铁的路建立双向的快速路, ...
分类:
其他好文 时间:
2020-04-05 14:00:38
阅读次数:
56
1.基础实用基础的数据结构详情 数据结构(data structure [?str?kt??(r)] )是计算机存储、组织数据的方式; 算法(algorithm [?ælɡ?r?ð?m] )是解决问题的方法/步骤和策略; 数据结构Array js中的数组结构非常简单(浏览器帮助我们进行封装处理好的) ...
分类:
编程语言 时间:
2020-04-05 09:32:31
阅读次数:
81
源码示例: #include <iostream>#include <vector>#include <algorithm> using namespace std; class IsEven{public: bool operator()(int x) { return x % 2 == 0; } ...
分类:
编程语言 时间:
2020-04-05 00:40:25
阅读次数:
79