随笔分类 - 算法_常用技巧
摘要:求第k大 求第k大 Time Limit: 6000/3000ms (Java/Others) Time Limit: 6000/3000ms (Java/Others) Problem Description: Input: 输入包含多组测试数据,每组数据首先输入两个整数N,M,K,接下来一行有N
阅读全文
摘要:Problem Description My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and
阅读全文
摘要:Problem Description Give you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numb
阅读全文
摘要:Description An array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very
阅读全文
摘要:Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have
阅读全文
摘要:Description Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on
阅读全文
摘要:Description A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) ar
阅读全文
摘要:Problem Description: Problem Description: 端午节快到了,小蛋准备到集市上买粽子。于是周六这天,小蛋和舍友搭着公交到了西南市场。说来也怪,这天集市上就只有n个人在卖粽子,整齐地排成一列,而且第i(1<=i<=n)个人前面有Xi个粽子堆在一起。小蛋这人平时很大方
阅读全文
摘要:Problem description Petya loves lucky numbers. Everybody knows that positive integers are lucky if their decimal representation doesn't contain digits
阅读全文
摘要:Problem Description: Problem Description: 在一个二维平面,从左到右竖立n根高度分别为:a[1],a[2],....a[n],且宽度都为1的木板。试给出平面内最大的矩阵面积。 Input: 输入包含多组测试数据,每一组数据的第一行输入正整数n(<=5000),
阅读全文