Given an array of non-negative integers nums, you are initially positioned at the first index of the array. Each element in the array represents your ...
分类:
其他好文 时间:
2020-12-29 11:18:24
阅读次数:
0
考虑莫队。 如果是单纯的莫队的话,还需要一个树状数组来维护逆序对数,这样子的话复杂度是 \(O(n^{1.5}\log n)\),难以接受。 怎么将这个树状数组消除? 考虑当前区间为 \([l,r-1]\) ,需要将右端点向右移动,即加入 \(a_r\) ,并且将答案加上 \(a_{l,l+1,\c ...
分类:
其他好文 时间:
2020-12-25 12:28:35
阅读次数:
0
####Data的格式 Data = namedtuple('Data', ['x', 'y', 'adjacency', 'train_mask', 'val_mask', 'test_mask']) Cora数据,包括数据下载,处理,加载等功能。当数据的缓存文件存在时,将使用缓存文件,否则将下载 ...
分类:
其他好文 时间:
2020-12-25 11:55:55
阅读次数:
0
原题链接:https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ class Solution { public int lengthOfLongestSubstring(String s) { ...
分类:
其他好文 时间:
2020-12-25 11:54:02
阅读次数:
0
Description This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $ k $ and $ m $ . I ...
分类:
其他好文 时间:
2020-12-25 11:42:12
阅读次数:
0
题:https://codeforces.com/contest/1463/problem/E 题意:给定拓扑图,在给定链(以边的形式给出),问是否能在拓扑顺序中找出一个序列使得这个序列包含给定的链(x->y->z)。 分析: 给定的拓扑图我们可以当作一个DAG,然后给定的m个边我们可以在原图上进行 ...
分类:
其他好文 时间:
2020-12-24 11:46:03
阅读次数:
0
简单线段树操作 咕咕咕 Transformation HDU - 4578 vj talk is cheap, chow the code. #include <iostream> #include <cstring> using namespace std; typedef long long l ...
分类:
其他好文 时间:
2020-12-23 12:30:38
阅读次数:
0
题意 这题大体意思就是你一开始给一个数1,之后每一天这个数都会自乘2,并且你可以在其中的任意一天把这个数加1,以此来得到你最终想要的数n,并且要求操作次数最少。 题目链接:https://codeforces.com/gym/102830/problem/C 解析 这种题其实遇到过好多次了,但是每次 ...
分类:
其他好文 时间:
2020-12-23 12:26:35
阅读次数:
0
4Sum II (M) 题目 Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is ze ...
分类:
其他好文 时间:
2020-12-22 12:32:53
阅读次数:
0
https://www.luogu.com.cn/problem/P5069 首先对于最大的那个数,两侧的两数要跟着他一起下降,所以它们永远不会成为最大得到,那不妨直接让这个最大的减成 $0$,同时,两侧两数也就也变成 $0$ 了 然后再去找下一个最大的 所以只要求哪些数会成为当前最大的,计算它们的 ...
分类:
其他好文 时间:
2020-12-22 11:52:44
阅读次数:
0