题目链接: 思路:dfs序+暴力匹配 1. 错误的想法:直接把?ss?和?tt?先转换成 DFS 序,然后看?tt?的 DFS 序是否是?ss?的 DFS 序的「子串」。 反例如下: 2. 为了解决这个问题,我们可以引入两个空值 lNull 和 rNull,当一个节点的左孩子或者右孩子为空的时候,就 ...
分类:
其他好文 时间:
2020-05-07 11:59:42
阅读次数:
65
收到zabbix告警,一台服务器上inodes使用率超过90%了,如下:【XX服务】状态:PROBLEM地址:xx.xx.xx.xx主机:xxxxxx_xx-db1时间:2020.05.0420:15:48事件:Freeinodesislessthan10%onvolume/数值:Freeinodeson/(percentage)(vfs.fs.inode[/,pfree]):10%解决方法:通过
分类:
系统相关 时间:
2020-05-07 09:13:53
阅读次数:
86
@[toc] A. Yet Another Tetris Problem 题意: 给定一个数组,每次可以给其中一个元素+2 ,问可否经过若干次操作使所有元素的值一样 分析: 找到最大的元素,判断与其它元素的差值是否是二的整倍数即可 代码: cpp include using namespace st ...
分类:
其他好文 时间:
2020-05-06 21:21:19
阅读次数:
58
题目描述 City C is really a nightmare of all drivers for its traffic jams. To solve the traffic problem, the mayor plans to build a RTQS (Real Time Query ...
分类:
其他好文 时间:
2020-05-06 19:43:30
阅读次数:
70
https://vjudge.net/problem/UVA-11698 题目 输入n,k,求秩为k的n元置换个数(即k是最小的正整数,使置换$A^k(x)=x$),结果对$2^{31}-1$取模 $1\leqslant N\leqslant 100,1\leqslant K\leqslant 2^ ...
分类:
其他好文 时间:
2020-05-06 19:27:05
阅读次数:
58
tips 1 关注排名的实现代码。 2 熟练sort的使用。 3 熟练vector的使用。 插入用 题目大意 有n个考场,每个考场有若干数量的考生。现在给出各个考场中考生的准考证号和分数,要求将所有考生按分数从高到低排序,并按顺序输出所有考生的准考证号、排名、考场号、考场内排名。 "原题链接" 思路 ...
分类:
其他好文 时间:
2020-05-06 18:11:30
阅读次数:
54
给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: "abcabcbb"输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。示例 2: 输入: "bbbbb"输出: 1解释: 因为无重复字符的最长子串是 "b",所以其长度为 1。示例 3: ...
分类:
编程语言 时间:
2020-05-06 17:58:41
阅读次数:
66
拉马努金连分数参考:这里 Here is a famous problem posed by Ramanujan > Show that $$\left(1 + \frac{1}{1\cdot 3} + \frac{1}{1\cdot 3\cdot 5} + \cdots\right) + \lef ...
分类:
其他好文 时间:
2020-05-06 01:12:32
阅读次数:
199
The "eight queens puzzle" is the problem of placing eight chess queens on an 8 chessboard so that no two queens threaten each other. Thus, a solution ...
分类:
其他好文 时间:
2020-05-05 20:21:48
阅读次数:
56
题目 https://www.luogu.com.cn/problem/P1042 题目分析 直到分差大于或者等于2,才一局结束:意思就是即使有人先得了1分,但是两人分差<2也不算结束,要继续比赛,直到分差大于或者等于2才这局结束 代码 #include<iostream> #include<cst ...
分类:
其他好文 时间:
2020-05-05 19:57:49
阅读次数:
58