colorful 133f tree abc

【CF1842F】Tenzing and Tree

# 题目 题目链接:https://codeforces.com/contest/1842/problem/F 给定一棵 $n$ 个点的树,你可以选择其中 $k$ 个点染黑,定义一条边的价值为割去这条边之后,剩下两颗树的黑点数量差;一棵树的价值为所有边的价值之和。 对于 $k\in [0,n]$,求 ......
Tenzing 1842F 1842 Tree and

[ABC307G] Approximate Equalizatio

# [ABC307G] Approximate Equalizatio ## 题意 给定一个数组 $a_i$ ,有两种操作。 1. $a_i+1,a_{i+1}-1$ 2. $a_i-1,a_{i+1}+1$ 问最少花费多少次操作能使数组的极差不超过 $1$。 ## 题解 容易发现总和不变,由于极差 ......
Approximate Equalizatio 307G ABC 307

Binary Tree Inorder Traversal

Given the root of a binary tree, return the inorder traversal of its nodes' values. Example 1: ``` Input: root = [1,null,2,3] Output: [1,3,2] ``` Exam ......
Traversal Inorder Binary Tree

AtCoder Beginner Contest(abc) 307

*** ## A - [Weekly Records](https://atcoder.jp/contests/abc307/tasks/abc307_a) #### 题目大意 >小莫每天跑步, 输入n周每天的步数, 输出每周跑的总步数; #### 解题思路 >签到题不多嗦了; #### 神秘代码 ......
Beginner AtCoder Contest 307 abc

2023-06-25 SassError: Undefined variable: "$u-bg-color".

前言:项目引入uview,使用uview的image组件时,报错: 20:55:49.932 SassError: Undefined variable: "$u-bg-color". 20:55:49.937 on line 255 of D:\project\mall-uni\uni_modul ......
quot u-bg-color SassError Undefined variable

[数据结构]Segment tree(线段树)

# Segment tree(线段树) ## 1.线段树的结构和思想 ### 线段树基本结构: ![image](https://img2023.cnblogs.com/blog/3214093/202306/3214093-20230625205909147-1113167776.png) ### ......
线段 数据结构 Segment 结构 数据

[数据结构]Binary Indexed Trees(树状数组)

# Binary Indexed Trees(树状数组) ## 1.lowbit **lowbit(x)**是x的二进制表达式中最低位的1所对应的值。比如,6的二进制是110,所以lowbit(6)=2。 **lowbit(x) = x&(-x)** ## 2.定义,查询,修改(eg1) $a1,a ......
数据结构 数组 Indexed 结构 数据

洛谷P4178 Tree 题解 树上点分治

