codeforces segments 1858d trees

[ABC294G] Distance Queries on a Tree 题解

## Description 有一个节点数为 $N$ 的树。边 $i$ 连接 $u_i$ 和 $v_i$,边的权值为 $w_i$。 $Q$ 次询问,询问一共有两种。 ```1 i w``` :改变第 $i$ 条边的权值为 $w$。 ```2 u v``` :输出 $u$ 到 $v$ 的路径距离。 数 ......
题解 Distance Queries 294G Tree

【题解】Codeforces Round 737 (CF1557)

VP 情况: solve:4/5 rank:431st 评价: VP 了一下,我这个 shaber B 直接 5 发罚时,耽误了二十多分钟,以及被 D 各种细节差点搞死。 ## A.Ezzat and Two Subsequences(*800) ### 题目描述: 给定一个序列,将其分为 $2$ ......
题解 Codeforces Round 1557 737

[学习笔记] dsu on tree

- 适用于动态维护子树信息 - 流程 类似树链剖分定义重儿子,轻重链。 先便历轻边子树,不保存信息(删)。 最后便历重儿子子树,保存重儿子信息。 再加入轻儿子子树即可得到子树信息了。 复杂度:一个点被加/删的次数为轻边数( $logn$ )。 - code 点击查看代码 ``` void solve ......
笔记 tree dsu on

Codeforces Round 837 (Div. 2) F. Hossam and Range Minimum Query

[传送门](https://codeforces.com/contest/1771/problem/F) 大致题意: ** 给一个n,然后给一个数组a, 有m个询问,询问区间[l, r]出现次数为奇数的最小值,若没有输出0, 每次输入的l,r需要异或上上一个答案,在第一个询问的时候认为上一个答案为0 ......
Codeforces Minimum Hossam Round Range

JS 树形数据 Tree的通用方法

点击查看代码 ``` /** * @description 查找包含自身节点的父代节点 * @param list 列表数据 * @param id 节点 id * @param pid 节点的父id */ export function listToTree(list, id, pid) { li ......
树形 方法 数据 Tree JS

Educational Codeforces Round 143 (Rated for Div. 2) A-D

Educational Codeforces Round 143 (Rated for Div. 2) A. Two Towers void solve(){ int n=read(),m=read(); string s,t; cin>>s>>t; int ans=1; for(int i=0;i ......
Educational Codeforces Round Rated 143

1066 Root of AVL Tree

题目: An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at ......
1066 Root Tree AVL of

CF1819C The Fox and the Complete Tree Traversal

# [$\color{purple}\text{The Fox and the Complete Tree Traversal}$](https://www.luogu.com.cn/problem/CF1819C) 比较有意思的一题。先考虑一个序列的权值。对长度为 $len$ 的序列排序,价值为 ......
Traversal Complete 1819C 1819 Tree

codeforces#1829H.Don't Blame Me(dp)

题解 ``` #include #define io ios::sync_with_stdio(false); #define off cin.tie(0), cout.tie(0); #define all(x) x.begin(),x.end() #define inf 0x3f3f3f3f3f ......
codeforces Blame 1829 Don 39

Codeforces Round 870 (Div. 2)

# Preface 补题,感觉这场挺对口味的说,E直接秒出,虽然刚开始并不觉得能跑得过去,不过写了一发直接艹过去了可海星 F题挺有意思的一个题,不过刚开始没想到只要三次询问就行了所以想偏了,不然也是挺简单的 # A. Trust Nobody 枚举说谎的人的个数$x$,统计出$l_i>x$的个数$c ......
Codeforces Round 870 Div

1110 Complete Binary Tree(附测试点2,3,4,6分析)

题目: Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case ......
Complete Binary 1110 Tree

Tree-of-Thought

引言 人工智能的发展一直以来都是实现智能系统推理能力的主要目标之一。近年来,大型语言模型的发展取得了重大进展,特别是它们在上下文学习方面的应用,为机器推理开辟了新的途径,但其在复杂推理方面仍面临挑战。为此今天分享的这篇文章,介绍了一种名为“Tree-of-Thought(ToT)”的框架,旨在提高自 ......
Tree-of-Thought Thought Tree of

Educational Codeforces Round 148 (Rated for Div. 2) D1. Red-Blue Operations

[Easy Version传送门](https://codeforces.com/contest/1832/problem/D1) [Hard Version传送门](https://codeforces.com/contest/1832/problem/D1) 题目大意: ![](https:// ......

Codeforces Round 732 (Div

## [AquaMoon and Strange Sort](https://vjudge.net/problem/CodeForces-1546C) >有 $n$ 个人从左到右站成一排,从左数第 $i$ 个人的衣服上印着 $a_i$。每个人的朝向可以是朝左、朝右。一开始所有人的方向都是朝右。 > ......
Codeforces Round 732 Div

Paper Reading: forgeNet a graph deep neural network model using tree-based ensemble classifiers for feature graph construction

[toc] Paper Reading 是从个人角度进行的一些总结分享,受到个人关注点的侧重和实力所限,可能有理解不到位的地方。具体的细节还需要以原文的内容为准,博客中的图表若未另外说明则均来自原文。 | 论文概况 | 详细 | | | | | 标题 | 《forgeNet: a graph dee ......

CodeForces 1827E Bus Routes

[洛谷传送门](https://www.luogu.com.cn/problem/CF1827E "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1827/E "CF 传送门") 比较神奇的题。 定一个非叶子 $r$ 为根。 显 ......
CodeForces Routes 1827E 1827 Bus

Open-Vocabulary Panoptic Segmentation with MaskCLIP论文阅读笔记

这篇文章的arxiv版看着太折磨了,可以直接看openreview上作者修改后的版本https://openreview.net/forum?id=zWudXc9343以及rebuttal帮助理解。 ## 摘要 本文提出了一个新任务:开放词汇全景分割,同时作者给出了基于ViT CLIP骨干的base ......

CodeForces 1784D Wooden Spoon

[洛谷传送门](https://www.luogu.com.cn/problem/CF1784D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1784/D "CF 传送门") 我怎么连这种 combinatorics 都不会 ......
CodeForces Wooden 1784D Spoon 1784

Educational Codeforces Round 148 (Rated for Div. 2)

# Preface 补题,这场比较简单,E之前的都能写出来,当然D的细节挺多的WA了好几发 感觉时间好不够用啊,想补的题那么多但效率好低,可能要等暑假才能集中攻克了 # A. New Palindrome 统计下出现了一次以上的字符有几种,如果大于等于两种就有解 ```cpp #include #i ......
Educational Codeforces Round Rated 148

1127 ZigZagging on a Tree

题目: Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ......
ZigZagging 1127 Tree on

CLIP-S^4:Language-Guided Self-Supervised Semantic Segmentation论文阅读笔记

## 摘要 作者提出了CLIP-S4,借助自监督像素表示学习和V-L模型实现各种语义分割任务,不需要使用任何像素级别标注以及未知类的信息。作者首先通过对图像的不同增强视角进行像素-分割对比学习来学习像素嵌入。之后,为进一步改善像素嵌入并实现基于自然语言的语义分割,作者设计了由V-L模型指导的嵌入一致 ......

1099 Build A Binary Search Tree

题目: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only no ......
Binary Search Build 1099 Tree

Codeforces Round 874 (Div. 3) A-F

Codeforces Round 874 (Div. 3) A. Musical Puzzle map<int,int>mp; void solve(){ mp.clear(); int n=read(),cnt=0; string s; cin>>s; for(int i=0;i<n-1;i++) ......
Codeforces Round 874 A-F Div

Codeforces Gym 103119B - Boring Problem(高斯消元)

考虑建出 AC 自动机,朴素做法是高斯消元,$f_i=\sum\limits_{j=0}^{k-1}f_{to_{i,j}}p_j+1$,复杂度 $O(n^3m^3)$,不能接受。 考虑优化高斯消元的过程,我们定义以下节点为“关键点”: - 根节点 - 对于一个 trie 树(也就是未经过 AC 自 ......
Codeforces 103119B Problem 103119 Boring

Codeforces Round 862 (Div. 2) A-D

Codeforces Round 862 (Div. 2) A. We Need the Zero int a[N]; void solve(){ int n=read(),sum; for(int i=1;i<=n;i++){ a[i]=read(); if(i==1)sum=a[i]; else ......
Codeforces Round 862 A-D Div

1043 Is It a Binary Search Tree (附测试点7分析)

题目: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only no ......
Binary Search 1043 Tree Is

Learning Affinity from Attention: End-to-End Weakly-Supervised Semantic Segmentation with Transformers概述

0.前言 相关资料: arxiv github 论文解读 论文基本信息: 领域:弱监督语义分割 发表时间: CVPR 2022(2022.3.5) 1.针对的问题 目前主流的弱监督语义分割方法通常首先训练分类模型,基于类别激活图(CAM)或其变种生成初始伪标签;然后对伪标签进行细化作为监督信息训练一 ......

ElementUI tree 折叠全部节点

第一 引入树组件,需要通过按钮来控制展开/折叠必须要配置 ref 属性和node-key,树数据要和node-key能匹配 <template> <el-button @click="foldTree">折叠全部节点</el-button> <el-button @click="expandTree ......
节点 ElementUI tree

1064 Complete Binary Search Tree

题目: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only no ......
Complete Binary Search 1064 Tree

Codeforces Round 873 (Div. 2) A~D2

## Codeforces Round 873 (Div. 2) A~D2 ### A. Divisible Array 因为$1$一定整除,构造$a_i=i$,再让$a_1$加上和模$n$的余数 ```c++ void work() { int n; cin >> n; vector a(n + ......
Codeforces Round 873 Div D2