[hihoCoder#1065]全图传送 试题描述 先知法里奥是 Dota 系列中的一个英雄.机动性强,推塔能力一流,打钱速度快,传送技能使先知可以全地图支援.在后期比拼中通过强大的兵线控制能力使得对方的兵线一直难以过河,并具有一定的后期 DPS 能力. 我们今天要考虑的是传送技能.假设战场是一个树形区域,每个节点有一个权值 vi.当你传送到某个点 u 时,可以支援距离点 u 半径 r 以内的所有节点.请对于下列询问"u r", 回答以 u 节点为中心,半径 r 以内的节点中,权值最大…
题目链接:51nod 1065 最小正子段和 房教说用前缀和做,然后看了别人博客懂了后就感觉,这个真有意思... #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ; const int inf = 0x3f3f3f3f; pair<long long, int> sum[N]; int a[N]; int n; int main(){ int i, j;…
1065. A+B and C (64bit) (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 HOU, Qiming Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C. Input Specification: The first line of the input gives the po…