题目链接:[https://www.luogu.com.cn/problem/P4178](https://www.luogu.com.cn/problem/P4178) 解题思路: 点分治模板题。 设当前重心为 $u$,一共有三种不同类型的路径: 1. 路径的一个端点恰好是重心 $u$; 2. 路 ......
题解 P4178 4178 Tree

CodeForces 1842F Tenzing and Tree

[洛谷传送门](https://www.luogu.com.cn/problem/CF1842F "洛谷传送门") [CF 传送门](https://codeforces.com/contest/1842/problem/F "CF 传送门") 事实上自己方向一直是错的…… 绝对值不好弄,我一开始的 ......
CodeForces Tenzing 1842F 1842 Tree

B+ tree implemented in Java

## B+树相关介绍 > B+树是一棵**多叉排序树**,即每个非叶子节点可以包含多个子节点,其整体结构呈扁平化,所以其非常适配于数据库和操作系统的文件系统中。且B+树能够保持数据的稳定有序,插入和删除都拥有较稳定的**对数时间复杂度**。 **B+树的特性**:以 m 阶为例,m 表示内部节点即非 ......
implemented tree Java in

abc061d <单源最短路, spfa, 判断负环>

[D - Score Attack](https://atcoder.jp/contests/abc061/tasks/abc061_d) ``` // https://atcoder.jp/contests/abc061/tasks/abc061_d // 单源最短(长)路, spfa, 判断负( ......
061d spfa abc 061 lt

abc060d <dp, 背包>

[D - Simple Knapsack](https://atcoder.jp/contests/abc060/tasks/arc073_b) ``` // https://atcoder.jp/contests/abc060/tasks/arc073_b // 背包问题 // 特别在于, 背包体 ......
背包 060d abc 060 lt

蔚来手撕代码题:三个线程循环打印ABC

问题如下: ![image.png](https://cdn.nlark.com/yuque/0/2023/png/92791/1687573711593-3af01c01-92b6-4a09-8a2c-355a7dde1033.png#averageHue=%23f9f8f7&clientId=u ......
线程 三个 代码 ABC

Codeforces Round 875 (Div. 2) C. Copil Copac Draws Trees

bfs解法 如果是暴力求解的话就每次都扫描一次所有边直到所有点都和树连接 优化:每次扫描我们可以发现会重复扫描那些已经存在树中的边了,因此我们可以只扫描还没有存在树中的边且是没扫过的边 对于每次更新,比如由点a已经在树中,更新点b,我们只需判断点a被更新到树中点的编号和a-b边的编号的大小,如果比它 ......
Codeforces Round Copil Copac Draws

CF771C Bear and Tree Jumps

# CF771C Bear and Tree Jumps [link](https://codeforces.com/problemset/problem/771/C) 赛时脑子抽了没想出来,其实思路已经沾边了,但是……唉,还是太菜了 qwq。 ## 题意: 给你一颗有 $n$ 个点的树,和每次能走 ......
Jumps 771C Bear Tree 771

[ABC259F] Select Edges 题解

### Solution 考虑树形 $dp$。 我们可以注意到节点 $i$ 的相邻的边中被选中的不超过 $d_i$ 条,显然我们可以定义状态 $dp_{u,k}$ 表示节点 $u$ 连接子节点的边有 $k$ 条的最大值。 但是此处没有给定 $d_i$ 的范围,所以对于一个节点最多可能会有 $n-1$ ......
题解 Select Edges 259F ABC

AtCoder Beginner Contest(abc) 299

*** ## A - [Treasure Chest](https://atcoder.jp/contests/abc299/tasks/abc299_a) #### 题目大意 >给定一个由' | ' ' * '和' . '组成的字符串, 并且保证一定有1个' * '和2个' | ', 检查' * ......
Beginner AtCoder Contest 299 abc

【题解】AtCoder-ABC306G Return to 1

这也太强了! 容易想到的是用若干环拼出这个 $10^{10^{100}}$,也就是这些环的 $\gcd \mid 10$。 之后就不会了。 先正图反图两次 DFS,只留下 $1$ 所在强连通分量里的边,对正图跑 DFS 生成树,定义其深度从 $0$ 开始,然后有一个结论是:对于任何正整数 $a$,图 ......
题解 AtCoder-ABC AtCoder Return ABC

abc059d <博弈, 打表找规律>

[D - Alice&Brown](https://atcoder.jp/contests/abc059/tasks/arc072_b) #### 如何打表 要善于通过打表展示视觉信息, 从而找到规律; ``` #include #include using namespace std; typed ......
规律 059d abc 059 lt

abc058d <公式化简>

[D - ###](https://atcoder.jp/contests/abc058/tasks/arc071_b) 原计算公式为: $$ \sum\limits_{1\le i #include using namespace std; typedef long long LL; const ......
公式 058d abc 058 lt

Ubuntu提示【Authentication is required to create a color profile/managed device】

1. 安装vim apt install vim -y 2. 修改文件 vim /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla 3. 粘贴以下内容 [Allow Colord all Users] Identity=unix- ......

CF932D Tree

[题目链接](https://codeforces.com/problemset/problem/932/D) # 题目 见链接。 # 题解 **知识点:倍增。** 注意到,题目其实要求我们,每次要选最近一个权值大于等于自己的祖先,可以看出固定点生成出来的序列是固定的。因此,考虑设 $f_{i,j} ......
932D Tree 932 CF

NC200179 Colorful Tree

[题目链接](https://ac.nowcoder.com/acm/problem/200179) # 题目 **题目描述** A tree structure with some colors associated with its vertices and a sequence of comm ......
Colorful 200179 Tree NC

AT_abc118_d题解

[AT](https://atcoder.jp/contests/abc118/tasks/abc118_d) [Luogu](https://www.luogu.com.cn/problem/AT_abc118_d) ### 题目描述 有 $n$ 根火柴 $m$ 种数字,数字 $1,2,3,4,5 ......
题解 AT_abc 118 abc AT

P4414 [COCI2006-2007#2] ABC

题意翻译 【题目描述】 三个整数分别为 A,B,CA,B,C。这三个数字不会按照这样的顺序给你,但它们始终满足条件:A < B < CA ......
P4414 4414 2006 2007 COCI

AtCoder Beginner Contest(abc) 306

*** ### A - [Echo](https://atcoder.jp/contests/abc306/tasks/abc306_a) #### 题目大意 >把一个字符串的每个字符输出两遍 #### 解题思路 >签到题不多嗦了; #### 神秘代码 ```c++ #include #define ......
Beginner AtCoder Contest 306 abc

AtCoder Beginner Contest(abc) 305

*** ### A - [Water Station](https://atcoder.jp/contests/abc305/tasks/abc305_a) #### 题目大意 >给定一个0~100之间的数, 输出离它最近的5的倍数 #### 解题思路 >签到题不多嗦了; #### 神秘代码 ``` ......
Beginner AtCoder Contest 305 abc

abc056d <todo>

https://atcoder.jp/contests/abc056/tasks/arc070_b ``` // https://atcoder.jp/contests/abc056/tasks/arc070_b // 查到多种做法 二分 / dp ... // 参考 https://blog.cs ......
056d todo abc 056 lt

CF383C Propagating tree

[题目链接](https://codeforces.com/problemset/problem/383/C) # 题目 见链接。 # 题解 **知识点:DFS序,树状数组。** 我们需要对子树的不同奇偶层加减,用dfn序可以解决子树问题,但是并不能直接分奇偶。 一种比较麻烦的思路是,将dfn序分成 ......
Propagating 383C tree 383 CF

【vue3】实现el-tree组件

禾小毅 csdn博客 【vue3】实现el-tree组件,将不同层级的箭头修改成自定义图标的组件封装及调用 【vue3】实现简易的 “百度网盘” 文件夹的组件封装实现 【vue3】 实现 公共搜索组件,在当前页搜索的路由跳转不能改变当前值的操作,使用bus / event-emitter 派发器 ......
组件 el-tree vue3 tree vue