Information Graph CodeForces - 466E

用Python玩转ROS机械臂:YOLO目标检测+MoveIt!自动抓取仿真教程 本文详细介绍了如何利用Python集成YOLO目标检测与ROS的MoveIt!运动规划库,实现机械臂的智能抓取仿真。通过Gazebo仿真环境,从视觉感知、坐标转换到运动规划与执行,构建了一套完整的自动化抓取系统,为机器人视觉抓取应用提供了可复现的实践方案。 阅读详情

There are n employees working in company “X” (let’s number them from 1 to n for convenience). Initially the employees didn’t have any relationships among each other. On each of m next days one of the following events took place:

either employee y became the boss of employee x (at that, employee x didn’t have a boss before);
or employee x gets a packet of documents and signs them; then he gives the packet to his boss. The boss signs the documents and gives them to his boss and so on (the last person to sign the documents sends them to the archive);
or comes a request of type “determine whether employee x signs certain documents”.
Your task is to write a program that will, given the events, answer the queries of the described type. At that, it is guaranteed that throughout the whole working time the company didn’t have cyclic dependencies.

Input
The first line contains two integers n and m (1 ≤ n, m ≤ 105) — the number of employees and the number of events.

Each of the next m lines contains the description of one event (the events are given in the chronological order). The first number of the line determines the type of event t (1 ≤ t ≤ 3).

If t = 1, then next follow two integers x and y (1 ≤ x, y ≤ n) — numbers of the company employees. It is guaranteed that employee x doesn’t have the boss currently.
If t = 2, then next follow integer x (1 ≤ x ≤ n) — the number of the employee who got a document packet.
If t = 3, then next follow two integers x and i (1 ≤ x ≤ n; 1 ≤ i ≤ [number of packets that have already been given]) — the employee and the number of the document packet for which you need to find out information. The document packets are numbered started from 1 in the chronological order.
It is guaranteed that the input has at least one query of the third type.

Output
For each query of the third type print “YES” if the employee signed the document package and “NO” otherwise. Print all the words without the quotes.

Example
Input
4 9
1 4 3
2 4
3 3 1
1 2 3
2 2
3 1 2
1 3 1
2 2
3 1 3
Output
YES
NO
YES

/*``
题意:好复杂2333嗯。。自己看看吧大概也看得懂。。。2333(其实是我忘记了=-=)
思路:对同一个文件的查询,查询的关系树应该是2操作时的关系树,所以对每个2操作 我们可以把所有的对当时文件的查询一起处理。这里学到了个很厉害的东西。用dfs标记一个点入栈退栈的时间,用一个时间戳Index来计算,那么如果有一对点u,v,v在u到根节点的路径上,即r->v->u;那么必定存在 l[v]<l[u] r[v]>r[u]。由于1操作对关系图中的时间戳不会产生影响,并且需要将对同一文件的查询一起处理,所以我们先把所有操作读入,然后一起操作。2333
对每个1操作,我们用并查集合并x,y,然后先将所有3操作根据文件标号存好,对每个2操作去查询得到当前文件的人和被查询的人是不是同属一个集合,如果属于一个集合说明已经被合并如果同时满足lr的关系那么说明yes 不然no2333
*/

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<vector>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<string>
#include<stack>
#include<map>
using namespace std;

//thanks to pyf ...

#define INF 0x3f3f3f3f
#define CLR(x,y) memset(x,y,sizeof(x))
#define mp(x,y) make_pair(x,y)
typedef pair<int,int> PII;
typedef long long ll;

const int N = 1e5+5;

