Given an array of integers, return if and only if it is a valid mountain array . Recall that A is a mountain array if and only if: There exists some w ...
分类:
编程语言 时间:
2020-04-27 10:02:23
阅读次数:
120
错误: Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: COLLATION 'utf8mb4_general_ci' is not valid for CHARACT ...
分类:
其他好文 时间:
2020-04-27 09:52:53
阅读次数:
109
这道题数据范围比较小,可以想到一种比较暴力的做法,就是枚举,先用前缀和计算 我们枚举两个端点,将数据分为三段,之后枚举26个字母,就能知道答案是多少 这里有一个小技巧就是,我们在枚举26个字母的时候,就能够算出中间这段的最大值是哪个字母,在这个同时,可以算出两边取哪个更好 #include<bits ...
分类:
其他好文 时间:
2020-04-26 10:31:08
阅读次数:
66
Given a linked list, check whether it is a palindrome. Examples: Input: 1 -> 2 -> 3 -> 2 -> 1 -> null output: true. Input: 1 -> 2 -> 3 -> null output: ...
分类:
其他好文 时间:
2020-04-26 09:15:19
阅读次数:
66
题目链接:https://codeforces.com/contest/1343/problem/D、 解题思路:差分来借,具体看这里 #include<bits/stdc++.h> using namespace std; const int maxn=4e5+10; const int inf= ...
分类:
其他好文 时间:
2020-04-23 19:21:27
阅读次数:
62
"题目链接OvO" 题目大意 给一个长度为偶数且每个元素不大于$k$的正整数序列,你可以让任意一个元素修改为一个不大于$k$的正整数,求使每对$a_i$和$a_{n i+1}(i\leq \frac{n}{2})$的和都相等的最小修改次数。 分析 ...
分类:
其他好文 时间:
2020-04-23 12:07:35
阅读次数:
79
"题目" 题意:给出n(2e5)个数,可以修改某个数为$1\:to\:k$(2e5),问最少几次修改使$i\in1\:to\:\frac{n}{2}$,$满足a[i] + a[n i+1] = x$ 解法:差分维护取某个值为定值时所需要的最少操作次数。 对于每一对数令 分四类情况讨论: 一、如果定值 ...
分类:
其他好文 时间:
2020-04-22 20:01:14
阅读次数:
137
题意:给你一个长度为偶数n的数组,每次可以将一个元素修改为不大于k的值,要求每个a[i]+a[n-i+1]都相等,求最少操作多少次 题解:假设每一对的和都为X,小的记为mn,大的记为mx; 我们对每一对相应的数考虑,有三种情况:改一个数,改两个数,不改 1.改一个数:当x∈[mn+1,mx+k]; ...
分类:
其他好文 时间:
2020-04-22 13:29:41
阅读次数:
75
1、解读Login login(){ // 对当前loginForm进行验证,验证属性 this.$refs.loginForm.validate(valid => { if (valid) { this.loading = true //调用store下的login方法 this.$store.d ...
分类:
其他好文 时间:
2020-04-22 12:53:58
阅读次数:
269
题目链接:https://codeforces.com/contest/1343 A Candies 随便做做。 B Balanced Array 随便做做。 D Constant Palindrome Sum 题意:如题目的名字,给一个 $n$ 个数字的数组,要保持对称位置的和恒为常数,但是每个数 ...
分类:
其他好文 时间:
2020-04-22 09:23:49
阅读次数:
69