Problem Description:Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.Solution: 1 public int maxPoint.....
分类:
其他好文 时间:
2014-07-07 16:55:19
阅读次数:
281
非常简单的一道题/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x...
分类:
其他好文 时间:
2014-07-07 16:25:49
阅读次数:
220
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ...
分类:
其他好文 时间:
2014-07-07 14:54:18
阅读次数:
219
package Gui;/** * check box must be in a same ButtonGroup can`t be selected * at the same time * * */import javax.swing.*;import java.awt.*;public c.....
分类:
其他好文 时间:
2014-07-03 07:18:15
阅读次数:
142
PalindromesA regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string"ABCDEDCBA"is a palindr...
分类:
其他好文 时间:
2014-07-01 18:52:11
阅读次数:
460
Sort colors:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the...
分类:
其他好文 时间:
2014-07-01 12:57:43
阅读次数:
179
题目
Given n points
on a 2D plane, find the maximum number of points that lie on the same straight line.
方法
每次选择一个点,和其他n - 1个点,进行判断,统计最多的。
double computeSlope(Point a, Point b) {
...
分类:
其他好文 时间:
2014-06-30 15:48:45
阅读次数:
184
Problem B: Repeat NumberTime Limit:1 SecMemory Limit:32 MBDescriptionDefinition: a+b = c, if all the digits of c are same ( c is more than ten),then w...
分类:
其他好文 时间:
2014-06-30 14:59:33
阅读次数:
508
Problem :It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and ...
分类:
其他好文 时间:
2014-06-28 08:13:17
阅读次数:
249
Swift and Objective-C in the Same Project
在项目里交叉使用Swift和OC
Swift与OC的兼容性使得你可以在项目里使用Swift+OC的方式编写应用程序,称为混合+匹配(mix and match),用这种方式可以一边使用享受新语言的快速特性,一边无缝的接合你已有的OC代码(原文听起来好NB的样子,其实也就那么回事),不管项目最初是用OC编写的...
分类:
其他好文 时间:
2014-06-27 23:41:36
阅读次数:
504