题目链接:https://www.acwing.com/problem/content/258/ 题目给出长度为n的序列,操作有两种,求[p,n]段的异或和再与x的异或,或者增加一个数x,使用可持久化Trie和异或前缀和可以解决,但是需要在[l-1,r-1]区间内,右区间自然满足,左区间的话需要加上 ...
分类:
编程语言 时间:
2020-07-25 23:31:49
阅读次数:
75
package LeetCode_283 /** * 283. Move Zeroes * https://leetcode.com/problems/move-zeroes/description/ * * Given an array nums, write a function to move ...
分类:
其他好文 时间:
2020-07-25 09:55:29
阅读次数:
69
题目链接 https://leetcode-cn.com/problems/er-cha-shu-de-shen-du-lcof/ 题目描述 输入一棵二叉树的根节点,求该树的深度。从根节点到叶节点依次经过的节点(含根、叶节点)形成树的一条路径,最长路径的长度为树的深度。 例如: 给定二叉树 [3,9 ...
分类:
其他好文 时间:
2020-07-25 09:44:45
阅读次数:
60
Dijkstra's algorithm is one of the very famous greedy algorithms. It is used for solving the single source shortest path problem which gives the short ...
分类:
其他好文 时间:
2020-07-24 21:53:35
阅读次数:
107
由于本人水平不够,这场多校只写了第1题和第10题 第1题 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6763 Problem A. Total Eclipse There are n cities and m bidirectional roads ...
分类:
其他好文 时间:
2020-07-24 21:43:59
阅读次数:
171
CF736D Permutations(伴随矩阵) Luogu 题解时间 首先把边直接放进邻接矩阵, 很明显行列式的奇偶和方案数的奇偶一样。 设 \(A_{ i , j }\) 为矩阵的该行列的余子式去掉一条边 \(x,y\) 后是否还为奇数等同于 \(A_{ x ,y }\) 是否为偶数。 至于如 ...
分类:
其他好文 时间:
2020-07-24 21:37:12
阅读次数:
77
字典树是一种实现字符串快速检索的多叉树结构。每个节点都拥有很多个指针。 模板提https://www.acwing.com/problem/content/144/。 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 ...
分类:
其他好文 时间:
2020-07-24 21:16:00
阅读次数:
64
https://www.luogu.com.cn/problem/P2865 https://loj.ac/problem/10076 求 $1$ 到 \(n\) 的严格次短路 考虑使用 dij 记录两个数组,dis[u],dis2[u] 分别表示 $1$ 到 \(u\) 的最短路,严格次短路 更新 ...
分类:
数据库 时间:
2020-07-24 16:10:11
阅读次数:
69
E. World of Darkraft: Battle for Azathoth 题目大意: 给你n个武器和m个防御,每一个武器有一个攻击值 a 和这个武器的价格,每一个防御有一个防御值b和这个防御的价格,有p个怪物,每一个怪物有一个防御值x攻击值y,和打赢这个怪物收获的价值z。 你买一个武器和一 ...
分类:
其他好文 时间:
2020-07-24 15:46:28
阅读次数:
96
[编程题] lc:674. 最长连续递增序列 题目描述 给定一个未经排序的整数数组,找到最长且连续的的递增序列,并返回该序列的长度。 输入输出 思路 Java代码 class Solution { public int findLengthOfLCIS(int[] nums) { //极端条件 if ...
分类:
其他好文 时间:
2020-07-24 15:30:43
阅读次数:
58