随笔分类 - RMQ---树状数组
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 You are given an N × N matrix. At the beginning every element is 0. Write a
阅读全文
摘要:Problem Description Jimmy wants to make a special necklace for his girlfriend. He bought many beads with various sizes, and no two beads are with the
阅读全文
摘要:Newman likes playing with cats. He possesses lots of cats in his home. Because the number of cats is really huge, Newman wants to group some of the ca
阅读全文
摘要:以前都是用的BIT或者线段树(前者多一些)。 对于ST(Sparse Table),在求倍增or公共祖先(LCA)时见过,说明还有其他用处,所以还是学习一下。 首先是预处理,用动态规划(DP)解决。 设A[i]是要求区间最值的数列,F[i, j]表示从第i个数起连续2^j个数中的最大值。(DP的状态
阅读全文
摘要:1599 逆向bfs+优化 #include<cstdio> #include<cstdlib> #include<iostream> #include<cstring> #include<algorithm> #include<string> using namespace std; int a,
阅读全文
摘要:昨天睡得太晚,今天又在看新算法,明天事情也多,烦,所以今天刷刷水题就过去了。 叫我用线段树,我反而搞不来
阅读全文
摘要:敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 99913 Accepted Submission(s): 42300 Problem
阅读全文
摘要:Longest Ordered SubsequenceTime Limit: 2 Seconds Memory Limit:65536 KB A numeric sequence of ai is ordered if a1 #include#include#includeusing na...
阅读全文
摘要:Chiaki has n intervals and thei-th of them is [li,ri]. She wants to delete some intervals so that there does not exist three intervalsa,b andc such th
阅读全文

浙公网安备 33010602011771号