B. Pairs 题面描述: 给你m对数,每一个数都在1和n之间,问是否存在两个数x和y,对于每一对数来说,至少存在一个数与x或y相等。如果存在输出 “YES”,否则输出“NO” 思路: 首先,第一对数中至少存在x或y中的一个,分别赋值给a和b,同时,x,y中的另一个数可能是a , b 中的另一个, ...
分类:
其他好文 时间:
2019-06-12 00:52:58
阅读次数:
72
Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the pers ...
分类:
其他好文 时间:
2019-06-09 13:17:34
阅读次数:
90
第0章 预备知识0.1 Scala0.1.1 Scala 操作符0.1.2 拉链操作0.2 Spark Core0.2.1 Spark RDD 持久化0.2.2 Spark 共享变量0.3 Spark SQL0.3.1 RDD、DataFrame 与 DataSet0.3.2 DataSet 与 R ...
分类:
数据库 时间:
2019-06-08 11:48:58
阅读次数:
143
给定区间集合$I$和正整数$k$, 计算$I$的最长$k$可重区间集的长度. 区间离散化到$[1,2n]$, $S$与$1$连边$(k,0)$, $i$与$i+1$连边$(k,0)$, $2n$与$T$连边$(k,0)$. 对于每个区间$(l,r)$, $l$与$r$连边$(1,l-r)$. 最小费 ...
分类:
其他好文 时间:
2019-06-08 11:38:19
阅读次数:
73
API epoll提供给用户进程的接口有如下四个,本文基于linux 5.1.4源码详细分析每个API具体做了啥工作,通过UML时序图理清内核内部的函数调用关系。 1. int epoll_create1(int size); 创建一个epfd句柄,size为0时等价于int epoll_creat ...
分类:
系统相关 时间:
2019-06-08 01:08:51
阅读次数:
148
```cpp include include include using namespace std; struct edge { int to,val; }; priority_queue,vector ,greater q; vectore[2505]; int dis[2505]; int v ...
分类:
其他好文 时间:
2019-06-07 13:16:55
阅读次数:
127
1.分类 基本数据结构(basic data types) 辅助数据结构(Helper object) 大型数据结构(Large array object):mat STL数据结构:vector,pair 2.基础数据结构:Point、Scalar、Size、cv::Rect、RotatedRect ...
分类:
其他好文 时间:
2019-06-07 12:46:24
阅读次数:
121
经常有一些需要做id打通的场景,比如用户id打通等, 问题抽象是每条数据都可以解析出一个或多个kv pair:(id_type,id),然后需要将某一个kv pair匹配的多条数据进行merge; 比如: data1: Array(('type1', 'id1'), ('type2', 'id2') ...
分类:
其他好文 时间:
2019-06-07 11:02:04
阅读次数:
140
Optional Readings : Questions for Correcting Mistakes Visualizing Error Detection Error Detection Algorithm Explanation-Free Repair Explaining the Mis ...
分类:
其他好文 时间:
2019-06-07 10:51:32
阅读次数:
94
作为橙名来水了一发…… 这次题目就比上次良心多了。7题有5题会做。 然而风格仍然很怪异……还是练少了? A 水题。不过一开始没注意细节挂了几发,罚时罚的真痛…… 明显是能除以 $k$ 就除以 $k$,否则就 $-1$。但注意不能直接最裸的模拟。 时间复杂度 $O(T\log n)$。 #includ ...
分类:
其他好文 时间:
2019-06-07 00:46:36
阅读次数:
95