yusijia's blog

yusijia's blog

Keep on going never give up.

  • Home
  • Archives

两个数组里找两个相加和为N的组合(答案只有一个)

题目:在两个数组中找两个相加和为N的组合,答案只有一个 暴力O(n*m) 使用辅助数组保存sum-b[i]的值,优化到O(n+m) #include int sum, m, n;int a[100], b[100]; int main(){ int c[100];

November 04 2016

Generate-parentheses

12345678/* * Given n pairs of parentheses, write a function to generate all combinations * of well-formed parentheses. * For example, given

November 04 2016

Longest-Common-Prefix

1234/* * Write a function to find the longest common prefix string amongst an array * of strings. */ 求多个字符串的最长公共前缀。 123456789101112131415

November 04 2016

最大整数

题目: 输入n代表个数,将他们排列成一排使组合出来的数最大例如:2121 12 12121 //a + b > b + a ? a + b : b + a; 1234567891011121314151617181920212223242526272829303132

November 04 2016

大数相乘

按虚线的方向将相乘的结果相加(虚线上的横纵坐标和为i+J) 1234567891011121314151617181920212223242526272829303132333435363738394041424344#include <iostream>#incl

November 04 2016

大数相加

123456789101112131415161718192021222324252627282930313233343536373839404142#include <cstdio>#include <cstring>#include <iostr

November 04 2016

Roman-To-Integer

123456789101112131415161718192021222324252627282930313233343536373839/* * Given a roman numeral, convert it to an integer. * Input is guaran

October 31 2016

Integer-To-Roman

12345678910111213141516171819202122232425/* * Given an integer, convert it to a roman numeral. * Input is guaranteed to be within the range

October 31 2016

Container-With-Most-Water

123456789/* * Given n non-negative integers a1, a2, ..., an, where each represents a point * at coordinate (i, ai). n vertical lines are dr

October 31 2016

PalindromeNumber

12345678910111213141516/* * Determine whether an integer is a palindrome. Do this without extra space. * Some hints: * Could negative intege

October 29 2016
« Prev12345…34Next »

Tags

  • Ajax&JSON1
  • MYSQL12
  • hexo1
  • javaWeb基础8
  • java并发9
  • leetCode26
  • markdown1
  • 二进制技巧2
  • 图床1
  • 基数排序1
  • 常用6
  • 数据结构-Hash2
  • 数据结构-二叉搜索树2
  • 数据结构-二叉树2
  • 数据结构-双向链表1
  • 数据结构-哈夫曼树1
  • 数据结构-图论-LCA1
  • 数据结构-图论-Tarjan2
  • 数据结构-图论-图论基础6
  • 数据结构-图论-拓扑排序2
  • 数据结构-图论-最小生成树1
  • 数据结构-图论-最小生成树-kruskal6
  • 数据结构-图论-最小生成树-prime5
  • 数据结构-图论-最短路-Dijsktra4
  • 数据结构-图论-最短路-SPFA1
  • 数据结构-图论-最短路-floyd3
  • 数据结构-图论-最短路-floyd-传递闭包2
  • 数据结构-图论-最短路-floyd-求最小环1
  • 数据结构-图论-次小生成树2
  • 数据结构-图论-欧拉回路6
  • 数据结构-图论-链式前向星3
  • 数据结构-字典树5
  • 数据结构-平衡二叉树1
  • 数据结构-循环链表1
  • 数据结构-栈7
  • 数据结构-树状数组5
  • 数据结构-链表1
  • 数据结构-队列3
  • 文章1
  • 桶排序1
  • 模拟7
  • 水题17
  • 算法-Insersion Sort(插入排序)1
  • 算法-binary search(二分查找)4
  • 算法-qmul(快速乘)2
  • 算法-qpow(快速幂)3
  • 算法-qsort(快速排序)5
  • 算法-位向量法2
  • 算法-全排列6
  • 算法-动态规划16
  • 算法-动态规划-按位dp2
  • 算法-回溯法10
  • 算法-图论-广度优先搜索6
  • 算法-图论-深度优先搜索4
  • 算法-基数排序1
  • 算法-堆排序1
  • 算法-大数算法3
  • 算法-尺取法3
  • 算法-希尔排序1
  • 算法-归并排序2
  • 算法-快速选择1
  • 算法-数学题3
  • 算法-数论-卡特兰数1
  • 算法-数论-同余定理4
  • 算法-数论-扩展欧几里得1
  • 算法-数论-欧几里得2
  • 算法-数论-素数筛选法4
  • 算法-数论-费马小定理3
  • 算法-映射2
  • 算法-枚举3
  • 算法-标记,查表思想8
  • 算法-离散化4
  • 算法-计数排序1
  • 算法-贪心4
  • 算法-输入挂和输出挂1
  • 算法-预处理思想1
  • 语言-C++1
  • 语言-java基础知识74
  • 贪心1
  • 逆序对5
  • 高级数据结构-并查集5
  • 高级数据结构-线段树8
RSS

I am a slow walker, but I never walk backwards.

Powered by hexo and Theme by Pacman © 2019 yusijia