int fa[N];
vector<int>G[N];//存图
vector<PII>Q[N];//用来存放查询 first是查询的人 second是查询的编号
int l[N],r[N];//入退栈的时间
int ok[N];//yes or no
int vis[N];//用来标记是否有入度,没入度的是根节点
int Index = 0;//时间戳
int doc_id = 0;//文件标号
int n,m;
struct Q
{
    int op;
    int x,y;
}query[N];
void init()//初始化函数
{
    CLR(ok,0);
    CLR(vis,0);
    CLR(l,0);
    CLR(r,0);
    Index = 0;
    doc_id = 0;
    for(int i=0;i<=N;i++)
    {
        fa[i] = i;
        G[i].clear();
        Q[i].clear();
    }

}
int find(int x)
{
    if(fa[x]!=x)
        fa[x] = find(fa[x]);
    return fa[x];
}
void merge(int a,int b)
{
    a = find(a);
    b = find(b);
    if(a!=b)
        fa[a] = fa[b];
}
void get_query()//预处理所有操作
{
    scanf("%d",&m);
    for(int i=0;i<m;i++)
    {
        int op;
        scanf("%d",&query[i].op);
        if(query[i].op==1)
        //反向建图,这样由最高领导指向所有下属,在dfs时对根节点不会重复的去覆盖lr值
        {
            scanf("%d%d",&query[i].x,&query[i].y);
            G[query[i].y].push_back(query[i].x);
            vis[query[i].x] = 1; // 有入度 不是根节点
        }
        else if(query[i].op == 2)
        {
            scanf("%d",&query[i].x);
            query[i].y = ++ doc_id;
        }
        else
        {
            scanf("%d%d",&query[i].x,&query[i].y);
            Q[query[i].y].push_back(mp(query[i].x,i));
            //对同一个文件的查询存放在一起
        }
    }
}
void dfs(int u)//处理 lr
{
    vis[u] = 1;
    l[u] = ++ Index;
    for(int i=0;i<G[u].size();i++)
    {
        int v = G[u][i];
        dfs(v);
    }
    r[u] = ++Index;
}
int main()
{
    while(scanf("%d",&n)==1)
    {
        init();
        get_query();
        for(int i=1;i<=n;i++)
            if(!vis[i])
                dfs(i);
        for(int i=0;i<m;i++)
        {
            if(query[i].op == 1)
            {
                merge(query[i].x,query[i].y);
            }
            else if(query[i].op==2)
            {
                int get_p = query[i].x;
                int doc = query[i].y;
                for(int j=0;j<Q[doc].size();j++)
                //判断是否可行
                {
                    int p = Q[doc][j].first;
                    int id = Q[doc][j].second;
//                  cout << get_p << " " << p << " ";
//                  cout << l[get_p] << " " << l[p] << " " << r[get_p] << " " << r[p] << " " << find(get_p) << " " << find(p) << endl;
                    if(l[get_p]>=l[p]&&r[get_p]<=r[p]&&(find(get_p)==find(p)))
                        ok[id] = 1;
                }
            }
        }
        for(int i=0;i<m;i++)
            if(query[i].op == 3)
                ok[i]==1 ? cout << "YES" << endl : cout << "NO" << endl;
    }
    return 0;
} 
SwinTransformer改进(5):与CBAM结合的视觉模型 这个模型的核心思想是将Swin Transformer的强大特征提取能力与CBAM的注意力机制相结合,以提升模型对重要特征的关注度。​​CBAM模块​​:包含通道注意力和空间注意力两个子模块​​Swin Transformer主干网络​​:作为基础特征提取器​​集成结构​​:在Swin Transformer的不同阶段插入CBAM模块使用移动窗口(Moving Window)机制减少计算量层次化设计,特征图逐渐缩小,通道数逐渐增加在不同阶段使用Patch Merging进行下采样。 阅读详情

相关推荐

Windows Server+SqlServer Always On实战:5步搞定高可用集群搭建

本文详细介绍了在Windows Server环境中,通过5个关键步骤搭建SQL Server Always On高可用集群的实战指南。内容涵盖从底层故障转移集群配置、SQL Server实例启用Always On功能,到创建可用性组和侦听器的完整流程,并提供了核心运维与故障排查思路,帮助企业构建稳定可靠的数据库高可用架构。

milk5的博客 857

Codeforces 466E Information Graph(dfs+并查集)

题目链接:Codeforces 466E Information Graph 题目大意:一开始有n个员工,他们互相独立。现在有三种操作。 1 u v,v称为u的上级2 u,从u发起一份文件,逐层递交给上级3 u v,询问u是否查阅过v号文件。 解题思路:将每个文件移动的范围处理出来,然后对于每次询问,将询问拆成两个标记,假设查询x是否浏览过第k号文件,第k号文件的范围为u-v,那

不慌不忙、不急不躁 1483

别再花屏了!手把手教你用STM32CubeIDE搞定LVGL 8.3移植(附完整源码)

本文详细介绍了如何在STM32CubeIDE环境下成功移植LVGL 8.3,解决常见的花屏问题。从环境配置、显示驱动优化到编译警告处理,提供完整的实战方案和源码示例,帮助开发者快速实现流畅的嵌入式GUI界面。特别针对STM32平台的DMA2D加速和内存管理进行了深度优化。

