题目链接 中石油补题 题意: 给出你2n2n的方阵,让你从其中选出nn个点,使得他们两两点的距离不是根号下a也不是根号下b 思路: 首先我们看两点之间的距离:设两点x为x轴差,y为y轴差,那么我们之间的距离: \(dis^2=x^2+y^2\) 那么我们对其$dis^2$进行分析 首先我们知道$di ...
分类:
其他好文 时间:
2021-06-02 20:07:22
阅读次数:
0
995. Minimum Number of K Consecutive Bit Flips In an array A containing only 0s and 1s, a K-bit flip consists of choosing a (contiguous) subarray of l ...
分类:
其他好文 时间:
2021-02-20 12:13:50
阅读次数:
0
首先对于$p>50$,有经典的做法,即不断删去区间中不同的两数,最终剩下的即为出现次数超过一半的数(或没有),用线段树维护即可 那么对于$p\le 50$,类似的,即删去区间中不同的$\lfloor \frac{100}{p}\rfloor+1$个数,那么最终剩下的$\lfloor \frac{10 ...
分类:
其他好文 时间:
2020-10-20 16:37:35
阅读次数:
36
有 $m$ 种物品,每种物品第一次买价值为 $a_i$,以后每次买都是 $b_i$。求买 $n$ 件物品的最大总价值。$n \le 10^9, m \le 10^5$ ...
分类:
编程语言 时间:
2020-07-19 23:43:21
阅读次数:
190
Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make ...
分类:
其他好文 时间:
2020-07-15 13:09:25
阅读次数:
90
agc025_d Choosing Points https://atcoder.jp/contests/agc025/tasks/agc025_d Tutorial https://img.atcoder.jp/agc025/editorial.pdf 我们要解决的问题实际上是 有两个大小为$V$ ...
分类:
其他好文 时间:
2020-07-10 15:36:35
阅读次数:
66
原题链接在这里:https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/ 题目: Given a string s, a k duplicate removal consists of choosing k ...
分类:
其他好文 时间:
2020-02-18 09:50:48
阅读次数:
75
超参数 定义 在拟合模型之前需要定义好的参数 适用 Linear regression: Choosing parameters Ridge/lasso regression: Choosing alpha k Nearest Neighbors: Choosing n_neighbors Para ...
分类:
其他好文 时间:
2020-02-14 13:12:52
阅读次数:
92
Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make ...
分类:
其他好文 时间:
2020-02-07 10:42:50
阅读次数:
74
给定长度为 n 的序列,m 次询问以及参数 p。共有两类询问:
(1)"1 l r id":将区间 [l, r] 的颜色改成 id。
(2)"2 l r":对于区间 [l, r],输出不超过 100/p 种颜色,要求在区间内占比超过 >= p% 的颜色都应该被输出。 ...
分类:
其他好文 时间:
2019-12-30 14:11:22
阅读次数:
71