码迷,mamicode.com
首页 >  
搜索关键字:light oj    ( 5088个结果
LeetCode OJ - Reverse Linked List II
题目:Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL...
分类:其他好文   时间:2014-06-09 23:03:18    阅读次数:254
[leetcode]Simplify Path @ Python
原题地址:https://oj.leetcode.com/problems/simplify-path/题意:Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home...
分类:编程语言   时间:2014-06-09 19:13:54    阅读次数:181
[LeetCode OJ] 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.
//定义二维平面上的点struct Point{ int x; int y; Point(int a=0, int b=0):x(a),y(b){}};bool operator==(const Point& left, const Point& right){ return...
分类:其他好文   时间:2014-06-08 22:26:17    阅读次数:357
[leetcode]Sqrt(x) @ Python
原题地址:https://oj.leetcode.com/problems/sqrtx/题意:Implementint sqrt(int x).Compute and return the square root ofx.解题思路:实现开平方函数。这里要注意的一点是返回的时一个整数。通过这一点我们可...
分类:编程语言   时间:2014-06-08 21:04:38    阅读次数:329
[leetcode]Search for a Range @ Python
原题地址:https://oj.leetcode.com/problems/search-for-a-range/题意:Given a sorted array of integers, find the starting and ending position of a given target ...
分类:编程语言   时间:2014-06-08 21:03:21    阅读次数:297
[leetcode]Sort Colors @ Python
原题地址:https://oj.leetcode.com/problems/sort-colors/题意:Given an array withnobjects colored red, white or blue, sort them so that objects of the same col...
分类:编程语言   时间:2014-06-08 20:56:32    阅读次数:394
[leetcode]Add Binary @ Python
原题地址:https://oj.leetcode.com/problems/add-binary/题意:Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"...
分类:编程语言   时间:2014-06-08 20:28:04    阅读次数:300
Light OJ 1278 Sum of Consecutive Integers N拆分成连续整数和
题目来源:Light OJ 1278 Sum of Consecutive Integers 题意:N拆分成连续整数和的方案数 思路:奇因数的个数 #include #include #include #include using namespace std; //筛素数 const int maxn = 10000010; bool vis[maxn]; int prime[10...
分类:其他好文   时间:2014-06-08 15:34:09    阅读次数:295
Light OJ 1026 Critical Links 求桥
题目来源:Light OJ 1026 Critical Links 题意:输出桥 思路:模版 #include #include #include #include #include using namespace std; const int maxn = 10010; struct Edge { int u, v; Edge(){} Edge(int u, int v):...
分类:其他好文   时间:2014-06-08 04:07:05    阅读次数:235
Light OJ 1291 Real Life Traffic 双连通最少添边数
题目来源:Light OJ 1291 Real Life Traffic 题意:最少添加几条边 可以使全图边双连通 思路:缩点 重新构图 答案就是(叶子节点数+1)/ 2 #include #include #include #include #include using namespace std; const int maxn = 10010; struct Edge { i...
分类:其他好文   时间:2014-06-08 02:57:26    阅读次数:276
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!