weixin_33739646的博客 242

Codeforces 466 E. Information Graph

并查集.... E. Information Graph time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output There are n empl

码代码的猿猿 1397

基于halcon的HSV颜色匹配实例

HSV颜色识别原图代码结果 原图 代码 dev_update_off () dev_close_window () *颜色数组 FuseColors := ['Orange','Red','Blue','Yellow','Green'] *画笔颜色数组 DisplayColors := ['coral','red','blue','goldenrod','forest green'] * HSV模型中H分量: Orange 10-30, Red 0-10,Blue 125-162,Yellow 3

qq_39467811的博客 3543

STM32Cubemx+CanFestival:从零到一的CANopen移植实战

本文详细介绍了如何使用STM32CubeMX和CanFestival实现CANopen协议栈的移植,从开发环境搭建到核心配置步骤,再到调试与问题排查。通过实战经验分享,帮助开发者快速掌握STM32与CANopen的结合应用,提升嵌入式系统开发效率。

weixin_42558093的博客 417

Codeforces 466E Information Graph

Information Graph 把询问离线之后就能随便搞了, 去check一下是不是祖先, 可以用倍增也能用dfs序。 #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair&...

120

【BUG已解决】pip install 出现 error: Microsoft Visual C++ 14.0 or greater is required 解决方案

方案磁盘占用适用场景推荐指数安装Build Tools3-6GB长期Windows Python开发⭐⭐⭐⭐⭐寻找预编译wheel无额外占用只是想快速装上某个包⭐⭐⭐⭐⭐用conda安装视包而定已经在用conda环境⭐⭐⭐⭐⭐升级到新版本无额外占用库本身有更新的预编译版本⭐⭐⭐⭐使用WSL2需要额外配置Linux子系统频繁遇到Windows编译问题⭐⭐⭐⭐的核心是Windows 缺少本地 C/C++ 编译器,而目标包需要在本机编译。先看是否有捷径。

博客 1万+

【CodeForces】466E Information Graph 离线处理+并查集

传送门:【CodeForces】466E Information Graph

poursoul 1553

magic-api的鉴权机制配置 (附实战代码)

引入magic-api及相关数据库驱动依赖 配置yml文件和编辑器JS文件 实现登录鉴权逻辑,包括用户验证和Token处理 接口鉴权拦截器设计,确保接口访问安全性 文章提供了完整的代码示例,帮助开发者快速集成magic-api框架并实现权限控制功能。

码农研究僧的博客 227

形状记忆合金热机械本构模型的ABAQUS子程序实现与Fortran\_ABAQUS编程实践

本文详细介绍了如何使用ABAQUS子程序实现形状记忆合金的热机械本构模型,并通过Fortran_ABAQUS进行编程实践。我们首先介绍了问题的背景和目标,然后讲解了如何在Fortran_ABAQUS子程序中实现热变形模型、应力应变关系和相变模型,最后进行了ABAQUS模拟,并分析了模拟结果。希望通过本文的讲解,能让大家更深入理解ABAQUS子程序以及Fortran的使用,也希望能对大家在进行相关学习或研究工作时提供一些帮助。

qq_38334677的博客 1327

CodeForces 466E. Information Graph (并查集+倍增)

题目: http://codeforces.com/problemset/problem/466/E 题意: 三种操作: 1.y变为x的boss; 2.x签署一份文件并逐级往上传并签署; 3.查询第x个人是否签署第i份文件。 分析: 在线变离线; 用路径压缩的并查集能直接查询当前状态下某个人的最高boss; 签署一份文件时,记录签署此文件最底端的人和最顶端的人; 倍增处理出每个节点往上走1&amp;lt;...

OI -> ACM -> AI 463

YOLOv11改进 | 检测头篇 | 利用动态蛇形卷积DySnakeConv改进yolov11分割检测头(全网独家首发,Segment)

本文给大家带来的最新改进机制是一种我进行优化的专用于分割的检测头,在分割的过程中,最困难的无非就是边缘的检测,动态蛇形卷积(Dynamic Snake Convolution)通过自适应地聚焦于细长和迂回的局部结构,准确地捕捉管状结构的特征。这种卷积方法的核心思想是,通过动态形状的卷积核来增强感知能力,针对管状结构的特征提取进行优化,所以将这个卷积针对于YOLOv11的分割头进行融合是非常合适的,当然本文的检测头也支持用于目标检测,但是我将其设计出来是主要为了分割的读者使用的。

