There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and wants to earn as much money as possible in each path. When he move along a path, he can choose one city to bu…
有N个结点 一次 I u v 操作表示把结点u的父结点设为v,距离为|u-v|%1000.输入保证执行指令前u没有父结点 一次E u 操作表示询问u到根结点的距离 O操作表示结束 #include<iostream> #include<cstring> #include<cmath> using namespace std; ; int T,n,level,d[maxn],fa[maxn]; void init() { memset(d,,sizeof(d)); ;i&…
http://acm.hdu.edu.cn/showproblem.php?pid=1232 畅通工程 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 51317 Accepted Submission(s): 27359 Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连…
The merchant Time Limit : 6000/3000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other) Total Submission(s) : 1 Accepted Submission(s) : 1 Problem Description There are N cities in a country, and there is one and only one simple path between…
The merchant Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 6864 Accepted: 2375 Description There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and w…