codeforces segments 1858d trees

Codeforces Round 879 (Div. 2)

其实昨天就应该写了,不过D不太会,但是今天补题发现D还是不太会 A: 给定包含-1和1的数字序列,要求满足这个序列 并且你可以将序列中的-1改成1,也可以将序列中的1改成-1, 让你确定将一个随机序列改成满足要求的序列的最小操作数 1 #include<cstdio> 2 #include<cstr ......
Codeforces Round 879 Div

Educational Codeforces Round 150 A~D

c题好难。 ## A. Game with Board [Problem - A - Codeforces](https://codeforces.com/contest/1841/problem/A) ### 题意 给定若干个数字1,Alice和Bob每回合合并两个相同的数字,Alice先手。如果 ......
Educational Codeforces Round 150

Codeforces Round 879 (Div.2) B ~ D

D题补了一天... ## B. Maximum Strength [Problem - B - Codeforces](https://codeforces.com/contest/1834/problem/B) ### 题意 给定两串数字,在这两串数字之间找两串数字,要求每一数位之差的绝对值之和最 ......
Codeforces Round 879 Div

Codeforces Round 872 (Div.2) A~C

洛天依专场QWQ ## A. LuoTianyi and the Palindrome String [Problem - A - Codeforces](https://codeforces.com/contest/1825/problem/A) ### 题意 给定一个回文串,求最长的非回文子串的 ......
Codeforces Round 872 Div

Codeforces Round 870 (Div.2) A~C