Snu77的博客 3429

Codeforces 466E - Information Graph 【DFS+并查集+预处理】

Codeforces 466E - Information Graph 【DFS+并查集+预处理】 There are n employees working in company "X" (let's number them from 1 to n for convenience). Initially the employees didn't have any relationships among each other. On each of m next days one of the foll

Dust_heart的博客 655

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

CodeForces 466E Information Graph --树形转线性+并查集

题意:有三种操作: 1.新增一条边从y连向x,此前x没有父节点 2.x接到一份文件,(文件标号逐次递增),然后将这份文件一路上溯,让所有上溯的节点都接到这份文件 3.查询某个节点x是否接到过文件F 解法: 首先要知道一个性质,节点u在v的上溯路径上的话要满足: L[u]= R[v] (先进后出) 先将所有的边都读入,dfs得出L[u],R[u],然后将查询分为t

c_czl的博客 252

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

codeforces 466E Information Graph 并查集LCA离线一通乱搞

想明白一点就很简单了,询问一个人是否签过一份文件是可以分离出来的,只要一个文件已经被签署了,那么不管什么时候询问,答案都是确定的,所以把3类询问分离出来,每次签完一份文件就处理这份文件相关询问即可//也可能只有我被这种地方卡?#pragma warning(disable:4996) #include #include #include #include #include #include usi

zzblac的专栏 576

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

Codeforces 466E Information Graph【Dfs处理父子关系+并查集+离线查询】好题!

E. Information Graph time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output There are n employees working in company "X" (let

mengxiang000000 507

CF466E Information Graph

一、题目 点此看题

C202044zxy的博客 258

Codeforces854D Jury Meeting

题意:告诉你有n+1个城市,标号0-n,0号是个中心,然后其他n个点每个有一个智障他们都要到0点然后他们n个智障需要在0点至少共同py k天,然后再各自飞回各自原来的城市,飞机要么从0飞到一个城市,要么从一个城市飞到0 题解:我觉得我已经彻底咸鱼了,,,C做了贼久还是队友点了一下才觉得那么简单,,看D的时候已经有点放弃了=-=看题就在瞎看没看到加粗的那句话,感觉血崩。。其实已经想到了相当于两个过程

OneDay_pyf的博客 860

hdu6200mustedge mustedge mustedge

Give an connected undirected graph with n nodes and m edges, (n,m≤105) which has no selfloops or multiple edges initially. Now we have q operations (q≤105):⋅1 u v: add an undirected edge from u to v;

OneDay_pyf的博客 842

Weak Pair HDU - 5877

You are given a rootedrooted tree of NN nodes, labeled from 1 to NN. To the iith node a non-negative value aiai is assigned.An orderedordered pair of nodes (u,v)(u,v) is said to be weakweak if (1)

OneDay_pyf的博客 762

2017年上海金马五校程序设计竞赛(网上资格赛)Problem E : A No-story Kingdom

Description In an unknown island, there is a tree kingdom whose structure is just like a tree. It has a city called root city and as your expectation, this root city has several son cities. And every

OneDay_pyf的博客 668

bzoj1969LANE 航线规划

对Samuel星球的探险已经取得了非常巨大的成就,于是科学家们将目光投向了Samuel星球所在的星系——一个巨大的由千百万星球构成的Samuel星系。 星际空间站的Samuel II巨型计算机经过长期探测,已经锁定了Samuel星系中许多星球的空间坐标,并对这些星球从1开始编号1、2、3……。 一些先遣飞船已经出发,在星球之间开辟探险航线。 探险航线是双向的,例如从1号星球到3号星球开辟探险航线,那

OneDay_pyf的博客 627

570D - Tree Requests

Roman planted a tree consisting of n vertices. Each vertex contains a lowercase English letter. Vertex 1 is the root of the tree, each of the n - 1 remaining vertices has a parent in the tree. Vertex i

OneDay_pyf的博客 567
上一篇: codeforces-519C
下一篇: Minimum Inversion Number HDU - 1394
OneDay_pyf
博客等级 码龄10年 6粉丝 35原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值