• 2024-03-07CF1899G Unusual Entertainment 题解
    分析一眼树上启发式合并。定义\(x_i\)为节点\(i\)在序列\(p\)中的下标。则问题转化为:对于每组\(l,r,k\),询问以\(k\)为根的子树中是否有一个以上的节点,满足\(l\lex_j\ler\)。使用set存以\(i\)为根的子树中\(x_j\)的有序排列。则对于每个\(k=i\)的询问,去合
  • 2023-12-17POLIR-Management-TYPES of decisions{Structured(routine+familiar)Problems: Programmed Decisions, Unst
    Inaverysimplesense,theproblemsmanagersencountercanbeclassifiedas:routineandfamiliar;newandunusual.Inresponse,managerswilluseoneoftwodifferenttypesofdecisions:StructuredProblemsandProgrammedDecisions;UnstructuredP
  • 2023-11-21G. Unusual Entertainment
    G.UnusualEntertainmentAtreeisaconnectedgraphwithoutcycles.Apermutationisanarrayconsistingof$n$distinctintegersfrom$1$to$n$inanyorder.Forexample,$[5,1,3,2,4]$isapermutation,but$[2,1,1]$isnotapermutation(as$1$
  • 2023-11-20CF1899 G Unusual Entertainment 题解
    LinkCF1899GUnusualEntertainmentQuestion给出一个排列\(p_i\)和一棵树,给出\(Q\)组询问,每组询问\([L,R,x]\)表示求\(p_L\simp_R\)上是否存在\(p_i\)在\(x\)的字数上。Solution这道题确实是一个好题。我们先考虑一个问题,怎么样才能判断子树,我们给书上的每个
  • 2023-11-18cf1899G. Unusual Entertainment(启发式合并)
    https://codeforces.com/contest/1899/problem/G首先将将节点重新映射一下然后就是个启发式合并板题#include<cstdio>#include<algorithm>#include<cstring>#include<cmath>#include<map>#include<vector>#include<set>#include<queue>#in