链接:https://ac.nowcoder.com/acm/contest/992/B来源:牛客网 题目描述 在之前很火的一个动漫<干物妹小埋>中,大家对小埋打游戏喝可乐的印象十分的深刻. 现在欧尼酱将小埋的快乐水全部分开藏在了家具的顶端. 小埋使出空中1080°转身接战术翻滚跳到任一家具上,她相信,只要她翻滚的足够快,欧尼酱就跟不上她.   1.为获取梦幻开局,小埋一套技能可以使她一开始掉落在任一家具上. 2.小埋家的家具按顺序给出,每个家具可跳可不跳,为避开欧尼酱的追击,小埋翻滚到某个家…
Special Subsequence Time Limit: 5 Seconds      Memory Limit: 32768 KB There a sequence S with n integers , and A is a special subsequence that satisfies |Ai-Ai-1| <= d ( 0 <i<=|A|)) Now your task is to find the longest special subsequence of a ce…
posters 时间限制:1000 ms  |  内存限制:65535 KB 难度:6   描述 The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally de…
题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=180 解题报告:一个裸的求逆序对的题,离散化+线段树,也可以用离散化+树状数组.因为这题中的数列有重复的而且范围特别大,所以要进行离散化,离散化的方法是, 首先按照输入的数字排个序,然后把整个数列扫一遍,得出每个数字离散化的结果,然后再按照输入的顺序把顺序调整回来就OK 了.线段树部分就不说了. #include<cstdio> #include<cstring> #…
[题目链接] http://www.tsinsen.com/A1219 [题意] 给定一棵树,a[u][i]代表u结点分配i人的收益,可以随时改变a[u],查询(u,v)代表在u子树的所有节点,在u->v(不含u)路径上的节点分配人数的最优收益. [思路] 树链剖分:构造重链时先访问重儿子,因此一个重链的区间连续,同时一个子树的区间连续. 查询分为两部分:构造在u子树内分配人数i的最大收益ans1[i],以及构造在u->v路径上一个结点分配人数i的最大收益ans2[i].则ans=max{ a…
HDU 3016 Man Down (线段树+dp) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1391    Accepted Submission(s): 483 Problem Description The Game “Man Down 100 floors” is an famous and interesting ga…
Mayor's posters Time Limit: 1000MS    Memory Limit: 65536K   Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The cit…
1721: 感恩节KK专场——雪人的高度 时间限制: 1 Sec  内存限制: 128 MB 提交: 81  解决: 35 [提交][状态][讨论版] 题目描述 大雪过后,KK决定在春秋大道的某些区间上堆雪人.现在KK遇到了一道统计雪人高度的难题,请你帮帮他吧.注:KK堆雪人前春秋大道上是没有雪人的即所有位置雪人高度为0. 输入 给定一个整数t,表示有t(t<=5)组测试数据.每组测试数据有两个整数N(1<=N<=200000),表示N次操作. 操作分四种:    U1 x y v  …
[BZOJ1645][Usaco2007 Open]City Horizon 城市地平线 Description Farmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and observe the beautiful silhouettes formed by the rectangular buildings. The entire ho…
原文地址:http://www.cnblogs.com/GXZlegend/p/6801379.html 题目描述 蒟蒻DCrusher不仅喜欢玩扑克,还喜欢研究数列 题目描述 DCrusher有一个数列,初始值均为0,他进行N次操作,每次将数列[a,b)这个区间中所有比k小的数改为k,他想知道N次操作后数列中所有元素的和.他还要玩其他游戏,所以这个问题留给你解决. 输入 第一行一个整数N,然后有N行,每行三个正整数a.b.k. N<=40000 , a.b.k<=10^9 输出 一个数,数列…