1.1 Shuffle和排序 Shuffle:系统执行排序,将map输出作为输入传给reduce的过程称为shuffle。 1.1.1 Map端缓存排序输出 (1) 写入缓冲区:map输出结果先输出到内存缓冲区(默认100M,通过属性mapreduce.Task.io.sort.mb设置) (2) ...
分类:
编程语言 时间:
2020-01-24 15:56:59
阅读次数:
78
ybt1199 全排列 【题目描述】 给定一个由不同的小写字母组成的字符串,输出这个字符串的所有全排列。 我们假设对于小写字母有‘a’ include using namespace std; string a,b; int l; void f(int x) int main() { cin a; ...
分类:
其他好文 时间:
2020-01-24 14:35:30
阅读次数:
80
「BOI2007」Mokia "传送门" 把查询拆成四部分然后容斥计算答案(二维前缀和) 然后 $\text{CDQ}$ 分治算答案。 参考代码: ...
分类:
其他好文 时间:
2020-01-24 00:33:10
阅读次数:
85
「luogu3810」陌上花开 "传送门" 三维偏序, $\text{CDQ}$ 分治板子题。 判重的地方注意一下,别的就都是板子了。 参考代码: ...
分类:
其他好文 时间:
2020-01-24 00:23:43
阅读次数:
68
本篇记录一下TensorFlow中张量的排序方法 tf.sort和tf.argsort # 声明tensor a是由1到5打乱顺序组成的 a = tf.random.shuffle(tf.range(5)) # 打印排序后的tensor print(tf.sort(a,direction='DESC ...
分类:
编程语言 时间:
2020-01-24 00:21:15
阅读次数:
136
STL 1.输入输出 1.1.C语言的输入输出 1.2.C++语言的输入输出 cpp include include using namespace std; int main(){ int a[] = {1,5,4,8,10,6,3}; sort(a,a+7); //sort(a,a+7,less ...
分类:
其他好文 时间:
2020-01-23 18:26:02
阅读次数:
90
根据字符出现频率排序。题意是给一个字符串,请按照出现字符的频率高低重新排列这个字符并输出。例子, Example 1: Input: "tree" Output: "eert" Explanation: 'e' appears twice while 'r' and 't' both appear ...
分类:
其他好文 时间:
2020-01-23 13:58:02
阅读次数:
71
There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then th ...
分类:
其他好文 时间:
2020-01-23 13:55:58
阅读次数:
81
基本思想: 没什么难的,水题,重点在于审题; 关键点: 无; #include<iostream> #include<stdlib.h> #include<stdio.h> #include<vector> #include<string> #include<math.h> #include<alg ...
分类:
其他好文 时间:
2020-01-23 12:39:56
阅读次数:
82
不知道为什么会RE。。 待补 思路:链上求u和v两点路径第k小利用lca就转变为了 U+V LCA FA(LCA) 上的第k小,这因为每个点的主席树的root是从其父转移来的。可以用树链剖分求lca;在dfs序上建立主席树将树上问题转变为区间问题,询问的时候用主席树求区间k小值。 终于能写出这种题了 ...
分类:
其他好文 时间:
2020-01-23 12:35:32
阅读次数:
88