We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer arra ...
分类:
其他好文 时间:
2018-10-23 10:58:59
阅读次数:
157
CMakeLists.txt cmake_minimum_required (VERSION 2.6) project (Test) set (Test_VERSION_MAJOR 1) set (Test_VERSION_MINOR 0) configure_file ( "${PROJECT_S... ...
分类:
其他好文 时间:
2018-10-21 22:28:25
阅读次数:
200
#include #define int long long using namespace std; const int maxn=4000+10; char a[maxn][maxn]; bool tf[maxn][maxn]; int32_t main() { int n,x; scanf("... ...
分类:
其他好文 时间:
2018-10-21 19:33:19
阅读次数:
191
如果是求和就很好做了... 不是求和也无伤大雅.... 一维太难限制条件了,考虑二维限制 一维$dfs$序,一维$dep$序 询问$(x, k)$对应着在$dfs$上查$[dfn[x], dfn[x] + sz[x] - 1]$,在$dep$序上查$[dep[x], dep[x] + k]$ 这样子 ...
分类:
其他好文 时间:
2018-10-19 23:46:18
阅读次数:
176
Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For ...
分类:
其他好文 时间:
2018-10-19 18:22:37
阅读次数:
156
题面: 传送门:http://codeforces.com/problemset/problem/893/F 题目大意:给你一颗有根树,点有权值,问你每个节点的子树中距离其不超过k的点的权值的最小值。(边权均为1,强制在线) Solution 这题很有意思。 我们一般看到这种距离不超过k的题目,第一 ...
分类:
其他好文 时间:
2018-10-19 10:14:11
阅读次数:
323
表格的高级应用 ID gender name 01 male John ... ...
分类:
其他好文 时间:
2018-10-19 00:18:58
阅读次数:
91
class Solution { public: int maxProduct(vector& nums) { if(nums.empty()) return 0; if(nums.size() == 1) return nums[0]; int maxAll = n... ...
分类:
其他好文 时间:
2018-10-18 19:48:25
阅读次数:
165
Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont ...
分类:
其他好文 时间:
2018-10-18 10:54:41
阅读次数:
175
Mojo For Chromium Developers Overview This document contains the minimum amount of information needed for a developer to start using Mojo in Chromium. ...
分类:
其他好文 时间:
2018-10-16 22:11:57
阅读次数:
515