码迷,mamicode.com
首页 >  
搜索关键字:two points    ( 13225个结果
package-info.java
问题:看开源项目发现这个package-info.java文件有些特殊,从名字上面也可以猜出这个类是与package有关的。具体是怎么回事呢?:就是记录包的信息To create a package comment file, you have a choice of two files to pl...
分类:编程语言   时间:2014-05-23 09:39:01    阅读次数:328
leetcode -day18 Balanced Binary Tree
1、 ?? Balanced Binary Tree Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subt...
分类:其他好文   时间:2014-05-23 08:19:19    阅读次数:282
【LeetCode】Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:其他好文   时间:2014-05-23 07:43:23    阅读次数:246
hdu 4717 The Moving Points(三分)
题目连接:hdu 4717 The Moving Points 题目大意:给出n个点,每个点有初始的位置(x,y),以及单位时间内移动的距离,向量形式给出。且在哪一个时刻中,n个点之间两两距离的最大值最小,最小值为多少。 解题思路:类似与二分算法的三分,因为如果将时间t和所要求的两两之间距离的最大值d做成一个函数曲线,单调性应该是先递减后递增的,所以用三分法求极值。 #include...
分类:其他好文   时间:2014-05-22 06:52:22    阅读次数:269
HDU 3910 Liang Guo Sha
HDU 3910 Liang Guo Sha 题目大意: If both of them choose “Sha”, then Alice gets A points, and Bob loses A points; if both of them choose “Shan”, then Alice gets B points, and Bob loses B points; otherwise, Bob gets C points, and Alice loses C points. 给定A B ...
分类:其他好文   时间:2014-05-22 06:22:40    阅读次数:281
Linus Torvalds 指针
《对话LinusTorvalds:大多黑客甚至连指针都未理解》http://www.csdn.net/article/2013-01-10/2813559-two-star-programming“不懂指针”的开发者代码示例: 1 typedef struct node 2 { 3 ...
分类:其他好文   时间:2014-05-22 04:40:17    阅读次数:245
一段小程序理解getchar和putchar
#include "stdafx.h"#include using namespace std;int main(){ char c,d,e,f; printf("please input two characters:\n"); c=getchar(); putchar...
分类:其他好文   时间:2014-05-21 23:46:19    阅读次数:352
LightOJ 1088 Points in Segments 二分查找
LightOJ 1088 Points in Segments 二分查找 这个不是二分答案的那种题了,是比较正常的那种集合区间中的那种元素查找的二分题目了。题意很简单,给n个有序的数,这些数分布在一个坐标轴上。给q次查找,询问在区间[x, y](这里的符号和代码的保持一致)中有多少个数据。 解法就是自己写一个二分函数upper_bound和lower_bound,然后直接计算区间即可。...
分类:其他好文   时间:2014-05-21 10:54:31    阅读次数:239
leetcode -day20 Add Two Numbers
1、 ?? Add Two Numbers  You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two num...
分类:其他好文   时间:2014-05-21 10:49:10    阅读次数:221
UVA 12123 - Magnetic Train Tracks(计数问题)
题目链接:12123 - Magnetic Train Tracks 题意:给定n个点,求有几个锐角三角形。 思路:和UVA 11529是同类的题,枚举一个做原点,然后剩下点根据这个原点进行极角排序,然后利用two pointer去遍历一遍,找出角度小于90度的锐角,然后扣掉这些得到钝角三角形的个数,然后在用总情况去扣掉钝角就是锐角或直角 代码: #include #include #...
分类:Web程序   时间:2014-05-20 14:10:56    阅读次数:412
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!