码迷,mamicode.com
首页 > 其他好文
[CareerCup] 7.6 The Line Passes the Most Number of Points 经过最多点的直线
7.6 Given a two-dimensional graph with points on it, find a line which passes the most number of points.这道题给了我们许多点,让我们求经过最多点的一条直线。给之前那道7.5 A Line Cut ...
分类:其他好文   时间:2015-09-03 00:43:18    阅读次数:215
BZOJ 2429: [HAOI2006]聪明的猴子( MST )
水题, 求MST即可.--------------------------------------------------------------------------------#includeusing namespace std;#define sqr(x) ((x) * (x))const...
分类:其他好文   时间:2015-09-03 00:42:32    阅读次数:222
[HDOJ1261]字串数
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1261解题思路很好想,设一共有n=n1+n2+...nk个字符,分别出现n1,n2,...nk次,则组合数有n!/(n1!n2!...nk!)种难点在大数运算上 1 #include 2 #includ....
分类:其他好文   时间:2015-09-03 00:43:12    阅读次数:216
求N!中的因子m的个数。
公式:[N/m] + [N/m2] + [N/m3] + ... (N/mx != 0)可以理解为[N/m]贡献了第一个m, 而[N/m2]在第一个个基础之上再贡献了一个m,以此类推。#include #include using namespace std;int cal(int n, int m...
分类:其他好文   时间:2015-09-03 00:41:45    阅读次数:188
ConcurrentHashMap使用要点
ConcurrentHashMap的简要总结: 1、public V get(Object key)不涉及到锁,也就是说获得对象时没有使用锁; 2、put、remove方法要使用锁,但并不一定有锁争用,原因在于ConcurrentHashMap将缓存的变量分到多个Segment,每个Segmen...
分类:其他好文   时间:2015-09-03 00:40:28    阅读次数:261
Cocoa Design Patterns
Book DescriptionThis is the Rough Cut version of the printed book.Much of the technology embodied by Apple's Cocoa software development frameworks hav...
分类:其他好文   时间:2015-09-03 00:40:30    阅读次数:167
延时执行
#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // 运行循环本质上就是一个死循...
分类:其他好文   时间:2015-09-03 00:41:58    阅读次数:235
9.2日私密日记
分类:其他好文   时间:2015-09-03 00:39:12    阅读次数:133
Logistic回归
Logistic回归也是一种分类算法,其主要思想是:根据现有数据对分类边界建立回归公式,以此进行分类。简单的说就是采用Logistic回归函数,接受所有的特征值输入,然后输出类别。Logistic函数又叫sigmoid函数:形状为:从上图容易看出,输入t,在x!=0的情况下,P(t)大于0.5 或小...
分类:其他好文   时间:2015-09-03 00:42:01    阅读次数:210
BZOJ3924 : [Zjoi2015]幻想乡战略游戏
对于一个点,要求出它到所有点的带权距离和,只需记录下树分治的结构然后查询即可。修改$O(\log n)$,查询$O(\log n)$。到所有点带权距离和最小的点显然是这棵树的带权重心。以1号点为根,考虑一条从父亲x到孩子y的边:若y子树内权值和>=总权值和-y子树内权值和,即2*y子树内权值和>=总...
分类:其他好文   时间:2015-09-03 00:41:12    阅读次数:431
简易vector的实现
在这里我们实现了一个简易的vector,没有利用到 stl中的内存分配器,内存分配利用的是new进行分配。其余功能大致实现。 1 #ifndef _NVECTOR_ 2 #define _NVECTOR_ 3 #include 4 #include 5 template 6 class nvect....
分类:其他好文   时间:2015-09-03 00:40:07    阅读次数:217
[LeetCode#201] Bitwise AND of Numbers Range
Problem:Given a range [m, n] where 0 00111010101011...We can we reach the '1' in high index, all digits behind after it must change once. That's to s....
分类:其他好文   时间:2015-09-03 00:38:49    阅读次数:178
嵌套类型(是什么??)
自己参考用
分类:其他好文   时间:2015-09-03 00:36:45    阅读次数:166
task_1 百度首页
头部中如果设置了语言的话,chrome 会自动尝试翻译,所以去掉 lang=eninput 间隙问题当两个input并列在一起时比如百度的首页中 搜索 input 和 submit input 并列式这种情况会出现间隙为什么会出现这种情况?把两个 input 间的换行或空格去掉,发现空隙就没有了啊!...
分类:其他好文   时间:2015-09-03 00:36:39    阅读次数:216
Library System笔记
不得不撘系统了,Centos+flask 应用,其实都是copy的。首先安装python,并把pip装好。http://www.111cn.net/sys/CentOS/53297.htmCentOS6.4下的默认安装的Python版本为2.6.6,很多程序需要在2.7下才能运行。1.安装wget,...
分类:其他好文   时间:2015-09-03 00:34:05    阅读次数:220
代码手写UI,xib和StoryBoard间的博弈,以及Interface Builder的一些小技巧
代码手写UI,xib和StoryBoard间的博弈,以及Interface Builder的一些小技巧最近接触了几个刚入门的iOS学习者,他们之中存在一个普遍和困惑和疑问,就是应该如何制作UI界面。iOS应用是非常重视用户体验的,可以说绝大多数的应用成功与否与交互设计以及UI是否漂亮易用有着非常大的...
分类:其他好文   时间:2015-09-03 00:33:13    阅读次数:180
knockout笔记
根据汤姆大叔博客总结-笔记:============= First name: Last name: Hello, ! ==...
分类:其他好文   时间:2015-09-03 00:33:40    阅读次数:232
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!