https://www.hackerrank.com/challenges/angry-childrenAmong N ints, pick K with min 'unfairness' (max of k - min of k). Here's the strategy: larger numb...
分类:
其他好文 时间:
2015-02-27 07:42:23
阅读次数:
180
The problem:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are s...
分类:
其他好文 时间:
2015-02-27 07:43:33
阅读次数:
134
文中所有的Proactor模式,均指模拟Proactor模式,而不是操作系统级别的Proactor 先说下Erlang的check_io是做什么用的。Erlang中的check_io实质是调用系统的epoll/select/kevent/poll对IO事件进行检查。 那么问题就...
分类:
其他好文 时间:
2015-02-27 06:41:03
阅读次数:
190
题意:玩飞行棋,棋盘有0~n共n+1,每次抛一个6面的骰子,若得到x(1= n时,游戏结束。求抛骰子次数的期望。
解释概率dp加上一个限制条件,说下为什么当有飞机的时候前面的等于后面的,因为dp代表的是当前位置到n的期望, 所以前面的概率等于飞机到达的
转载:
又一道期望DP,其实这题与hdu4576那道概率DP很像(这道我也写了题解)。那么这两道一道求概率,...
分类:
其他好文 时间:
2015-02-27 06:41:56
阅读次数:
124
有一个吸血鬼被困了,有n条路可以逃出去,每条路有一个难度c[],他初始的战斗力是f,对于第i条路,若f > c[i]他花t[i]天就能出去,否则,他就停留一天,同时战斗力增加c[i]然后再选一条路走出去,他走每条路的概率是相同的。问他逃出去的天数的期望。
设dp[i]表示在战斗力为i时逃出去的期望值,那么可推出状态方程
dp[i] = 1/n * t[j](c[j] > i),d...
分类:
其他好文 时间:
2015-02-27 06:40:00
阅读次数:
131
用OpenCV同时显示两个摄像头的内容的代码如下:#include #include #include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]) { CvCapture...
分类:
其他好文 时间:
2015-02-27 06:39:24
阅读次数:
327
require "Cocos2d"require "Cocos2dConstants"local TestScene = class("TestScene",function() return cc.Scene:create()end)function TestScene.create() ...
分类:
其他好文 时间:
2015-02-27 06:41:21
阅读次数:
147
handler使用流程概要首先在主线程新建一个handler实例,重写onhandlemessage(Message msg) 方法,对传过来的message进行处理然后在子线程中完成操作,操作完成后新建一个message对象,调用handler实例的sendmessage方法,将message传给...
分类:
其他好文 时间:
2015-02-27 06:40:21
阅读次数:
139
暂时不支持目录修改、创建、删除。var gulp = require('gulp');var fs = require('fs');var path = require('path');var less = require('gulp-less');var sass = require('gulp-...
分类:
其他好文 时间:
2015-02-27 06:38:31
阅读次数:
188
微软近期Open的职位:Title: Software Development EngineerLocation: ShanghaiJOB DESCRIPTION: Be a part of MSIT Engineering Community & Online (ECO) Business Int...
分类:
其他好文 时间:
2015-02-27 06:40:21
阅读次数:
150
1 // KMP 2 3 void get_next(char s[],int next[]) 4 { 5 int i,j; 6 i=1;j=0; 7 next[1]=0; 8 int len=strlen(s); 9 while(ilen2)42 ...
分类:
其他好文 时间:
2015-02-27 06:39:52
阅读次数:
230
Account={balance=0}function Account.count(v) -- body print("value is:"..v)enda=Accounta.count(100)Account={balance=0}function Account.count(self...
分类:
其他好文 时间:
2015-02-27 06:38:48
阅读次数:
144
楼主自去年安装了linux,笔记本就响起来了。楼主分析原因:1.第一次安装是完全安装,楼主以为系统安装软件太多,资源不够。没有理会,继续想,继续发热。(这时候楼主还不知道top命令)2.后来楼主安装以最小桌面安装,以为这下就不会响,不会发热了。结果依旧。找度娘说:显卡..
分类:
其他好文 时间:
2015-02-27 01:38:03
阅读次数:
190
适应OpenCart版本详细描述地址&演示地址OpenCart2.0.x,OpenCart1.5.6.x,OpenCart1.5.5.x,OpenCart1.5.5详细描述地址:http://www.chinaopencart.cn/index.php?route=product/product&search=0008&product_id=50演示地址:http://abc0008.tonyspace.com/
分类:
其他好文 时间:
2015-02-27 01:36:24
阅读次数:
192
1、lnoi.sh:列出当前系统下每个IP的连接数:#catlnoi.sh#!/bin/bash
#UseforlistconnectnumbersandIPaddress.
netstat-n|grep‘^tcp‘|grep-v‘127.0.0.1‘|awk‘{print$5}‘|cut-d:-f1|sort|uniq-c|sort-rn|awk‘BEGIN{printf"%-10s%s\n","ConNum","IP"}{printf"%-11s%s\n",$1,$2}..
分类:
其他好文 时间:
2015-02-27 01:38:42
阅读次数:
208
log中:VOICE_REGISTRATION_STATE{1,ac17,02219ea0,17,null,null,null,0,null,null,1,null,null,0,null}1,表示registered,homenetwork;LAC:ac17,CID:02219EA0,radioTech:RADIO_TECH_TD_SCDMA;0:isconcurrentservicessupportindicatorifregisteredonaCDMAsystem0-1.0-Concurr..
分类:
其他好文 时间:
2015-02-27 01:35:35
阅读次数:
2767
归档日志所在目录空间太小,无法归档。
分类:
其他好文 时间:
2015-02-27 01:37:28
阅读次数:
113