码迷,mamicode.com
首页 >  
搜索关键字:number of islands    ( 27069个结果
HDU - 1394 Minimum Inversion Number (线段树求逆序数)
Description The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj. For a given sequence of numbers a1, a2, ..., an, if we move the ...
分类:其他好文   时间:2014-07-31 13:31:46    阅读次数:229
杭电 1395
2^x mod n = 1 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 11658    Accepted Submission(s): 3634 Problem Description Give a number n...
分类:其他好文   时间:2014-07-31 13:31:17    阅读次数:193
UVa11882,Biggest Number
搜索+剪枝如此水的一个题,居然搞了一上午出错在bfs与dfs时共用了一个vis数组,导致bfs完后返回dfs应该能访问到的点访问不到自己想怎么剪枝,想了几个剪枝方法,又证明,又推翻,再想,再证明,再推翻用了好长时间T T自己还是水的不行啊两个剪枝:1.若,当前求出来的解now的长度+当前状态下能访问...
分类:其他好文   时间:2014-07-31 13:15:16    阅读次数:492
LeetCode--Single Number II
思路:统计每位出现的次数,mod3;对于k同样适用 1 class Solution { 2 public: 3 int singleNumber(int A[], int n) { 4 int a[32] = {0}; 5 int i = 0; 6 ...
分类:其他好文   时间:2014-07-31 13:14:46    阅读次数:140
HDU 2141 Can you find it?
Problem DescriptionGive you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbe...
分类:其他好文   时间:2014-07-31 12:54:46    阅读次数:704
基础语句
基础语句 #region switch case // int Number=char.Parse(Console.ReadLine()); // switch (Number) //{ // case 1: // Console.WriteLine("1"); // break; /...
分类:其他好文   时间:2014-07-31 09:48:06    阅读次数:305
LeetCode "Combination Sum II"
The only difference with version I is: one number can only be used once:class Solution {public: vector > ret; struct Rec { Rec() : sum...
分类:其他好文   时间:2014-07-31 05:22:25    阅读次数:239
Letter Combinations of a Phone Number leetcode java
题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the tele....
分类:编程语言   时间:2014-07-31 05:22:05    阅读次数:307
Maximum Depth of Binary Tree leetcode java
题目:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthes....
分类:编程语言   时间:2014-07-31 02:41:15    阅读次数:229
Minimum Depth of Binary Tree leetcode java
题目:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the neares....
分类:编程语言   时间:2014-07-31 02:30:25    阅读次数:264
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!