![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
思路题
胖胖 wl
这个作者很懒,什么都没留下…
展开
-
CodeForces - 729D(思路,氺题)
Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of b consecutive cells. No cell can be part of two ships, however, ...原创 2018-03-11 20:15:36 · 291 阅读 · 0 评论 -
Mr. Panda and Strips Gym - 101194C 尺取法 + 思维
题目大意:给你一个序列,让你从中找小于等于两个子序列,让他们的长度和最小,要求这两个序列中没有相同的数字分析:尺取法,首先对于尺取的L与R,再次尺取0到L与R到N,从中选择一段最长的连续序列,每次更新即可#include <iostream>#include <algorithm>#include <cstring>#include <cstd...原创 2018-11-15 22:05:26 · 510 阅读 · 0 评论 -
Vasya and Triangle CodeForces - 1030D
题目大意:给你n,m,k,要你在0到n,0到m的范围内选择三个点,组成一个三角形,让这个三角形的面积等于nm/k.分析:我们比较容易想到,把一个点固定在原点,剩余两个点在x轴和y轴选择两个整点,这样,xy/2=nm/k所以如果(2nm)%k等于0说明有解,否则无解这样问题就转化为xy=2nm/k,求x与y,暴力似乎是不行,因为数据范围太大了1.如果k是偶数,可以和2约掉,k先除2,k...原创 2018-09-28 14:56:14 · 189 阅读 · 0 评论 -
Buy and Resell HDU - 6438 贪心
题目描述: 有一个物品,给你这个物品n天的价格,你可以在在第i天买进或卖出或者什么都不做,如何获得最大利益,假设本金是无限大的。 分析: 我们建立一个最小堆,即优先队列,每天,将队列的最小值和当前的值比较,如果最小值大于等于当前值,直接将当前值加入优先队列,否则,ans+=这两个数的差值, **并将当前数加入到队列两次,加入队列两次的目的是: 1.当前价格并不一定是最终的卖出价格,可能后...原创 2018-08-25 20:36:19 · 283 阅读 · 0 评论 -
HDU6400 多校第8场 Parentheses Matrix 构造思路
A parentheses matrix is a matrix where every element is either ‘(’ or ‘)’. We define the goodness of a parentheses matrix as the number of balanced rows (from left to right) and columns (from up to do...原创 2018-08-16 09:42:41 · 293 阅读 · 0 评论 -
CodeForces - 550C 思路水题
You are given a non-negative integer n, its decimal representation consists of at most 100 digits and doesn’t contain leading zeroes.Your task is to determine if it is possible in this case to remov...原创 2018-08-08 10:44:23 · 276 阅读 · 0 评论 -
CodeForces - 500C 贪心思路
New Year is coming, and Jaehyun decided to read many books during 2015, unlike this year. He has n books numbered by integers from 1 to n. The weight of the i-th (1 ≤ i ≤ n) book is wi.As Jaehyun’s ...原创 2018-08-12 21:58:16 · 577 阅读 · 0 评论 -
CodeForces 485D思路
You are given a sequence a consisting of n integers. Find the maximum possible value of (integer remainder of ai divided by aj), where 1 ≤ i, j ≤ n and ai ≥ aj.Input The first line contains intege...原创 2018-08-10 10:53:36 · 243 阅读 · 0 评论 -
uva11997(优先队列,归并)
You’re given k arrays, each array has k integers. There are k k ways to pick exactly one element in each array and calculate the sum of the integers. Your task is to find the k smallest sums among t...原创 2018-03-12 22:22:44 · 319 阅读 · 0 评论 -
Problem Buyer HDU - 6003 鸽巢原理
题目大意:给你n个范围li到ri,再给你m个数字,问你求一个最小的k,让你任意从n个里面选择k个,让这k个包含着m个数字,一一对应即可分析:假设每个数字有个区间不包含a[i],则至少要选择s+1个区间即可,所以,求一个s+1的最大值即可#include <iostream>#include <algorithm>#include <cstring>#i...原创 2018-11-16 17:24:46 · 312 阅读 · 0 评论