之前用了个nlogn的算法超时了,只能改成n的算法了
大题贪心思路就是 对每个人的能力值从小到大进行排序,当前能力值为now,那么我们找到一个人的能力使得这个能力值
这样都跑了600+MS,看来之前nlogn的TLE的不冤枉。。
#include
#include
#include
using namespace std;
typedef long long LL;
const int m...
分类:
其他 时间:
2015-06-03 00:58:57
收藏:
0 评论:
0 赞:
0 阅读:
147
装饰模式:
动态地给对象添加一些相关的职责。装饰模式相比与添加子类提供了一种更加灵活的方式。
UML图如下所示:
感觉上图中关键的有这几点:
Decorator与Component的聚合关系(即Decorator中存在一个Component类型的引用),由于这个聚合关系的存在,Decorator可以通过一个Component的引用调用Component的接口
Decorator与Compo...
分类:
其他 时间:
2015-06-03 00:58:37
收藏:
0 评论:
0 赞:
0 阅读:
175
主从模型,就是这么简单,任性。...
分类:
其他 时间:
2015-06-03 00:58:27
收藏:
0 评论:
0 赞:
0 阅读:
281
1、nandflash
Nandflash是IO设备,数据、地址、控制线都是共用的,需要软件区控制读取时序,
所以不能像nor flash、内存一样随机访问,不能EIP(片上运行),因此不能直接作为boot。
S3C2440把Bootloader烧到nand flash上启动,因为在S3C2440里有一个内置的SRAM,
叫做stepping stone(垫脚石,很形象...
分类:
其他 时间:
2015-06-03 00:58:18
收藏:
0 评论:
0 赞:
0 阅读:
240
CAS,Central Authentication Service—中央认证服务,是Yale 大学发起的一个企业级的、开源的项目,旨在为Web应用系统提供一种可靠的SSO解决方案。下面简单介绍SSO,重点介绍CAS认证过程。
一、 SSO简介
1.1 概念
SSO英文全称Single Sign On,是目前比较流行的服务于企业业务整合的解决方案之一, SSO 使得在多个应...
分类:
其他 时间:
2015-06-03 00:57:27
收藏:
0 评论:
0 赞:
0 阅读:
305
参照别人的添加marker的demo来改造时,发现无论怎样更改经纬度,都是停留在同一个位置。过了一两天突然想起可能是坐标参考的问题,尝试搜了一下,果然是这个问题。问题是这样子的:
WMTS中地图的坐标参考系是102100(具体是哪个不清楚),如下图所示:
而我在初始化地图时设置的参数如下图所示:projection属性设置的是‘EPSG:102100’,displayProjectio...
分类:
其他 时间:
2015-06-03 00:57:17
收藏:
0 评论:
0 赞:
0 阅读:
422
1、 部署CAS-Server
本文以cas-server-3.4.11-release.zip为例,解压提取cas-server-3.4.11/modules/cas-server-webapp-3.4.11.war文件。然后,解压一个新的tomcat,我的目录为【H:\常用软件\03. Java\tomcat\apache-tomcat-6.0.33】,然后把上面提取的文件copy到 ...
分类:
其他 时间:
2015-06-03 00:56:27
收藏:
0 评论:
0 赞:
0 阅读:
231
http://acm.hdu.edu.cn/showproblem.php?pid=5255枚举a和c 求解b#include #include #include #include #include using namespace std ;typedef long long LL ;#define...
分类:
其他 时间:
2015-06-03 00:55:07
收藏:
0 评论:
0 赞:
0 阅读:
381
1152. False MirrorsTime limit: 2.0 secondMemory limit: 64 MBBackgroundWe wandered in the labyrinth for twenty minutes before finally entering the larg...
分类:
其他 时间:
2015-06-03 00:54:57
收藏:
0 评论:
0 赞:
0 阅读:
292
#include #include using namespace std;typedef struct _NODE_{ _NODE_* pRight; _NODE_* pLeft; int e; int Count; void InitMember(int e) ...
分类:
其他 时间:
2015-06-03 00:54:27
收藏:
0 评论:
0 赞:
0 阅读:
257
Well, there are several observations for this problemThe max profit is at least0(buy and sell on the same day);The profit of buying on dayiand selling...
分类:
其他 时间:
2015-06-03 00:54:07
收藏:
0 评论:
0 赞:
0 阅读:
163
电源选项中S0,S1,S2,S3,S4,S5的含义以 ACPI 的规格来说吧!ACPI(Advanced Configuration and Power Interface),即高级配置与电源接口。这种新的能源管理可以通过诸如软件控制'开关'系统,亦可以用Modem信号唤醒和关闭系统。 ACPI在....
分类:
其他 时间:
2015-06-03 00:53:57
收藏:
0 评论:
0 赞:
0 阅读:
267
This is a fundamental and yet classic problem. I share my three solutions here:Iterative solution using stack ---O(n)time andO(n)space;Recursive solut...
分类:
其他 时间:
2015-06-03 00:53:47
收藏:
0 评论:
0 赞:
0 阅读:
244
首先评价一下经常使用的搜索类产品。用的最多的是百度。1,用户界面:百度的界面简单整洁,主要突出搜索的重点,所以通常情况下都是一个大的百度logo,下面是帮助搜索的方向,然后是搜索框。和入目清楚的“百度一下”。右上角则是优化性的功能,不影响主体使用,也方便了主体使用。2,记住用户选择:将鼠标选定在搜索...
分类:
其他 时间:
2015-06-03 00:53:07
收藏:
0 评论:
0 赞:
0 阅读:
255
ioctl控制设备除了读写设备之外,其他功能的实现需要ioctl。如串口的波特率的设定。用户空间:ioctl的应用apiint ioctl(int fd, unsigned long cmd, ...)fd 文件描述符cmd 发送的命令...依赖cmd命令内核空间api int (*ioctl)(....
分类:
其他 时间:
2015-06-03 00:52:57
收藏:
0 评论:
0 赞:
0 阅读:
278
自定义View视图文件查找逻辑之前MVC5和之前的版本中,我们要想对View文件的路径进行控制的话,则必须要对IViewEngine接口的FindPartialView或FindView方法进行重写,所有的视图引擎都继承于该IViewEngine接口,比如默认的RazorViewEngine。但新版...
分类:
其他 时间:
2015-06-03 00:52:37
收藏:
0 评论:
0 赞:
0 阅读:
272
django document 提供了非常详尽的资料:https://docs.djangoproject.com/en/1.8/。 按照django document推荐,搭建开发环境:使用vagrant搭建了ubuntu 14.1系统,python和django版本分别是3.4.3和1.8.2,...
分类:
其他 时间:
2015-06-03 00:52:27
收藏:
0 评论:
0 赞:
0 阅读:
325
【转】威尔逊定理威尔逊定理:,其中p为素数。题目:给定一个正整数n,求表达式:的值。分析:分两种情况讨论。(1)3k+7为素数时,那么由威尔逊定理知道,即此时有,,所以(2)3k+7为合数时,那么3k+7可以写成:,那么很明显a和b在(3k+6)!中都会出现,所以,此时所以,综上,问题就是小于等于n...
分类:
其他 时间:
2015-06-03 00:52:17
收藏:
0 评论:
0 赞:
0 阅读:
250
用sizeof求类的大小,http://blog.csdn.net/szchtx/article/details/1025400,这篇博文给出了非常详尽的举例介绍。但是细心的我还是发现了一个小瑕疵,那就是对如下例子求sizeof(B),在VS下是16不是12!class A{public: i...
分类:
其他 时间:
2015-06-03 00:51:58
收藏:
0 评论:
0 赞:
0 阅读:
262
超时版:/*Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occur...
分类:
其他 时间:
2015-06-03 00:51:39
收藏:
0 评论:
0 赞:
0 阅读:
306