2016NEFU集训第n+3场 E - New Reform】的更多相关文章

Description Berland has n cities connected by m bidirectional roads. No road connects a city to itself, and each pair of cities is connected by no more than one road. It is not guaranteed that you can get from any city to any other one, using only th…
Description       You must have heard that the Chinese culture is quite different from that of Europe or Russia. So some Chinese habits seem quite unusual or even weird to us.       So it is known that there is one popular game of Chinese girls. N gi…
Description In Berland recently a new collection of toys went on sale. This collection consists of 109 types of toys, numbered with integers from 1to 109. A toy from the new collection of the i-th type costs i bourles. Tania has managed to collect n …
Description Maria participates in a bicycle race. The speedway takes place on the shores of Lake Lucerne, just repeating its contour. As you know, the lake shore consists only of straight sections, directed to the north, south, east or west. Let's in…
非常简单的单点修改+区间加+区间查询.我用的是最近刚学的区间修改版本树状数组.  直接维护即可,注意修改后的单点值已经不是a[i],或者b[i],要通过区间查询求单点.不然是错的. 区间修改版本树状数组: #include<iostream> #include<string.h> #include<stdio.h> #include<algorithm> #define LL long long using namespace std; LL c_p[];…
凉 (比赛链接)[https://www.nowcoder.com/acm/contest/177#question] T1 (题目链接)[https://www.nowcoder.com/acm/contest/177/A] 首先考虑二维前缀和 [l1, r1], [l2, r2]的解 即ans([0, r1], [0, r2]) - ans([0, l1 - 1], [0, r2]) - ans([0, l2 - 1], [0, r1]) + ans([0, l1 - 1], [0, l2…
[题解] 先建反向图,然后跑拓扑排序求出最长路. 将所有的点按照最长路从小到大分层,把上一层连向这一层的边按照边权为第一关键字.起点的排名为第二关键字排序. 按照这个顺序更新这一层的答案,按照这一层每个点被更新的顺序得到这一层的点的排名. #include<cstdio> #include<cstring> #include<algorithm> #define LL long long #define rg register #define N 1000010 #de…
原文地址:http://tieba.baidu.com/p/2432943599 前言: 即将进入研二,ACM的事情也渐渐远去,记忆终将模糊,但那段奋斗永远让人热血沸腾.开个贴讲讲ACM与中南的故事,当是宣泄,也当是一种宣传吧.多年不写作文,也不知如今的文笔能否打动更多的有志青年为中南ACM梦想而奋斗. 用时间序好了,不定时更新.一层楼对应一个时期或一年,有补充就在那层楼的中.也许真写起来故事不长,就这样吧.   1947年 ACM(Association for Computing Machi…
向别人学习一波,记点流水帐.17.5.29开坑. 5.29 早晨看了道据说是树状数组优化DP的题(hdu5542),然后脑补了一个复杂度500^3的meet in the middle.然后死T...弃疗. 上午考试有一道sb线段树和一道简单数位DP.还有一道是毕姥爷在WC讲的"超立方体".对着数据范围的表格写了半天部分分然后你告诉我测试数据和这个数据范围根本不一样? 并不会FWT,又因为不太想学新算法,就决定不改题了. 下午先把某个课件的坑填完了.然后在bzoj上乱逛. 决定写写SD…
牛客网NOIP赛前集训营-提高组(第四场)游记 动态点分治 题目大意: \(T(t\le10000)\)组询问,求\([l,r]\)中\(k(l,r,k<2^{63})\)的非负整数次幂的数的个数. 思路: 暴力,注意特判\(0\)和\(1\)的情况. 源代码: #include<cstdio> #include<cctype> typedef unsigned long long uint64; inline uint64 getint() { register char…