随笔分类 - 线段树
摘要:There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the i
阅读全文
摘要:题目地址:http://codeforces.com/contest/1042/problem/D 题意:给你n个数,问有多少个区间的和的值小于t 分析:区间和问题,常常用到前缀和来进行预处理,所以先预处理出前缀和数组sum sum[i]代表前i个数的和,那么sum[i]的贡献就是, 当i<k<=n
阅读全文
摘要:There is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole compa
阅读全文
摘要:XORConsider an array A with n elements. Each of its element is A[i] (1 ≤ i ≤ n). Then gives two integersQ, K, and Q queries follow. Each query, give y
阅读全文
摘要:Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue… The Lunar New Year was approa
阅读全文