Conquer a New Region Time Limit: 5 Seconds Memory Limit: 32768 KB The wheel of the history rolling forward, our king conquered a new region in a distant continent. There are N towns (numbered from 1 to N) in this region connected by several road…
Conquer a New Region Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 657 Accepted Submission(s): 179 Problem Description The wheel of the history rolling forward, our king conquered a new region i…
The wheel of the history rolling forward, our king conquered a new region in a distant continent.There are N towns (numbered from 1 to N) in this region connected by several roads. It's confirmed that there is exact one route between any two towns. T…
///题意:给出一棵树.树的边上都有边权值,求从一点出发的权值和最大,权值为从一点出去路径上边权的最小值 # include <stdio.h> # include <algorithm> # include <iostream> # include <string.h> using namespace std; # define MAX 200010 struct node { int u,v; int w; }; struct node a[MAX];…
转自:http://blog.csdn.net/shahdza/article/details/7779230 [HDU]1213 How Many Tables 基础并查集★1272 小希的迷宫 基础并查集★1325&&poj1308 Is It A Tree? 基础并查集★1856 More is better 基础并查集★1102 Constructing Roads 基础最小生成树★1232 畅通工程 基础并查集★2120 Ice_cream's world I 基础并查集★212…
Conquer a New Region Time Limit: 5 Seconds Memory Limit: 32768 KB The wheel of the history rolling forward, our king conquered a new region in a distant continent. There are N towns (numbered from 1 to N) in this region connected by several road…
Conquer a New Region Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1271 Accepted Submission(s): 415 Problem Description The wheel of the history rolling forward, our king conquered a new r…
A. Hongcow Learns the Cyclic Shift time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Bein…
CF456E Codeforces Round #260 (Div. 1) C Codeforces Round #260 (Div. 2) E http://codeforces.com/contest/455/problem/C C. Civilization time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Andrew p…
D. Fools and Foolproof Roads You must have heard all about the Foolland on your Geography lessons. Specifically, you must know that federal structure of this country has been the same for many centuries. The country consists of n cities, some pairs…
C. Civilization Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/455/problem/C Description Andrew plays a game called "Civilization". Dima helps him. The game has n cities and m bidirectional roads. The cities are numbe…
Civilization 题目链接: http://acm.hust.edu.cn/vjudge/contest/121334#problem/B Description Andrew plays a game called "Civilization". Dima helps him. The game has n cities and m bidirectional roads. The cities are numbered from 1 to n. Between any pa…
题目链接: 题目 F. Polycarp and Hay time limit per test: 4 seconds memory limit per test: 512 megabytes input: standard input output: standard output 问题描述 The farmer Polycarp has a warehouse with hay, which can be represented as an n × m rectangular table,…
Oil Deposits Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 14628 Accepted: 7972 Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular r…
Description Consider a tropical forrest, represented as a matrix. The cell from the right top corner of the matrix has the coordinates (1,1), and the coordinates of the other cells are determinated by the row and the column on which the cell is. In s…
A. Hongcow Learns the Cyclic Shift time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Bein…
F. Polycarp and Hay 题目连接: http://www.codeforces.com/contest/659/problem/F Description The farmer Polycarp has a warehouse with hay, which can be represented as an n × m rectangular table, where n is the number of rows, and m is the number of columns…
题目链接: F. Polycarp and Hay time limit per test 4 seconds memory limit per test 512 megabytes input standard input output standard output The farmer Polycarp has a warehouse with hay, which can be represented as an n × m rectangular table, where n is t…
Description Input 第一行包含一个正整数testcase,表示当前测试数据的测试点编号.保证1≤testcase≤20. 第二行包含三个整数N,M,T,分别表示节点数.初始边数.操作数.第三行包含N个非负整数表示 N个节点上的权值. 接下来 M行,每行包含两个整数x和 y,表示初始的时候,点x和点y 之间有一条无向边, 接下来 T行,每行描述一个操作,格式为“Q x y k”或者“L x y ”,其含义见题目描述部分. Output 对于每一个第一类操作,输出一个非负整数表示答…
3673: 可持久化并查集 by zky Time Limit: 5 Sec Memory Limit: 128 MBSubmit: 1878 Solved: 846[Submit][Status][Discuss] Description n个集合 m个操作操作:1 a b 合并a,b所在集合2 k 回到第k次操作之后的状态(查询算作操作)3 a b 询问a,b是否属于同一集合,是则输出1否则输出0 0<n,m<=2*10^4 Input Output Sample Input 5 6…