摘要: 算法学习:http://www.cnblogs.com/George1994/p/7710886.html 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1541 Astronomers often examine star maps where st 阅读全文
posted @ 2018-07-18 18:00 执||念 阅读(276) 评论(0) 推荐(0)
摘要: 首先介绍这两种函数是什么意思 upper_bound是找到大于t的最小地址,如果没有就指向末尾 lower_bound是找到大于等于t的最小地址 题目链接:https://vjudge.net/contest/231314#problem/E You are given n integers a1, 阅读全文
posted @ 2018-07-16 11:14 执||念 阅读(4390) 评论(0) 推荐(1)
摘要: 题目链接:https://vjudge.net/contest/231314#problem/D Peter Parker wants to play a game with Dr. Octopus. The game is about cycles. Cycle is a sequence of 阅读全文
posted @ 2018-07-16 09:46 执||念 阅读(287) 评论(0) 推荐(0)
摘要: 题目:硬币游戏1,Alice和Bob在玩这样一个游戏。给定k个数字a1,a2,···ak。 一开始,有x枚硬币,Alice和Bob轮流取硬币。每次所取硬币的枚数 一定要在a1,a2···,ak当中。Alice先取,取走最后一枚硬币的一方获胜。当双方都采取最有策略时,谁会获胜?假定a1a2···ak中 阅读全文
posted @ 2018-07-15 15:19 执||念 阅读(3561) 评论(0) 推荐(0)
摘要: 题目大意:输入n,代表有n种数,接下来n个数代表n种数,再接下来n个数代表每种数有多少个,在输入K,代表用这些数要加成的和 问你是否能加为K,能输出yes,不能输出no 这是一个典型的多重背包问题,可以用dp来求解,。但是如何定义递推关系会影响到最终的复杂度,首先我们先看一下如下定义: dp[i+1 阅读全文
posted @ 2018-07-15 09:23 执||念 阅读(412) 评论(0) 推荐(0)
摘要: 题目链接:https://vjudge.net/contest/237052#problem/J The magical world looks like a 2-D R*C grid. Initially there are many civilizations, each civilizatio 阅读全文
posted @ 2018-07-14 16:37 执||念 阅读(177) 评论(0) 推荐(0)
摘要: 题目链接:https://vjudge.net/contest/237052#problem/H Here we go! Let's define the diversity of a list of numbers to be the difference between the largest 阅读全文
posted @ 2018-07-14 13:17 执||念 阅读(909) 评论(0) 推荐(0)
摘要: 感觉很多贪心的题目只要想到怎么贪心就很快能解决,但是没有想到的话代码量就会很大,而且很容易出错,所有贪心还是要多做题目,掌握各种贪心的题目 题目链接:https://vjudge.net/contest/231313#problem/D A factory produces products pac 阅读全文
posted @ 2018-07-13 12:09 执||念 阅读(931) 评论(0) 推荐(0)
摘要: 题目链接:https://vjudge.net/contest/216347#problem/C Alice gets two sequences A and B. A easy problem comes. How many pair of sequence A' and sequence B' 阅读全文
posted @ 2018-07-11 14:44 执||念 阅读(1129) 评论(0) 推荐(0)
摘要: 首先介绍什么是线段树: 线段树是擅长处理区间一种数据结构。主要求区间的和,最大值,最小值,区间更新~~~~~ 下面直接看题 题目链接:https://vjudge.net/contest/217846#problem/D C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下T 阅读全文
posted @ 2018-07-10 20:25 执||念 阅读(200) 评论(0) 推荐(0)