HDU 4974 A simple water problem
题目链接
签到题,很容易贪心得到答案是(sum + 1) / 2和ai最大值的最大值
代码:
#include
#include
#include
using namespace std;
const int N = 100005;
typedef long long ll;
int t, n;
ll...
分类:
其他好文 时间:
2014-08-21 22:53:25
阅读次数:
304
怪物AI执行//-----------------------------------------------主动攻击------------------------------------------------------初始状态attack_style Enum攻击方式 ...
分类:
其他好文 时间:
2014-08-20 22:21:22
阅读次数:
275
Problem Description
Number theory is interesting, while this problem is boring.
Here is the problem. Given an integer sequence a1, a2, …, an, let S(i) = {j|1j is a multiple of ai}. If S(i) is no...
分类:
其他好文 时间:
2014-08-20 16:34:02
阅读次数:
184
NPC AI驱动最基本过程NPCmgr中比较重要的是加载NPC和一个NPCAI的一个指针他利用map那个线程的定时到底做了啥呢void NPCmgr::npcAITimer(){ time_t tb = GetTickCount(); m_spNpcAI->run();//[...]测试...
分类:
其他好文 时间:
2014-08-20 02:29:45
阅读次数:
370
Problem Description
Number theory is interesting, while this problem is boring.
Here is the problem. Given an integer sequence a1, a2, …, an, let S(i) = {j|1j is a multiple of ai}. If S(i) is not ...
分类:
其他好文 时间:
2014-08-20 00:07:25
阅读次数:
210
题目链接:hdu 4960 Another OCD Patient
题目大意:给定一个长度为n的序列,然后再给出n个数ai,表示合成i个数的代价。每次可以将连续的子序列和成一个数,即为序列中各个项的和。要求将给定长度n的序列变成一个回文串,一个数字只能被合成一次。
解题思路:dp[l][r]表示从l到r被和成回文串的最小代价,dp[l][r]=min(val(r?l+1),val(r?...
分类:
其他好文 时间:
2014-08-20 00:06:35
阅读次数:
205
题目链接:hdu 4961 Boring Sum
题目大意:给定ai数组;
构造bi, k=max(j|0ji,aj%ai=0), bi=ak;构造ci, k=min(j|ij≤n,aj%ai=0), ci=ak;
求∑i=1nbi?ci
解题思路:因为ai≤105,所以预先处理好每个数的因子,然后在处理bi,ci数组的时候,每次遍历一个数,就将其所有的因子更新,对于bi维护最...
分类:
其他好文 时间:
2014-08-20 00:05:45
阅读次数:
202
点击打开链接
题意:给出n个数的数列a,bi的取值为在1
思路:如果直接暴力的话一定会超时,所以我们可以开一个vis数组来记录每一个值所对应的最大的下标是多少。即每查找ai,分解出ai的质因子,更新vis数组。
代码:
#include
#include
#include
#include
#include
using namespace std;
...
分类:
其他好文 时间:
2014-08-19 20:58:05
阅读次数:
242
题目:POJ 2533 Longest Ordered Subsequence
Description
A numeric sequence of ai is ordered if a1 a2 aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN)
be any sequence (ai1...
分类:
其他好文 时间:
2014-08-19 16:37:44
阅读次数:
218
题目:codeforces 459D - Pashmak and Parmida's problem
题意:给出n个数ai...
分类:
其他好文 时间:
2014-08-19 10:59:14
阅读次数:
250