码迷,mamicode.com
首页 >  
搜索关键字:cheering up the cows    ( 9333个结果
leetcode——Two Sum 两数之和(AC)
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-06-09 23:14:45    阅读次数:264
POJ 2186 Popular Cows -- tarjan 缩点
链接: POJ 2186 Popular Cows 题意: 每一头牛都希望在牛群里面备受瞩目,在一个牛群中有N头牛(1 输入: 第一行两个整数 N 和 M 第2 到 M + 1 行,两个分开的数 A,B,意味着 A认为 B 更受欢迎。 输出: 被所有牛认为受欢迎的牛的个数 比如输入: 3 3 1 2 2 1...
分类:其他好文   时间:2014-06-08 18:20:40    阅读次数:204
一入python深似海--split
下面说说split函数的用法 def break_words(stuff): """This function will break up words for us.""" words = stuff.split(' ')#split('.',1) use '.' split one time return words def sort_words(wo...
分类:编程语言   时间:2014-06-08 18:19:21    阅读次数:336
POJ 3615 Cow Hurdles.
Description Farmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practicing jumping over hurdles. They are getting tired, though, so they want to be ...
分类:其他好文   时间:2014-06-08 15:55:10    阅读次数:199
LeetCode: Populating Next Right Pointers in Each Node II [117]
【题目】 Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution still work? Note: You may only use constant extra space. For example, Given the following binary tre...
分类:其他好文   时间:2014-06-08 15:46:22    阅读次数:303
重写actionbar的up返回按钮
@Override public boolean onOptionsItemSelected(MenuItem item) {     switch (item.getItemId()) {     // Respond to the action bar's Up/Home button     case android.R.id.home:      //这里写重写的方法 一定要retrun ...
分类:其他好文   时间:2014-06-08 10:39:02    阅读次数:278
POJ - 1324 Holedox Moving
题意:贪吃蛇的题目 思路:BFS+状态的记录,坑了无数发,#include #include #include using namespace std; const int MAXN = 500000; bool flag[8],vis[25][25],mp[21][21][16384]; int n,m,l; int xx[4]={-1,0,1,0}; // up,right,dow,left...
分类:其他好文   时间:2014-06-08 10:13:19    阅读次数:204
leetcode--Search in Rotated Sorted Array II
Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to...
分类:其他好文   时间:2014-06-08 01:19:29    阅读次数:320
Leetcode::Pathsum & Pathsum II
PathsumDescription:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equa...
分类:其他好文   时间:2014-06-08 01:11:46    阅读次数:395
leetcode--Unique Paths II
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i...
分类:其他好文   时间:2014-06-08 00:33:42    阅读次数:339
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!