Find Pair 思路 排一下序然后枚举计数就行了,不是挺简单的嘛。 这是我以为能过的代码,没想到$Wrong\ answer\ on\ test\ 3$,还是只能过样例。 ...
分类:
其他好文 时间:
2020-05-04 13:05:34
阅读次数:
64
题解 首先我们得找到任意一个合法的序列,这可以使用贪心算法在 $O(N\log N)$ 的时间复杂度内做到。我们可以把所有的区间 $(a_i,b_i)$ 按左端点从小到大进行排序,然后从左到右扫描这些区间。我们去找朋友 $j$ 可以在哪些位置,我们把所有左端点 $a_i\leq j$ 的区间的右端点 ...
分类:
其他好文 时间:
2020-05-03 00:57:36
阅读次数:
84
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache ...
分类:
其他好文 时间:
2020-05-02 21:03:57
阅读次数:
57
判下连通,离线下来连边,就是个裸的板子了QvQ。 我们把一堆边连到一个点,那个点连到一堆边,这样就可以满足 [l1,r1] to [l2,r2] 了 可以用 zkw 线段树来跑 spfa,奇怪的姿势增加了。 ...
分类:
其他好文 时间:
2020-05-02 18:47:50
阅读次数:
47
The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. A binary search tree (BST) i ...
分类:
其他好文 时间:
2020-05-02 14:54:12
阅读次数:
50
十四、企业实战案例 (一)使用for循环在/oldboy目录下批量创建10个html文件,其中文件名包含10个随机小写字母加固定字符串0ldoby。 思路分析,产生随机数字方法: ①核心是创建10个随机小写字母。 应用实例 shell [root@centos6 kvm3 shili] cat 14 ...
分类:
系统相关 时间:
2020-04-29 23:33:10
阅读次数:
75
"传送门" 题意: 给出一个$n$行$m$列的$01$矩阵,每次可以选择任一行或者任一列对其进行翻转。 问进行任意次操作过后,矩阵中$1$最少的个数为多少。 $n\leq 20,m\leq 100000$。 思路: 行数这么少,我们可以直接考虑状压枚举行的状态,固定行的状态过后,每一列就贪心选择$0 ...
分类:
其他好文 时间:
2020-04-29 23:25:40
阅读次数:
76
typedef pair<string,Student>pair_t; int main() { map<string,Student> mapstu; mapstu.insert(pair_t("2",Student("delaiwen",23))); mapstu.insert(pair_t(" ...
分类:
编程语言 时间:
2020-04-28 13:24:51
阅读次数:
57
[root@jenkins ~]# ssh-keygen -t rsa ##在命令行输入此命令,直接按三次回车 Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa ...
分类:
系统相关 时间:
2020-04-27 22:52:37
阅读次数:
91
static bool cmp(pair<char, int> a , pair<char,int> b) { return a.second>b.second; //按照value从大到小重新排序 } string frequencySort(string s) { unordered_map<c ...
分类:
编程语言 时间:
2020-04-27 22:52:06
阅读次数:
131