
树状数组
Fly++
不论何时,能依赖到最后的只有自己的强大
展开
-
Matrix
DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 <= i, j <= N). We can change the ma...原创 2018-05-05 16:36:31 · 287 阅读 · 0 评论 -
Killing Monsters
DescriptionKingdom Rush is a popular TD game, in which you should build some towers to protect your kingdom from monsters. And now another wave of monsters is coming and you need again to know whether...原创 2018-05-05 16:49:21 · 361 阅读 · 3 评论 -
Out of Sorts II(UPC6347) 树状数组
题目描述Keeping an eye on long term career possibilities beyond the farm, Bessie the cow has started learning algorithms from various on-line coding websites.Her favorite algorithm thus far is "bubble ...原创 2018-07-22 20:47:35 · 285 阅读 · 0 评论 -
HH的项链 HYSBZ - 1878
HH有一串由各种漂亮的贝壳组成的项链。HH相信不同的贝壳会带来好运,所以每次散步 完后,他都会随意取出一段贝壳,思考它们所表达的含义。HH不断地收集新的贝壳,因此他的项链变得越来越长。有一天,他突然提出了一个问题:某一段贝壳中,包含了多少种不同的贝壳?这个问题很难回答。。。因为项链实在是太长了。于是,他只好求助睿智的你,来解决这个问题。Input第一行:一个整数N,表示项链的长...原创 2018-08-04 08:57:45 · 264 阅读 · 0 评论 -
小奇遐想(UPC5727)
题目描述撷来一缕清风飘渺方知今日书信未到窗外三月天霁垂柳新长枝条风中鸟啼犹带欢笑——《清风醉梦》小奇望着青天中的悠悠白云,开始了无限的遐想,在它的视野中,恰好有n朵高度不同的白云排成一排,他想从左到右选出四朵白云a,b,c,d,使得h_a<h_b<h_d<h_c,即看起来像是彩虹的形状!它想知道有多少种方案数。 输入第一行包括1个整数n。第二行包...原创 2018-07-28 09:55:39 · 451 阅读 · 0 评论