UVA 1423 - Guess
题目链接
题意:给定一个每个区间和的正负,构造一个序列,使得满足这个矩阵
思路:每个区间和等于两个前缀和的差,这样就可以知道每两个前缀和的大小关系,利用拓扑排序可以求出顺序,然后对应要控制不超过|10|,所以从-10开始,大的就+1,然后构造出这个前缀和序列,对应每个ai就等于c[i] - c[i - 1]
代码:
#include ...
分类:
其他好文 时间:
2014-08-27 16:36:18
阅读次数:
220
# 缩进 # 缩进的设置 1. autoindent (ai) > Copy indent from current line when starting a new line (typing in Insert mode or when using the "o" or "O" command). If you do not type anything on the new...
分类:
其他好文 时间:
2014-08-27 13:16:38
阅读次数:
213
题目:
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) ...
分类:
其他好文 时间:
2014-08-27 09:29:57
阅读次数:
174
人工智能的道路我们还有很长的路要走,我们期待一场未来与机器人的真正博弈,而这种博弈的结果是:人与机器的和谐共存,生活的更加便捷。从我们感受到的智能来举例,如果你的手机是iphone,那你一定不会对siri陌生,这个人机交互的神器,可以帮助我们读短信、介绍餐厅、询问天气、语音设置闹钟。当然,这都不.....
分类:
其他好文 时间:
2014-08-26 22:52:36
阅读次数:
290
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3802题意: 从数列A中, 删除若干个数(可以0个), 是删除后的数列, 进行类似 Flappy 2048 游戏的运算, 使结果最大, 求该最大值。题解: 每个数ai...
分类:
其他好文 时间:
2014-08-26 21:19:16
阅读次数:
234
//宠物AI流程1.刚开始添加宠物Monster被动State:EnumMonster被NULLMonsterStat:EnumPet跟随2.附近有怪物就改成攻击模式(相关的收尾工作)void PetObj::cancle_follow(){ m_trace_line.clear(); ...
分类:
其他好文 时间:
2014-08-25 01:09:13
阅读次数:
192
题目链接:uva 11235 - Frequent values
题目大意:给定一个非降序的整数数组,要求计算对于一些询问(i,j),回答ai,ai+1,…,aj中出现最多的数出现的次数。
解题思路:因为序列为非降序的,所以相同的数字肯定是靠在一起的,所以用o(n)的方法处理处每段相同数字的区间。然后对于每次询问:
num[i]=num[j]:j?i+1numi≠numj:max...
分类:
其他好文 时间:
2014-08-24 23:53:23
阅读次数:
317
Intervals
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 21758
Accepted: 8191
Description
You are given n closed, integer intervals [ai, bi] and n integer...
分类:
其他好文 时间:
2014-08-23 17:49:31
阅读次数:
177
Description
Given a permutation a1, a2,...aN of
{1, 2,..., N}, we define its
E-value as the amount of elements where ai >
i. For example, the E-value of permutation
{1, 3, 2, 4} is 1, while th...
分类:
其他好文 时间:
2014-08-23 16:54:31
阅读次数:
232
Container With Most Water
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line...
分类:
移动开发 时间:
2014-08-22 16:17:59
阅读次数:
208