![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
acm傻瓜入门史╮(╯_╰)╭
AkiHellobee
这个作者很懒,什么都没留下…
展开
-
Little Girl and Maximum Sum
#include #include using namespace std;long long a[200010],t[200010],ans;int l,r,n,q;int main(){ int i; while(cin>>n>>q) { for(i=0;i<n;i++)t[i]=0; ans=0; for(i=0;i<n;i++)原创 2013-05-22 23:09:21 · 524 阅读 · 0 评论 -
非递归解决leetcode Minimum Depth of Binary Tree
基础题/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */c原创 2015-05-23 20:49:48 · 408 阅读 · 0 评论 -
leetcode Climbing Stairs
class Solution {public: int climbStairs(int n) { if(n == 1) return 1; if(n == 2) return 2; int ans[3]; ans[0] = 1; ans[1] = 2; for(int i=2原创 2015-05-24 21:07:19 · 288 阅读 · 0 评论 -
leetcode Count and Say
简单题,用模拟的方法完成,对字符串的操作更熟悉了class Solution {public: string countAndSay(int n) { string ans = "1"; if(n == 1) return ans; int x,y,xx; int tmplen; string tmpan原创 2015-05-25 10:51:30 · 296 阅读 · 0 评论