单向并查集,问至少给几个点可以遍历全图,连通块数量n,入度为0的点的数量m,取max(n,m)~ #include<cstdio> #include<algorithm> #include<cstring> using namespace std; const int maxn=1e6+14; in ...
分类:
其他好文 时间:
2020-02-13 23:19:04
阅读次数:
104
实验 4 RDD 编程初级实践 一、实验目的 (1)熟悉 Spark 的 RDD 基本操作及键值对操作; (2)熟悉使用 RDD 编程解决实际具体问题的方法。 二、实验平台 操作系统:Ubuntu16.04 Spark 版本:2.1.0 三、实验内容和要求 1.spark-shell 交互式编程 下 ...
分类:
其他好文 时间:
2020-02-13 23:01:30
阅读次数:
143
dfs判断图的连通块数量~ #include<cstdio> #include<algorithm> #include<vector> #include<cstring> using namespace std; const int maxn=1e6+14; vector<int> g[maxn]; ...
分类:
其他好文 时间:
2020-02-13 22:59:25
阅读次数:
77
基础并查集~ #include<cstdio> #include<algorithm> #include<cstring> #include<unordered_map> #include<iostream> #include<string> using namespace std; const i ...
分类:
其他好文 时间:
2020-02-13 22:48:22
阅读次数:
94
按要求递归建树输出~ #include<cstdio> #include<algorithm> #include<cstring> using namespace std; const int maxn=1014; struct node { int data; node * left; node ...
分类:
其他好文 时间:
2020-02-13 22:31:13
阅读次数:
66
给定 N 个正整数,要求你从中得到下列三种计算结果: A1 = 能被 3 整除的最大整数 A2 = 存在整数 K 使之可以表示为 3K+1 的整数的个数 A3 = 存在整数 K 使之可以表示为 3K+2 的所有整数的平均值(精确到小数点后 1 位) 输入格式: 输入首先在第一行给出一个正整数 N,随 ...
分类:
其他好文 时间:
2020-02-13 21:01:12
阅读次数:
465
#include<stdio.h> #include<algorithm> #include<iostream> using namespace std; const int maxn=1e4+5; const int inf=0x3f3f3f3f; struct edge{ int v, next ...
分类:
其他好文 时间:
2020-02-13 16:39:05
阅读次数:
49
这道题放在紫书最后一道,我以为挺难的,没想到挺简单的。 怎么一直不给结果,不等了,先睡了,明天再起来看。 #include<cstdio> #include<iostream> #include<algorithm> using namespace std; int main(){ int m,n, ...
分类:
其他好文 时间:
2020-02-13 09:50:31
阅读次数:
66
https://www.luogu.com.cn/problem/P1433 ...
分类:
其他好文 时间:
2020-02-13 00:03:45
阅读次数:
58
Codeforces Round #611 (Div. 3) 题意:给定的一维数组中,每i个元素为f(i),f(i)有两种取值,若f(i)为0,表示第i人不知道将礼物给谁,若f(i)>=1&&f(i)<=n表示第i人将礼物送给第f(i)人,要注意题目规定每个人只能收一件礼物也只能发一件礼物给别人,而 ...
分类:
其他好文 时间:
2020-02-12 18:28:24
阅读次数:
57