解题报告
铁锈_
游戏码农
展开
-
解题报告1 Max Points on a Line
题目:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.方法:找到两个不重合的顶点,然后统计这两个顶点确定的直线上点的数目。遍历所有的起点和终点即可。1.确定起点2.统计平面上多少顶点与起点重合3.找到一个与起点不重合的顶点原创 2016-09-18 22:30:12 · 274 阅读 · 0 评论 -
合并子目录
小Hi的电脑的文件系统中一共有N个文件,例如:/hihocoder/offer22/solutions/p1/hihocoder/challenge30/p1/test /game/moba/dota2/uninstall 小Hi想统计其中一共有多少个不同的子目录。上例中一共有8个不同的子目录:/hihocoder/hihocoder/offer22/hihocod原创 2017-08-13 21:44:17 · 342 阅读 · 0 评论 -
组合数
https://leetcode-cn.com/problems/combination-sum/第一个方法自己写的,内存方面因为函数调用传递了不少参数,消耗了不少内存。效率方面,也是小于0肯定不在继续搜索下去,不知道为什么慢了那么多。执行用时292ms 88.6MB// 组合总和.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。//#inc...原创 2019-09-17 00:42:01 · 171 阅读 · 1 评论