<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[EvenTreven的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/EvenTreven</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; EvenTreven]]></copyright><item><title><![CDATA[309. Best Time to Buy and Sell Stock with Cooldown]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/80855234</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/80855234</guid><author>EvenTreven</author><pubDate>Fri, 29 Jun 2018 12:53:42 +0800</pubDate><description><![CDATA[It took me more than 2 hours trying to solve it by myself.  
Failed. My mind was completely in mess. I was frustrated dealing this problem, and finally went to the discuss section and found it can be ...]]></description><category></category></item><item><title><![CDATA[300. Longest Increasing Subsequence]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/80851224</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/80851224</guid><author>EvenTreven</author><pubDate>Fri, 29 Jun 2018 04:19:18 +0800</pubDate><description><![CDATA[When going through the discuss section, I found several different solutions for this problem, one using the standard DP (O(N^2)), one using binary search (O(NlogN)), The last one is tricky using lower...]]></description><category></category></item><item><title><![CDATA[Greedy--406]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/80788811</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/80788811</guid><author>EvenTreven</author><pubDate>Sun, 24 Jun 2018 07:55:17 +0800</pubDate><description><![CDATA[406 Queue Reconstruction by Height

I find it difficult for me to come up with a general idea about this problem, in another words, my solution can only pass some of the tests.  
How to get down to th...]]></description><category></category></item><item><title><![CDATA[Separate a string word by word -- istringstream AND getline]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/80770242</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/80770242</guid><author>EvenTreven</author><pubDate>Fri, 22 Jun 2018 11:03:38 +0800</pubDate><description><![CDATA[Problem: 151. Reverse Words in a String 
The straightforward solution is simply recording each word into a string vector, then empty the original string s, iterate the string vector reversely to gener...]]></description><category></category></item><item><title><![CDATA[637. Average of Levels in Binary Tree]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/77162512</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/77162512</guid><author>EvenTreven</author><pubDate>Mon, 14 Aug 2017 15:47:20 +0800</pubDate><description><![CDATA[/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
 * };
 */
class]]></description><category></category></item><item><title><![CDATA[503. Next Greater Element II]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/76408093</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/76408093</guid><author>EvenTreven</author><pubDate>Sun, 30 Jul 2017 22:21:50 +0800</pubDate><description><![CDATA[class Solution {
public:
    vector<int> nextGreaterElements(vector<int>& nums) {
        int n = nums.size();
        vector<int> result(n, -1);
        stack<int> s;
        for (int i = 0; i < n; i+]]></description><category></category></item><item><title><![CDATA[611. Valid Triangle Number]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/75578618</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/75578618</guid><author>EvenTreven</author><pubDate>Thu, 20 Jul 2017 22:04:16 +0800</pubDate><description><![CDATA[Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle.Example 1: 
In]]></description><category></category></item><item><title><![CDATA[数组和字符串]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/69286994</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/69286994</guid><author>EvenTreven</author><pubDate>Wed, 05 Apr 2017 18:39:43 +0800</pubDate><description><![CDATA[数组的声明：int a[maxn]maxn必须是常数，不能是变量


a[n++]：首先赋值a[n]=x, 然后执行n=n+1; 
a[++n]:先n=n+1, 然后用加一之后的n赋值a[n]=x;


  数组最好定义在main函数外面，只有放在外面的时候，数组才可以开得很大，放在main函数里面时，数组稍大就会异常退出



数组不能进行赋值操作，int a[maxn], b[maxn], 要]]></description><category></category></item><item><title><![CDATA[循环结构程序设计]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/68209808</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/68209808</guid><author>EvenTreven</author><pubDate>Wed, 29 Mar 2017 22:40:01 +0800</pubDate><description><![CDATA[FOR
对于for循环，建议尽量缩短变量的定义范围，例如在初始化部分定义循环变量。
for(int i=0;i<10;i++)aabb（7744）输出所有形如aabb的4位完全平方数；#include<stdio.h>
#include<math.h>int main()
{
    for(int a=1;a<=9;a++)
    {
        for(int b=1;b<=9;b++)]]></description><category></category></item><item><title><![CDATA[程序设计入门]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/67696771</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/67696771</guid><author>EvenTreven</author><pubDate>Tue, 28 Mar 2017 23:23:15 +0800</pubDate><description><![CDATA[圆柱体的表面积#include<stdio.h>
#include<math.h>
int main()
{
    const double pi=acos(-1.0);
    double r,h,s1,s2,s;
    scanf("%lf%lf",&r,&h);
    s1=pi*r*r;
    s2=2*r*pi*h;
    s=2.0*s1+s2;
    printf("ar]]></description><category></category></item><item><title><![CDATA[STL初步--排序与检索]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/64931032</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/64931032</guid><author>EvenTreven</author><pubDate>Wed, 22 Mar 2017 20:46:13 +0800</pubDate><description><![CDATA[排序与检索]]></description><category></category></item><item><title><![CDATA[LeetCode :【Easy】344. Reverse String]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/62038807</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/62038807</guid><author>EvenTreven</author><pubDate>Tue, 14 Mar 2017 10:58:10 +0800</pubDate><description><![CDATA[Write a function that takes a string as input and returns the string reversed.Example: 
Given s = “hello”, return “olleh”.]]></description><category></category></item><item><title><![CDATA[LeetCode :【Easy】412. Fizz Buzz]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/61919404</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/61919404</guid><author>EvenTreven</author><pubDate>Mon, 13 Mar 2017 15:51:16 +0800</pubDate><description><![CDATA[Write a program that outputs the string representation of numbers from 1 to n.

But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”.]]></description><category></category></item><item><title><![CDATA[LeetCode :【Easy】500. Keyboard Row]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/61619468</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/61619468</guid><author>EvenTreven</author><pubDate>Sun, 12 Mar 2017 16:10:13 +0800</pubDate><description><![CDATA[Given a List of words, return the words that can be typed using letters of alphabet on only one row’s of American keyboard like the image below.]]></description><category></category></item><item><title><![CDATA[LeetCode :【Easy】476. Number Complement]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/61199529</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/61199529</guid><author>EvenTreven</author><pubDate>Fri, 10 Mar 2017 16:32:41 +0800</pubDate><description><![CDATA[Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note: 
The given integer is guaranteed to fit within the range of a 32-b]]></description><category></category></item><item><title><![CDATA[LeetCode :【Easy】461. Hamming Distance]]></title><link>https://blog.youkuaiyun.com/EvenTreven/article/details/60139832</link><guid>https://blog.youkuaiyun.com/EvenTreven/article/details/60139832</guid><author>EvenTreven</author><pubDate>Fri, 03 Mar 2017 14:37:39 +0800</pubDate><description><![CDATA[LeetCode :【Easy】461. Hamming Distance

The Hamming distance between two integers is the number of positions at which the corresponding bits are different.

Given two integers x and y, calculate the Ha]]></description><category></category></item></channel></rss>