巩长胜

导航

2017年3月8日 #

买卖股票的最佳时机

摘要: class Solution {public: /** * @param prices: Given an integer array * @return: Maximum profit */ int maxProfit(vector<int> &prices) { // write your co 阅读全文

posted @ 2017-03-08 20:03 苏莫 阅读(81) 评论(0) 推荐(0) 编辑

删除排序数组中的重复数字

摘要: public static int removeDuplicates(int[] A) { int len = A.length; if (len == 0) return 0; int count = 1; for (int i = 1; i < len; i++) { if (A[i] == A 阅读全文

posted @ 2017-03-08 20:03 苏莫 阅读(69) 评论(0) 推荐(0) 编辑

爬楼梯

摘要: #include<cstdio>using namespace std; int main(){ int n,i; long long a[91]; a[1]=1; //1阶楼梯有一种方法 a[2]=2; //2阶楼梯有两种方法 for(i=3;i<=90;++i) a[i]=a[i-1]+a[i- 阅读全文

posted @ 2017-03-08 20:01 苏莫 阅读(60) 评论(0) 推荐(0) 编辑