Given a m * n matrix mat of integers, sort it diagonally in ascending order from the top-left to the bottom-right then return the sorted array. Exampl ...
分类:
其他好文 时间:
2020-01-29 10:17:46
阅读次数:
61
Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each input file contains one test ...
分类:
其他好文 时间:
2020-01-28 23:03:34
阅读次数:
83
"题目" 正解 这题一看也是不能写的题目…… 用个平衡树来维护。 平衡树维护的是一个$Trie$的序列。每个$Trie$表示这段区间中所有数都会排序一遍。 进行各种操作时,首先会将至多两个节点的$Trie$分裂。分裂$Trie$会新增$O(\lg n)$个节点。 然后将整段区间旋到一棵子树内,然后打 ...
分类:
其他好文 时间:
2020-01-28 21:10:43
阅读次数:
54
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <title>Title</title></head><body><s ...
分类:
编程语言 时间:
2020-01-28 19:16:38
阅读次数:
69
一、redis支持的数据类型 1)String 常用命令:set/get/decr/incr/mget等; 应用场景:String是最常用的一种数据类型,普通的key/value存储都可以归为此类; 实现方式:String在redis内部存储默认就是一个字符串,被redisObject所引用,当遇到 ...
分类:
其他好文 时间:
2020-01-28 19:07:40
阅读次数:
100
#include<iostream> #include<stdio.h> #include<algorithm> #include<cstring> using namespace std; const int N=1010; const int M=20010; const int INF=0x3 ...
分类:
其他好文 时间:
2020-01-28 18:58:25
阅读次数:
76
//最大的算式 //对输入的N个数逆序排序,前K个数的积乘于剩余N-K个数的和 #include<stdio.h> #include<stdlib.h> #define MAXN 100 int comp(const void*a,const void*b)//用来做比较的函数。 { return ...
分类:
编程语言 时间:
2020-01-28 17:47:43
阅读次数:
104
例一:对目录下的单词文件进行单词统计 /word/first.txt: /word/second.txt: /word/third.txt: 运行结果: import java.io.File; import java.io.PrintWriter; import scala.io.Source; ...
分类:
其他好文 时间:
2020-01-28 13:46:18
阅读次数:
76
这题真的是非常标准的模板题啊 看到连最少的边,第一时间会想到 $kruskal$ .这道题的难点其实就一个:你要注意到连边权最大的边使整个图联通 为什么:题意是第i个点想走到 $pos[i]$ ,也就是说点i和点 $pos[i]$ 必须要联通. 为什么想不到 $kruskal$ :因为 $krusk ...
分类:
其他好文 时间:
2020-01-28 12:21:13
阅读次数:
57
题解 排队模拟。需要注意的是,如果一个人在17:00及以后还没有开始服务,这种情况才输出“Sorry”。一个人在17:00之前已经开始了服务,就算结束服务在17:00之后,这样也是没问题的。 代码 #include<bits/stdc++.h> using namespace std; const ...
分类:
其他好文 时间:
2020-01-28 09:41:55
阅读次数:
66