码迷,mamicode.com
首页 >  
搜索关键字:divide two integers    ( 17573个结果
hdu 4751 Divide Groups 二分图
题意给出所有人之间的关系,单向的,问能不能将这群人分成两组,使得每组内部的任意两人都互相认识。先把单向边都换成无向边,即如果a,b互相认识那么不变,如果只是单向边的话那么则认为他们两个不认识,然后假设能分成满足题意的两个集合,那么新图的补图中这两个集合内部是没有边的,所以只要判断补图是不是二分图即可...
分类:其他好文   时间:2014-07-16 21:19:06    阅读次数:191
CTCI 3.5
Implement a MyQueue class which implements a queue using two stacks./*Use two stacks, when enqueue, first pop all the elements in stack2 on stack1, th...
分类:其他好文   时间:2014-07-16 20:39:50    阅读次数:234
leetcode题解:Search for a Range (已排序数组范围查找)
题目:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ...
分类:其他好文   时间:2014-07-16 19:48:18    阅读次数:263
Single Number II
Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp...
分类:其他好文   时间:2014-07-14 10:01:38    阅读次数:168
POJ3468 A Simple Problem with Integers 【线段树】+【成段更新】
A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 57666   Accepted: 17546 Case Time Limit: 2000MS Description You have N...
分类:其他好文   时间:2014-07-12 23:43:04    阅读次数:291
Just like normal variables,
Just like normal variables, pointers can be declared constant. There are two different ways that pointers and const can be intermixed, and they are very easy to mix up. To declare a const pointer, ...
分类:其他好文   时间:2014-07-12 21:20:23    阅读次数:165
Leetcode:Swap Nodes in Pairs 单链表相邻两节点逆置
Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space. Y...
分类:其他好文   时间:2014-07-12 20:39:17    阅读次数:225
Add Binary
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". public class Solution { public String addBinary(String a, String b) { ...
分类:其他好文   时间:2014-07-12 19:42:26    阅读次数:168
Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:其他好文   时间:2014-07-12 19:06:27    阅读次数:204
数学图形(1.35)Kappa curve
不知道这个曲线和那个运动品牌背靠背有什么关系.阿迪原先的商标是个三叶草,难道背靠背也是由数学图形来的?以下是维基上的解释.In geometry, the kappa curve or Gutschoven's curve is a two-dimensional algebraic curve r...
分类:移动开发   时间:2014-07-12 15:00:42    阅读次数:324
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!