vp时A题没写出来,场外找的答案,原来思路错了(心虚 ## A. Trust Nobody [Problem - A - Codeforces](https://codeforces.com/contest/1826/problem/A) ### 题意 有n个人,其中一些人只说真话,另外一些人只说谎 ......
Codeforces Round 870 Div

OSFormer: One-Stage Camouflaged Instance Segmentation with Transformers

地址:https://arxiv.org/pdf/2207.02255.pdf 1. 摘要 OSFormer为基于transformer的伪装实例分割(CIS)框架,有两个关键设计,首先是位置敏感transformer(LST),通过【位置引导查询】和【混合卷积前向传播网络】获得定位标签和实例级参数 ......

Codeforces Round 864 A~C

vp过三题,c是交互题,想起了打华师大校赛时的不愉快经历了。 ## A.Li Hua and Maze [Problem - A - Codeforces](https://codeforces.com/contest/1797/problem/A) ### 题意 给定一个n×m的矩阵,矩阵中有两个 ......
Codeforces Round 864

el-tree树点击全选按钮,全部展开并且全选

先看图: 代码如下: // 全部选中 qxClick() { this.isQx = !this.isQx; // 判断按钮的状态 this.expandAll(); if (this.isQx) { console.log(this.isQx, " ", this.datas); // 设置 th ......
按钮 el-tree tree el

codeforces 树上题目总结

### codeforces 树上题目总结 **[CF1559D2](https://www.luogu.com.cn/problem/CF1559D2)** 先猜一个结论——一定能通过加边让一个森林变成一棵树,归纳一下发现是对的,并且随便加合法的边都符合条件,所以暴力是 $\mathcal O(n ......
codeforces 题目

ULR #2 F. Picks loves segment tree IX

## 简要题意 给定长度为 $n$ 的一个操作序列,每个操作形如: 1. and $x$ 2. or $x$ 3. xor $x$ 4. add $1$ 其中 $x$ 对于每个操作可能不同。 若干组询问(强制在线),每组询问形如:给定区间 $[l, r]$,非负整数 $v$,问如果以 $v$ 为初始 ......
segment Picks loves tree ULR

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

# A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n, k, x; cin >> n >> k >> x; if (x != 1) { cout = 3) { if (k > ......
Educational Codeforces Round Rated 151

Codeforces 293B Distinct Paths

发现 $n, m$ 的数据范围是假的,因为每一步一个颜色最多也就 $k\le 10$ 种颜色,所以当 $n + m - 1 > k$ 时一定无解。 接下来发现这个数据范围挺小的,考虑状压,设 $f_{x, y}$ 为走到 $(x, y)$ 点所用的颜色的集合,其可以由 $f_{x - 1, y}, ......
Codeforces Distinct Paths 293B 293

Codeforces Round 878 (Div3)

## B. Binary Cafe >![image-20230703193601400](https://zeoy-typora.oss-cn-hangzhou.aliyuncs.com/image-20230703193601400.png) > >$1 \leq n,k \leq 10^9$ ......
Codeforces Round Div3 878 Div

CodeForces 1508D Swap Pass

[洛谷传送门](https://www.luogu.com.cn/problem/CF1508D "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1508/D "CF 传送门") 先忽略掉所有 $a_i = i$ 的点。 考虑我 ......
CodeForces 1508D 1508 Swap Pass

Codeforces 585D Lizard Era: Beginning

很容易想到可以对于每个任务选不去的那一个人进行搜索,时间复杂度 $O(3^n)$,明显过不了。 发现 $n\le 25,\lceil \frac{n}{2}\rceil\le 13$,且各个任务间不会互相影响,便可以用折半搜索分成 $2$ 部分来搜最后来合并。 考虑如何合并两部分,令前一部分得到的值 ......
Codeforces Beginning Lizard 585D 585

tree-test

``` #include #include using namespace std; typedef struct BiTNode{ char data; struct BiTNode* lchild; struct BiTNode* rchild; }BiTNode,*BiTree; void C ......
tree-test tree test

Codeforces Round 881 Div2 A-F1题解

# codeforces round 881 div2 题解 马上要秋招了,自己本事全丢了,感觉如果这样的话今年就估计要饿死了。先打div3,7月份得开始收心了 ## A. Sasha and Array Coloring 题意,可以分任意组,每组的贡献是max - min,问最大贡献 显然是贪心, ......
题解 Codeforces Round Div2 881

[atAGC062E]Overlap Binary Tree

记$m=\frac{n+1}{2}$,即二叉树的叶子个数 对于合法序列,按以下方式生成其对应的二叉树: (此处二叉树指**无标号**、**以一个点为根**且**每个非叶节点恰有两个儿子**的树) - 恰存在一个区间与其余区间均有交,将其作为根并(在序列中)删除 - 恰存在一个$i\in [1,n)$ ......
Overlap Binary atAGC 062E Tree

Codeforces Round #877 (Div. 2) A-E

# A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n; cin >> n; int mx = -2e9, mi = 2e9; for (int i = 1;i > x; mi ......
Codeforces Round 877 A-E Div

Educational Codeforces Round 151 (Rated for Div. 2)

# Preface 期末考终于结束了,终于可以回来写题了 这场是刚考完最后一门的那个晚上打的,因为太久没有写代码了所以不是很熟练而且脑子也不太灵光,只能堪堪写到D题而且手速感人 上次CF第二个号因为Rating被roll了导致从紫名掉下来了,这场就把它又打上去了,再这样后面兴许要用第三个号打了 由于 ......
Educational Codeforces Round Rated 151

Educational Codeforces Round 151 [div.2 #A-C] 赛后总结(contest/1845)

### [link](https://codeforces.com/contest/1845 "Educational Codeforces Round 151") $\textcolor{52C41A}{A}-\textcolor{FADB14}{B}-\textcolor{FADB14}{C}- ......
Educational Codeforces contest Round 1845

CodeForces 高分段 dp 选做

选取方式:CF *3000+ 按通过人数排序。 ### [CF1188D Make Equal](https://www.luogu.com.cn/problem/CF1188D) 记 $cnt(x)$ 表示 $x$ 二进制下 $1$ 的个数,题目等价于求 $x$ 使得 $$\sum_{x=1}^n ......
CodeForces dp

Educational Codeforces Round 151 F. Swimmers in the Pool

### 一.前言 本来打算打打这个比赛玩玩,结果同学找我打游戏王去了,就没打现场(逃) 因为是一道不错的数学题,来写写补题的题解 这里点名批评 @[HOLIC](https://codeforces.com/profile/HOLlC) 喂给我的假题意,让我查错大半天,最后发现题意错了还重新推了好多 ......
Educational Codeforces Swimmers Round Pool

CodeForces 1845C Strong Password

[洛谷传送门](https://www.luogu.com.cn/problem/CF1845C "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1845/C "CF 传送门") 我怎么这么多天没写题解了,快来水一篇。 考虑对 ......
CodeForces Password Strong 1845C 1845

Educational Codeforces Round 151 (Rated for Div. 2)(C,D)

# Educational Codeforces Round 151 (Rated for Div. 2)(C,D) ## C(dp,子序列自动机) [C](https://codeforces.com/contest/1845/problem/C) 题目大意就就是给你一个字符串$s$,还给出两个边 ......
Educational Codeforces Round Rated 151

el-tree 实现懒加载

为了解决数据量过大而导致的web页面卡死,我们采用懒加载的方式进行实现, 1. 首先,根据文档,我们在<el-tree>中加入 lazy 和 :load="loadNode" 如下图: 2. 在methods中写一下这个方法,如下图 说明一下,上图中的node.level 0 时,我们在里面请求根节 ......
el-tree tree el

Educational Codeforces Round 151 (Rated for Div. 2) A~D

A. Forbidden Integer 模拟: void solve(){ int n,k,x; cin>>n>>k>>x; if(x!=1){ cout<<"YES\n"<<n<<"\n"; for(int i=1;i<=n;i++) cout<<"1"<<" \n"[i==n]; return ......
Educational Codeforces Round Rated 151

Educational Codeforces Round 151 (Rated for Div

## C. Strong Password >给定一个字符串$s$,一个密码的长度$m$,下界字符串$l$和上界字符串$r$,上下界字符串长度均为$m$,且字符只在0~9范围内,上界字符串的第 $i$ 位非严格大于下界字符串的第 $i$ 位,密码的第 $i$ 位需要位于 $[l_i, r_i]$ 内 ......
Educational Codeforces Round Rated 151

Maximum Depth of Binary Tree

Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root n ......
Maximum Binary Depth Tree of

Prompt工程进阶之Tree of Thoughts

摘要 本期和大家一起读篇论文,由 Google DeepMind 和普林斯顿大学联合提出的「思维树[1]」框架。该框架是 COT(思维链)的泛化模型,它基于人类认知学理论,思维的快慢系统,提出了一种基于树模型的 Prompt 提示方法。 整体感受,论文思路很好。首先 LLM 的 COT 是激发 LL ......
Thoughts Prompt 工程 Tree of