锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲欧美精品午睡沙发,亚洲中文无码永久免,无码天堂va亚洲va在线vahttp://www.tkk7.com/sandy/archive/2013/05/22/399605.html灝忔槑灝忔槑Wed, 22 May 2013 14:25:00 GMThttp://www.tkk7.com/sandy/archive/2013/05/22/399605.htmlhttp://www.tkk7.com/sandy/comments/399605.htmlhttp://www.tkk7.com/sandy/archive/2013/05/22/399605.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/399605.htmlhttp://www.tkk7.com/sandy/services/trackbacks/399605.html
Problem

Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
Below is one possible representation of s1 = "great":
    great
   /    \
  gr    eat
 / \    /  \
g   r  e   at
           / \
          a   t
To scramble the string, we may choose any non-leaf node and swap its two children.
For example, if we choose the node "gr" and swap its two children, it produces a scrambled string "rgeat".
    rgeat
   /    \
  rg    eat
 / \    /  \
r   g  e   at
           / \
          a   t
We say that "rgeat" is a scrambled string of "great".
Similarly, if we continue to swap the children of nodes "eat" and "at", it produces a scrambled string "rgtae".
    rgtae
   /    \
  rg    tae
 / \    /  \
r   g  ta  e
       / \
      t   a
We say that "rgtae" is a scrambled string of "great".
Given two strings s1 and s2 of the same length, determine if s2 is a scrambled string of s1.

 


鍒嗘瀽錛?br />
榪欎釜闂鏄痝oogle鐨勯潰璇曢銆傜敱浜庝竴涓瓧絎︿覆鏈夊緢澶氱浜屽弶琛ㄧず娉曪紝璨屼技寰堥毦鍒ゆ柇涓や釜瀛楃涓叉槸鍚﹀彲浠ュ仛榪欐牱鐨勫彉鎹€?br />瀵逛粯澶嶆潅闂鐨勬柟娉曟槸浠庣畝鍗曠殑鐗逛緥鏉ユ濊冿紝浠庤屾壘鍑鴻寰嬨?br />鍏堣冨療綆鍗曟儏鍐碉細(xì)
瀛楃涓查暱搴︿負(fù)1錛氬緢鏄庢樉錛屼袱涓瓧絎︿覆蹇呴』瀹屽叏鐩稿悓鎵嶅彲浠ャ?br />瀛楃涓查暱搴︿負(fù)2錛氬綋s1="ab", s2鍙湁"ab"鎴栬?ba"鎵嶅彲浠ャ?br />瀵逛簬浠繪剰闀垮害鐨勫瓧絎︿覆錛屾垜浠彲浠ユ妸瀛楃涓瞫1鍒嗕負(fù)a1,b1涓や釜閮ㄥ垎錛宻2鍒嗕負(fù)a2,b2涓や釜閮ㄥ垎錛屾弧瓚籌紙(a1~a2) && (b1~b2)錛夋垨鑰?nbsp;錛?a1~b2) && (a1~b2)錛?br />
濡傛錛屾垜浠壘鍒頒簡瑙e喅闂鐨勬濊礬銆傞鍏堟垜浠皾璇曠敤閫掑綊鏉ュ啓銆?br />

瑙f硶涓錛堥掑綊錛?br />
涓や釜瀛楃涓茬殑鐩鎬技鐨勫繀澶囨潯浠舵槸鍚湁鐩稿悓鐨勫瓧絎﹂泦銆傜畝鍗曠殑鍋氭硶鏄妸涓や釜瀛楃涓茬殑瀛楃鎺掑簭鍚庯紝鐒跺悗姣旇緝鏄惁鐩稿悓銆?br />鍔犱笂榪欎釜媯鏌ュ氨鍙互澶уぇ鐨勫噺灝戦掑綊嬈℃暟銆?br />浠g爜濡備笅錛?br />
public boolean isScramble(String s1, String s2) {
        int l1 = s1.length();
        int l2 = s2.length();
        if(l1!=l2){
            return false;
        }
        if(l1==0){
            return true;
        }
        
        char[] c1 = s1.toCharArray();
        char[] c2 = s2.toCharArray();
        if(l1==1){
            return c1[0]==c2[0];
        }
        Arrays.sort(c1);
        Arrays.sort(c2);
        for(int i=0;i<l1;++i){
            if(c1[i]!=c2[i]){
                return false;
            }
        }
        
        boolean result = false;
        for(int i=1;i<l1 && !result;++i){
            String s11 = s1.substring(0,i);
            String s12 = s1.substring(i);
            String s21 = s2.substring(0,i);
            String s22 = s2.substring(i);
            result = isScramble(s11,s21) && isScramble(s12,s22);
            if(!result){
                String s31 = s2.substring(0,l1-i);
                String s32 = s2.substring(l1-i);
                result = isScramble(s11,s32) && isScramble(s12,s31);
            }
        }
        
        return result;
    }

瑙f硶浜岋紙鍔ㄦ佽鍒掞級
鍑忓皯閲嶅璁$畻鐨勬柟娉曞氨鏄姩鎬佽鍒掋傚姩鎬佽鍒掓槸涓縐嶇濂囩殑綆楁硶鎶鏈紝涓嶄翰鑷幓鍐欙紝鏄緢闅懼畬鍏ㄦ帉鎻″姩鎬佽鍒掔殑銆?br />
榪欓噷鎴戜嬌鐢ㄤ簡涓涓笁緇存暟緇刡oolean result[len][len][len],鍏朵腑絎竴緇翠負(fù)瀛愪覆鐨勯暱搴︼紝絎簩緇翠負(fù)s1鐨勮搗濮嬬儲寮曪紝絎笁緇翠負(fù)s2鐨勮搗濮嬬儲寮曘?br />result[k][i][j]琛ㄧずs1[i...i+k]鏄惁鍙互鐢眘2[j...j+k]鍙樺寲寰楁潵銆?br />
浠g爜濡備笅錛岄潪甯哥畝媧佷紭緹庯細(xì)

public class Solution {
    public boolean isScramble(String s1, String s2) {
        int len = s1.length();
        if(len!=s2.length()){
            return false;
        }
        if(len==0){
            return true;
        }
        
        char[] c1 = s1.toCharArray();
        char[] c2 = s2.toCharArray();
        
        boolean[][][] result = new boolean[len][len][len];
        for(int i=0;i<len;++i){
            for(int j=0;j<len;++j){
                result[0][i][j] = (c1[i]==c2[j]);
            }
        }
        
        for(int k=2;k<=len;++k){
            for(int i=len-k;i>=0;--i){
              for(int j=len-k;j>=0;--j){
                  boolean r = false;
                  for(int m=1;m<k && !r;++m){
                      r = (result[m-1][i][j] && result[k-m-1][i+m][j+m]) || (result[m-1][i][j+k-m] && result[k-m-1][i+m][j]);
                  }
                  result[k-1][i][j] = r;
              }
            }
        }
        
        return result[len-1][0][0];
    }
}


灝忔槑 2013-05-22 22:25 鍙戣〃璇勮
]]>
Subsetshttp://www.tkk7.com/sandy/archive/2013/05/21/399521.html灝忔槑灝忔槑Tue, 21 May 2013 14:50:00 GMThttp://www.tkk7.com/sandy/archive/2013/05/21/399521.htmlhttp://www.tkk7.com/sandy/comments/399521.htmlhttp://www.tkk7.com/sandy/archive/2013/05/21/399521.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/399521.htmlhttp://www.tkk7.com/sandy/services/trackbacks/399521.html
Problem

Given a collection of integers that might contain duplicates, S, return all possible subsets.

Note:

  • Elements in a subset must be in non-descending order.
  • The solution set must not contain duplicate subsets.

For example,
If S = [1,2,2], a solution is:

[   [2],   [1],   [1,2,2],   [2,2],   [1,2],   [] ] 

鍒嗘瀽錛?br />鍥犱負(fù)瑕佹眰緇撴灉闆嗘槸鍗囧簭鎺掑垪錛屾墍浠ラ鍏堟垜浠瀵規(guī)暟緇勮繘琛屾帓搴忋?br />
瀛愰泦鐨勯暱搴﹀彲浠ヤ粠0鍒版暣涓暟緇勭殑闀垮害銆傞暱搴︿負(fù)n+1鐨勫瓙闆嗗彲浠ョ敱闀垮害涓簄鐨勫瓙闆嗗啀鍔犱笂鍦ㄤ箣鍚庣殑涓涓厓绱犵粍鎴愩?br />
榪欓噷鎴戜嬌鐢ㄤ簡涓変釜鎶宸?br />1銆備嬌鐢ㄤ簡涓涓猧ndex鏁扮粍鏉ヨ褰曟瘡涓瓙闆嗙殑鏈澶х儲寮曪紝榪欐牱娣誨姞鏂板厓绱犲氨寰堢畝鍗曘?br />2銆備嬌鐢ㄤ簡涓や釜鍙橀噺start鍜宔nd鏉ヨ褰曚笂涓涓暱搴︾殑瀛愰泦鍦ㄧ粨鏋滀腑鐨勮搗濮嬪拰緇堟浣嶇疆銆?br />3銆傚幓閲嶅鐞嗕嬌鐢ㄤ簡涓涓猯ast鍙橀噺璁板綍鍓嶄竴嬈$殑鍊鹼紝瀹冪殑鍒濆鍊艱涓篠[0]-1,榪欐牱灝變繚璇佷簡鍜屾暟緇勭殑浠諱綍涓涓厓绱犱笉鍚屻?br />
浠g爜濡備笅錛?br />
public class Solution {
    public ArrayList<ArrayList<Integer>> subsetsWithDup(int[] S) {
        Arrays.sort(S);
        
        ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
        ArrayList<Integer> indexs = new ArrayList<Integer>();
        result.add(new ArrayList<Integer>());
        indexs.add(-1);
        
        int slen = S.length;
        int start=0,end=0;
        for(int len=1;len<=slen;++len){
            int e = end;
            for(int i=start;i<=end;++i){
                ArrayList<Integer> ss = result.get(i);
                int index = indexs.get(i).intValue();
                int last = S[0]-1;
                for(int j = index+1;j<slen;++j){
                    int v = S[j];
                    if(v!=last){
                        ArrayList<Integer> newss = new ArrayList<Integer>(ss);
                        newss.add(v);
                        result.add(newss);
                        indexs.add(j);
                        ++e;
                        last = v;
                    }
                }
            }
            
            start = end+1;
            end = e;
        }
        return result;
    }
}


灝忔槑 2013-05-21 22:50 鍙戣〃璇勮
]]>
鏍奸浄鐮?/title><link>http://www.tkk7.com/sandy/archive/2013/05/20/399526.html</link><dc:creator>灝忔槑</dc:creator><author>灝忔槑</author><pubDate>Mon, 20 May 2013 13:09:00 GMT</pubDate><guid>http://www.tkk7.com/sandy/archive/2013/05/20/399526.html</guid><wfw:comment>http://www.tkk7.com/sandy/comments/399526.html</wfw:comment><comments>http://www.tkk7.com/sandy/archive/2013/05/20/399526.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sandy/comments/commentRss/399526.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sandy/services/trackbacks/399526.html</trackback:ping><description><![CDATA[<div><fieldset><legend>闂</legend>鏍奸浄鐮佹槸涓涓簩榪涘埗鐨勭紪鐮佺郴緇燂紝鐩擱偦鐨勪袱涓暟鍙湁涓浣嶆槸涓嶅悓鐨勩?br />緇欏畾涓涓潪璐熺殑鏁存暟n錛屼唬琛ㄤ簡鏍奸浄鐮佺殑浣嶇殑鎬繪暟銆傝緭鍑烘牸闆風(fēng)爜鐨勫簭鍒楋紝榪欎釜搴忓垪蹇呴』浠?寮濮嬨?br /><br />姣斿錛岀粰瀹歯=2,杈撳嚭錛?錛?錛?錛?錛斤紝鏍奸浄鐮佹槸<br />0 錛?00<br />1 錛?01<br />3 錛?11<br />2 錛?10<br /><br />娉細(xì)鏍奸浄鐮佺殑搴忓垪騫朵笉鏄敮涓錛屾瘮濡俷=2鏃訛紝錛?錛?錛?錛?錛戒篃婊¤凍鏉′歡銆?br /></fieldset><br /><br />鍒嗘瀽錛?br />鏍奸浄鐮佺殑搴忓垪涓簲鍖呭惈2^n涓暟銆傝繖涓棶棰樺垵鐪嬭搗鏉ヤ笉瀹規(guī)槗錛屾垜浠鎯沖嚭涓涓敓鎴愭柟娉曘?br /><br />瀵逛簬n=2,搴忓垪鏄細(xì)<br />00錛?1錛?1錛?0<br />閭e浜巒=3,濡備綍鍒╃敤n=2鐨勫簭鍒楀憿錛熶竴涓柟娉曟槸錛屽厛鍦╪=2鐨勫洓涓簭鍒楀墠鍔?錛堣繖鍏跺疄鏄繚鎸佷笉鍙橈級錛岀劧鍚庡啀鑰冭檻鎶婃渶楂樹綅鍙樻垚1錛屽彧闇瑕佹妸鏂瑰悜鍙嶈繃鏉ュ氨鍙互浜?br />000錛?01錛?11錛?10<br />100錛?01錛?11錛?10錛?gt; 110,111,101,100<br />鎶婅繖涓よ鍚堣搗鏉ュ氨鍙互寰楀埌鏂扮殑搴忓垪銆?br /><br />鎯抽氫簡錛屽啓浠g爜灝卞緢瀹規(guī)槗浜嗐?br /><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">class</span> Solution {<br />    <span style="color: #0000FF; ">public</span> ArrayList<Integer> grayCode(<span style="color: #0000FF; ">int</span> n) {<br />        ArrayList<Integer> result = <span style="color: #0000FF; ">new</span> ArrayList<Integer>();<br />        result.add(0);<br />        <span style="color: #0000FF; ">if</span>(n>0){<br />            result.add(1);<br />        }<br />        <br />        <span style="color: #0000FF; ">int</span> mask = 1;<br />        <span style="color: #0000FF; ">for</span>(<span style="color: #0000FF; ">int</span> i=2;i<=n;++i){<br />            mask *= 2;<br />            <span style="color: #0000FF; ">for</span>(<span style="color: #0000FF; ">int</span> j=result.size()-1;j>=0;--j){<br />                <span style="color: #0000FF; ">int</span> v = result.get(j).intValue();<br />                v |= mask;<br />                result.add(v);<br />            }<br />        }<br />        <span style="color: #0000FF; ">return</span> result;<br />    }<br />}</div></div><img src ="http://www.tkk7.com/sandy/aggbug/399526.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sandy/" target="_blank">灝忔槑</a> 2013-05-20 21:09 <a href="http://www.tkk7.com/sandy/archive/2013/05/20/399526.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浜ゅ弶瀛楃涓?/title><link>http://www.tkk7.com/sandy/archive/2013/05/10/398754.html</link><dc:creator>灝忔槑</dc:creator><author>灝忔槑</author><pubDate>Fri, 10 May 2013 12:47:00 GMT</pubDate><guid>http://www.tkk7.com/sandy/archive/2013/05/10/398754.html</guid><wfw:comment>http://www.tkk7.com/sandy/comments/398754.html</wfw:comment><comments>http://www.tkk7.com/sandy/archive/2013/05/10/398754.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.tkk7.com/sandy/comments/commentRss/398754.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sandy/services/trackbacks/398754.html</trackback:ping><description><![CDATA[<div><fieldset><legend>闂</legend>緇欏畾瀛楃涓瞫1,s2,s3,鍒ゆ柇s3鏄惁鍙互鐢眘1鍜宻2浜ゅ弶緇勬垚寰楀埌銆?br /><br />渚嬪錛?br /><br /><p style="margin: 0px 0px 20px; padding: 0px; border: 0px; outline: 0px; font-size: 13px; vertical-align: baseline; color: #222222; font-family: 'Helvetica Neue', arial, sans-serif; "><em style="margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: baseline; ">s1</em> = <code style="margin: 0px; padding: 1px 5px; border: 0px; outline: 0px; vertical-align: baseline; background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; ">"aabcc"</code>,<br style="margin: 0px; " /><em style="margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: baseline; ">s2</em> = <code style="margin: 0px; padding: 1px 5px; border: 0px; outline: 0px; vertical-align: baseline; background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; ">"dbbca"</code>,</p><p style="margin: 0px 0px 20px; padding: 0px; border: 0px; outline: 0px; font-size: 13px; vertical-align: baseline; color: #222222; font-family: 'Helvetica Neue', arial, sans-serif; ">When <em style="margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: baseline; ">s3</em> = <code style="margin: 0px; padding: 1px 5px; border: 0px; outline: 0px; vertical-align: baseline; background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; ">"aadbbcbcac"</code>, return true.<br style="margin: 0px; " />When <em style="margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: baseline; ">s3</em> = <code style="margin: 0px; padding: 1px 5px; border: 0px; outline: 0px; vertical-align: baseline; background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; ">"aadbbbaccc"</code>, return false.</p></fieldset><br />瑙f硶涓錛氾紙閫掑綊錛?br /><br />涓涓畝鍗曠殑鎯蟲硶錛屾槸閬嶅巻s3鐨勬瘡涓瓧絎︼紝榪欎釜瀛楃蹇呴』絳変簬s1鍜宻2鐨勬煇涓瓧絎︺傚鏋滈兘涓嶇浉絳夛紝鍒欒繑鍥瀎alse<br />鎴戜滑浣跨敤3涓彉閲廼,j,k鍒嗗埆璁板綍褰撳墠s1,s2,s3鐨勫瓧絎︿綅緗?br />濡傛灉s3[k] = s1[i], i鍚戝悗縐誨姩涓浣嶃傚鏋渟3[k]=s2[j],j鍚戝悗縐誨姩涓浣嶃?br />榪欎釜棰樼洰涓昏闅懼湪濡傛灉s1鍜宻2鐨勫瓧絎﹀嚭鐜伴噸澶嶇殑鏃跺欙紝灝辨湁涓ょ鎯呭喌錛宨,j閮藉彲浠ュ悜鍚庝竴浣嶃?br />涓嬮潰鐨勭畻娉曞湪榪欑鎯呭喌浣跨敤浜嗛掑綊錛屽緢綆鍗曠殑鍋氭硶銆備絾鏄晥鐜囬潪甯稿樊錛屾槸鎸囨暟澶嶆潅搴︾殑銆?br /><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">class</span> Solution {<br />    <span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">boolean</span> isInterleave(String s1, String s2, String s3) {<br />        <span style="color: #0000FF; ">int</span> l1 = s1.length();<br />        <span style="color: #0000FF; ">int</span> l2 = s2.length();<br />        <span style="color: #0000FF; ">int</span> l3 = s3.length();<br />        <br />        <span style="color: #0000FF; ">if</span>(l1+l2!=l3){<br />            <span style="color: #0000FF; ">return</span> <span style="color: #0000FF; ">false</span>;<br />        }<br />        <br />        <span style="color: #0000FF; ">char</span>[] c1 = s1.toCharArray();<br />        <span style="color: #0000FF; ">char</span>[] c2 = s2.toCharArray();<br />        <span style="color: #0000FF; ">char</span>[] c3 = s3.toCharArray();<br />        <br />        <span style="color: #0000FF; ">int</span> i=0,j=0;<br />        <span style="color: #0000FF; ">for</span>(<span style="color: #0000FF; ">int</span> k=0;k<l3;++k){<br />            <span style="color: #0000FF; ">char</span> c = c3[k];<br />            <span style="color: #0000FF; ">boolean</span> m1 = i<l1 && c==c1[i];<br />            <span style="color: #0000FF; ">boolean</span> m2 = j<l2 && c==c2[j];<br />            <span style="color: #0000FF; ">if</span>(!m1 && !m2){<br />                <span style="color: #0000FF; ">return</span> <span style="color: #0000FF; ">false</span>;<br />            }<br />            <span style="color: #0000FF; ">else</span> <span style="color: #0000FF; ">if</span>(m1 && m2){<br />                String news3 =  s3.substring(k+1);<br />                <span style="color: #0000FF; ">return</span> isInterleave(s1.substring(i+1),s2.substring(j),news3)<br />                                || isInterleave(s1.substring(i),s2.substring(j+1),news3);<br />            }<br />            <span style="color: #0000FF; ">else</span> <span style="color: #0000FF; ">if</span>(m1){<br />                ++i;<br />            }<br />            <span style="color: #0000FF; ">else</span>{<br />                ++j;<br />            }<br />        }<br />        <br />        <span style="color: #0000FF; ">return</span> <span style="color: #0000FF; ">true</span>;        <br />    }<br />}</div><br /><br />瑙f硶浜岋細(xì)錛堝姩鎬佽鍒掞級<br />涓轟簡鍑忓皯閲嶅璁$畻錛屽氨瑕佷嬌鐢ㄥ姩鎬佽鍒掓潵璁板綍涓棿緇撴灉銆?br /><br />榪欓噷鎴戜嬌鐢ㄤ簡涓涓簩緇存暟緇剅esult[i][j]鏉ヨ〃紺簊1鐨勫墠i涓瓧絎﹀拰s2鐨勫墠j涓瓧絎︽槸鍚﹁兘鍜宻3鐨勫墠i+j涓瓧絎﹀尮閰嶃?br /><br />鐘舵佽漿縐繪柟紼嬪涓嬶細(xì)<br />result[i,j] = (result[i-1,j] && s1[i] = s3[i+j])  || (result[i,j-1] && s2[j] = s3[i+j]);<br />鍏朵腑0≤i≤len(s1) ,0≤j≤len(s2)</div><div><br />榪欐牱綆楁硶澶嶆潅搴﹀氨浼?xì)涓嬮檷鍒癘(l1*l2)<br /></div><div><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">class</span> Solution {<br />   <br /><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">boolean</span> isInterleave(String s1, String s2, String s3) {<br />        <span style="color: #0000FF; ">int</span> l1 = s1.length();<br />        <span style="color: #0000FF; ">int</span> l2 = s2.length();<br />        <span style="color: #0000FF; ">int</span> l3 = s3.length();<br />       <br />        <span style="color: #0000FF; ">if</span>(l1+l2!=l3){<br />            <span style="color: #0000FF; ">return</span> <span style="color: #0000FF; ">false</span>;<br />        }<br />        <br />        <span style="color: #0000FF; ">char</span>[] c1 = s1.toCharArray();<br />        <span style="color: #0000FF; ">char</span>[] c2 = s2.toCharArray();<br />        <span style="color: #0000FF; ">char</span>[] c3 = s3.toCharArray();<br />        <br />        <span style="color: #0000FF; ">boolean</span>[][] result = <span style="color: #0000FF; ">new</span> <span style="color: #0000FF; ">boolean</span>[l1+1][l2+1];<br />        result[0][0] = <span style="color: #0000FF; ">true</span>;<br />        <br />        <span style="color: #0000FF; ">for</span>(<span style="color: #0000FF; ">int</span> i=0;i<l1;++i){<br />            <span style="color: #0000FF; ">if</span>(c1[i]==c3[i]){<br />                result[i+1][0] = <span style="color: #0000FF; ">true</span>;<br />            }<br />            <span style="color: #0000FF; ">else</span>{<br />                <span style="color: #0000FF; ">break</span>;<br />            }<br />        }<br />        <br />        <span style="color: #0000FF; ">for</span>(<span style="color: #0000FF; ">int</span> j=0;j<l2;++j){<br />            <span style="color: #0000FF; ">if</span>(c2[j]==c3[j]){<br />                result[0][j+1] = <span style="color: #0000FF; ">true</span>;<br />            }<br />            <span style="color: #0000FF; ">else</span>{<br />                <span style="color: #0000FF; ">break</span>;<br />            }<br />        }<br />        <br />        <br />        <span style="color: #0000FF; ">for</span>(<span style="color: #0000FF; ">int</span> i=1;i<=l1;++i){<br />            <span style="color: #0000FF; ">char</span> ci = c1[i-1];<br />            <span style="color: #0000FF; ">for</span>(<span style="color: #0000FF; ">int</span> j=1;j<=l2;++j){<br />                <span style="color: #0000FF; ">char</span> cj = c2[j-1];<br />                <span style="color: #0000FF; ">char</span> ck = c3[i+j-1];<br />                   result[i][j] = (result[i][j-1] && cj==ck) || (result[i-1][j] && ci==ck);<br />            }<br />        }<br />        <br />        <span style="color: #0000FF; ">return</span> result[l1][l2];<br />   }<br />}</div></div><img src ="http://www.tkk7.com/sandy/aggbug/398754.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sandy/" target="_blank">灝忔槑</a> 2013-05-10 20:47 <a href="http://www.tkk7.com/sandy/archive/2013/05/10/398754.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>涓変釜鏁頒箣鍜?/title><link>http://www.tkk7.com/sandy/archive/2013/05/01/398604.html</link><dc:creator>灝忔槑</dc:creator><author>灝忔槑</author><pubDate>Wed, 01 May 2013 15:13:00 GMT</pubDate><guid>http://www.tkk7.com/sandy/archive/2013/05/01/398604.html</guid><wfw:comment>http://www.tkk7.com/sandy/comments/398604.html</wfw:comment><comments>http://www.tkk7.com/sandy/archive/2013/05/01/398604.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sandy/comments/commentRss/398604.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sandy/services/trackbacks/398604.html</trackback:ping><description><![CDATA[     鎽樿: 緇欏畾涓涓敱n涓暣鏁扮粍鎴愮殑鏁扮粍S錛屾槸鍚﹀瓨鍦⊿涓殑涓変釜鏁癮,b,c浣垮緱 a+b+c=0?鎵懼嚭鎵鏈夌殑涓嶉噸澶嶇殑鍜屼負(fù)0鐨勪笁鍏冪粍銆?<br> <br>娉ㄦ剰錛?<br>1.涓夊厓緇勭殑鏁存暟鎸夌収鍗囧簭鎺掑垪 a<b<c <br>2.緇欏嚭鐨勭粨鏋滀腑涓嶈兘鍚湁鐩稿悓鐨勪笁鍏冪粍  <a href='http://www.tkk7.com/sandy/archive/2013/05/01/398604.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/sandy/aggbug/398604.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sandy/" target="_blank">灝忔槑</a> 2013-05-01 23:13 <a href="http://www.tkk7.com/sandy/archive/2013/05/01/398604.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瀛愬簭鍒楄鏁?/title><link>http://www.tkk7.com/sandy/archive/2013/04/26/398467.html</link><dc:creator>灝忔槑</dc:creator><author>灝忔槑</author><pubDate>Fri, 26 Apr 2013 15:33:00 GMT</pubDate><guid>http://www.tkk7.com/sandy/archive/2013/04/26/398467.html</guid><wfw:comment>http://www.tkk7.com/sandy/comments/398467.html</wfw:comment><comments>http://www.tkk7.com/sandy/archive/2013/04/26/398467.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sandy/comments/commentRss/398467.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sandy/services/trackbacks/398467.html</trackback:ping><description><![CDATA[     鎽樿: 緇欏畾涓や釜瀛楃涓睸鍜孴錛岃綆桽鐨勫瓙搴忓垪涓篢鐨勪釜鏁般?<br> <br>榪欓噷鐨勫瓧絎︿覆鐨勫瓙搴忓垪鎸囩殑鏄垹闄ゅ瓧絎︿覆鐨勫嚑涓瓧絎︼紙涔熷彲浠ヤ笉鍒狅級鑰屽緱鍒扮殑鏂扮殑瀛楃涓詫紝浣嗘槸涓嶈兘鏀瑰彉瀛楃鐨勭浉瀵逛綅緗?<br> <br>姣斿鈥淎CE鈥濇槸鈥淎BCDE鈥濈殑瀛愬簭鍒楋紝浣嗘槸鈥淎EC鈥濆氨涓嶆槸銆?<br> <br>濡傛灉S錛濃渞abbbit鈥?T錛濃渞abit鈥濓紝鏈?縐嶄笉鍚岀殑瀛愬簭鍒椾負(fù)T鐨勬瀯鎴愭柟娉曪紝閭d箞緇撴灉搴旇榪斿洖3銆?nbsp; <a href='http://www.tkk7.com/sandy/archive/2013/04/26/398467.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/sandy/aggbug/398467.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sandy/" target="_blank">灝忔槑</a> 2013-04-26 23:33 <a href="http://www.tkk7.com/sandy/archive/2013/04/26/398467.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璁劇疆浜屽弶鏍?wèi)鐨刵ext鑺傜偣http://www.tkk7.com/sandy/archive/2013/04/26/398413.html灝忔槑灝忔槑Fri, 26 Apr 2013 03:23:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/26/398413.htmlhttp://www.tkk7.com/sandy/comments/398413.htmlhttp://www.tkk7.com/sandy/archive/2013/04/26/398413.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/398413.htmlhttp://www.tkk7.com/sandy/services/trackbacks/398413.html
闂緇欏畾涓棰椾簩鍙夋爲(wèi)錛?br />
class TreeLinkNode {
  TreeLinkNode left;
  TreeLinkNode right;
  TreeLinkNode next;
}
瑕佹眰鎶婃墍鏈夎妭鐐圭殑next鑺傜偣璁劇疆鎴愬畠鍙寵竟鐨勮妭鐐癸紝濡傛灉娌℃湁鍙寵妭鐐癸紝璁劇疆鎴愮┖銆傚垵濮嬬姸鎬侊紝鎵鏈夌殑next鐨勬寚閽堝潎涓簄ull.

瑕佹眰:浣犲彧鑳戒嬌鐢ㄥ父鏁扮殑絀洪棿銆?br />
姣斿錛?br />
         1
       /  \
      2    3
     / \    \
    4   5    7
搴旇杈撳嚭錛?br />
1 -> NULL
       /  \
      2 -> 3 -> NULL
     / \    \
    4-> 5 -> 7 -> NULL

鍒嗘瀽錛?br />棰樼洰涓嶉毦錛屼絾鏄湪闈㈣瘯鏃訛紝鍦ㄦ湁闄愮殑鏃墮棿鍐咃紝娌℃湁bug鍐欏嚭錛岃繕鏄緢鑰冮獙鍔熷姏鐨勩?br />
瑙e喅榪欎釜闂鐨勬濊礬鏄愬眰鎵弿錛屼笂涓灞傝緗ソ涓嬩竴灞傜殑next鍏崇郴錛屽湪澶勭悊絀烘寚閽堢殑鏃跺欒鏍煎灝忓績銆?br />浠g爜濡備笅錛屾湁娉ㄩ噴錛屽簲璇ュ緢瀹規(guī)槗鐪嬫噦錛?br />浣跨敤浜嗕笁涓寚閽堬細(xì)
node:褰撳墠鑺傜偣
firstChild:涓嬩竴灞傜殑絎竴涓潪絀哄瓙鑺傜偣
lastChild:涓嬩竴灞傜殑鏈鍚庝竴涓緟澶勭悊錛堟湭璁劇疆next)鐨勫瓙鑺傜偣

    public void connect(TreeLinkNode root) {
        TreeLinkNode node = root;
        TreeLinkNode firstChild = null;
        TreeLinkNode lastChild = null;
        
        while(node!=null){
            if(firstChild == null){ //璁板綍絎竴涓潪絀哄瓙鑺傜偣
                firstChild = node.left!=null?node.left:node.right;
            }
            //璁劇疆瀛愯妭鐐圭殑next鍏崇郴錛?縐嶆儏鍐?/span>
            if(node.left!=null && node.right!=null){ 
                if(lastChild!=null){
                    lastChild.next = node.left;
                }
                node.left.next = node.right;
                lastChild = node.right;
            }
            else if(node.left!=null){
                if(lastChild!=null){
                    lastChild.next = node.left;
                }
                lastChild = node.left;
            }
            else if(node.right!=null){
                if(lastChild!=null){
                    lastChild.next = node.right;
                }
                lastChild = node.right;
            }
            //璁劇疆涓嬩竴涓妭鐐癸紝濡傛灉鏈眰宸茬粡閬嶅巻瀹屾瘯錛岀Щ鍒頒笅涓灞傜殑絎竴涓瓙鑺傜偣
            if(node.next!=null){
                node = node.next;
            }
            else{
                node = firstChild;
                firstChild = null;
                lastChild = null;
            }
        }
    }


灝忔槑 2013-04-26 11:23 鍙戣〃璇勮
]]>
鏈浣崇殑鑲$エ涔板崠鏃墮棿IIIhttp://www.tkk7.com/sandy/archive/2013/04/25/398406.html灝忔槑灝忔槑Thu, 25 Apr 2013 14:22:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/25/398406.htmlhttp://www.tkk7.com/sandy/comments/398406.htmlhttp://www.tkk7.com/sandy/archive/2013/04/25/398406.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/398406.htmlhttp://www.tkk7.com/sandy/services/trackbacks/398406.html闂鍋囪浣犳湁涓涓暟緇勫寘鍚簡姣忓ぉ鐨勮偂紲ㄤ環(huán)鏍鹼紝瀹冪殑絎琲涓厓绱犲氨鏄i澶╃殑鑲$エ浠鋒牸銆?nbsp;

璁捐涓涓畻娉曞鎵炬渶澶х殑鏀剁泭銆備綘鍙互鏈澶氳繘琛屼袱嬈′氦鏄撱?br />娉ㄦ剰錛氫綘涓嶈兘鍚屾椂榪涜澶氭浜ゆ槗錛屼篃灝辨槸璇翠綘涔拌偂紲ㄤ箣鍓嶏紝蹇呴』鍗栨帀鎵嬩腑鑲$エ銆?/span>

鍒嗘瀽錛?br />榪欓亾棰樼浉姣斾箣鍓嶇殑涓ら亾棰橈紝闅懼害鎻愰珮浜嗕笉灝戙?br />
鍥犱負(fù)闄愬埗浜嗗彧鑳戒氦鏄撲袱嬈★紝鎵浠ユ垜浠彲浠ユ妸n澶╁垎涓轟袱孌碉紝鍒嗗埆璁$畻榪欎袱孌電殑鏈澶ф敹鐩婏紝灝卞彲浠ュ緱鍒頒竴涓渶澶ф敹鐩娿傜┓涓炬墍鏈夎繖鏍風(fēng)殑鍒嗘硶錛屽氨鍙互寰楀埌鍏ㄥ眬鐨勬渶澶ф敹鐩娿?br />
涓轟簡鎻愰珮鏁堢巼錛岃繖閲屼嬌鐢ㄥ姩鎬佽鍒掞紝鍗蟲妸涓棿鐘舵佽褰曚笅鏉ャ備嬌鐢ㄤ簡涓や釜鏁扮粍profits錛宯profits鍒嗗埆璁板綍浠?..i鍜宨..n鐨勬渶澶ф敹鐩娿?br />
浠g爜濡備笅錛?br />
public int maxProfit(int[] prices) {
        int days = prices.length;
        if(days<2){
            return 0;
        }
        int[] profits = new int[days];
        int min = prices[0];
        int max = min;
        for(int i=1;i<days;++i){
            int p = prices[i];
            if(min>p){
                max = min = p;
            }
            else if(max<p){
                max = p;
            }
            int profit = max - min;
            profits[i] = (profits[i-1]>profit)?profits[i-1]:profit;
        }
        
        int[] nprofits = new int[days];
        nprofits[days-1] = 0;
        max = min = prices[days-1];
        for(int i=days-2;i>=0;--i){
            int p = prices[i];
            if(min>p){
                min =p;
            }
            else if(max<p){
                max = min = p;
            }
            int profit = max - min;
            nprofits[i] = (nprofits[i+1]>profit)?nprofits[i+1]:profit;
        }
        
        int maxprofit = 0;
        
        for(int i=0;i<days;++i){
            int profit = profits[i]+nprofits[i];
            if(maxprofit<profit){
                maxprofit = profit;
            }
        }
        
        return maxprofit;        
    }


灝忔槑 2013-04-25 22:22 鍙戣〃璇勮
]]>
鏈浣崇殑鑲$エ涔板崠鏃墮棿IIhttp://www.tkk7.com/sandy/archive/2013/04/19/398104.html灝忔槑灝忔槑Fri, 19 Apr 2013 13:50:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/19/398104.htmlhttp://www.tkk7.com/sandy/comments/398104.htmlhttp://www.tkk7.com/sandy/archive/2013/04/19/398104.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/398104.htmlhttp://www.tkk7.com/sandy/services/trackbacks/398104.html
闂鍋囪浣犳湁涓涓暟緇勫寘鍚簡姣忓ぉ鐨勮偂紲ㄤ環(huán)鏍鹼紝瀹冪殑絎琲涓厓绱犲氨鏄i澶╃殑鑲$エ浠鋒牸銆?br />
璁捐涓涓畻娉曞鎵炬渶澶х殑鏀剁泭銆備綘鍙互榪涜浠繪剰澶氭浜ゆ槗銆備絾鏄紝浣犱笉鑳藉悓鏃惰繘琛屽嬈′氦鏄擄紝涔熷氨鏄浣犱拱鑲$エ涔嬪墠錛屽繀欏誨崠鎺夋墜涓偂紲ㄣ?/fieldset>
鍒嗘瀽錛氫負(fù)浜嗗緱鍒版渶澶ф敹鐩婏紝蹇呴』鍦ㄦ墍鏈変笂鍗囩殑鏇茬嚎孌電殑寮濮嬬偣涔板叆錛屽湪鏈楂樼偣鍗栧嚭銆傝屽湪涓嬮檷闃舵涓嶅嚭鎵嬨?br />


瀹炵幇浠g爜濡備笅錛?br />
public class Solution {
    public int maxProfit(int[] prices) {
        int len = prices.length;
        if(len<2){
            return 0;
        }
        
        int min=0;
        int result = 0;
        boolean inBuy = false;
        for(int i=0;i<len-1;++i){
            int p = prices[i];
            int q = prices[i+1];
            if(!inBuy){
                if(q>p){
                    inBuy = true;
                    min=p ;
                }
            }
            else{
                if(q<p){
                    result += (p-min);
                    inBuy = false;
                }
            }
        }
        if(inBuy){
            result += ((prices[len-1])-min);
        }
        return result;
    }
}


灝忔槑 2013-04-19 21:50 鍙戣〃璇勮
]]>鏈浣崇殑鑲$エ涔板崠鏃墮棿http://www.tkk7.com/sandy/archive/2013/04/19/398087.html灝忔槑灝忔槑Fri, 19 Apr 2013 07:03:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/19/398087.htmlhttp://www.tkk7.com/sandy/comments/398087.htmlhttp://www.tkk7.com/sandy/archive/2013/04/19/398087.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/398087.htmlhttp://www.tkk7.com/sandy/services/trackbacks/398087.html
浣犲彧鑳借繘琛屼竴嬈′氦鏄擄紙涓嬈′拱榪涘拰涓嬈″崠鍑猴級錛岃璁′竴涓畻娉曟眰鍑烘渶澶х殑鏀剁泭銆?nbsp; 闃呰鍏ㄦ枃

灝忔槑 2013-04-19 15:03 鍙戣〃璇勮
]]>
浜屽弶鏍?wèi)鏈澶х殑璺緞鍜?/title><link>http://www.tkk7.com/sandy/archive/2013/04/18/398054.html</link><dc:creator>灝忔槑</dc:creator><author>灝忔槑</author><pubDate>Thu, 18 Apr 2013 13:31:00 GMT</pubDate><guid>http://www.tkk7.com/sandy/archive/2013/04/18/398054.html</guid><wfw:comment>http://www.tkk7.com/sandy/comments/398054.html</wfw:comment><comments>http://www.tkk7.com/sandy/archive/2013/04/18/398054.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/sandy/comments/commentRss/398054.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sandy/services/trackbacks/398054.html</trackback:ping><description><![CDATA[     鎽樿: 緇欏畾涓涓簩鍙夋爲(wèi)錛屽鎵炬渶澶х殑璺緞鍜? <br>璺緞鍙互浠庝換鎰忚妭鐐瑰紑濮嬪埌浠繪剰鑺傜偣緇撴潫銆傦紙涔熷彲浠ユ槸鍗曚釜鑺傜偣錛?<br> <br>姣斿錛氬浜庝簩鍙夋爲(wèi) <br> 1 <br> / \ <br>2 3 <br>鍜屾渶澶х殑璺緞鏄?->1->3錛岀粨鏋滀負(fù)6 <br>/** <br> * Definition for binary tree <br> * public class TreeNode { <br> * int val; <br> * TreeNode left; <br> * TreeNode right; <br> * TreeNode(int x) { val = x; } <br> * } <br> */  <a href='http://www.tkk7.com/sandy/archive/2013/04/18/398054.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/sandy/aggbug/398054.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sandy/" target="_blank">灝忔槑</a> 2013-04-18 21:31 <a href="http://www.tkk7.com/sandy/archive/2013/04/18/398054.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瀛楁娓告垙IIhttp://www.tkk7.com/sandy/archive/2013/04/18/398045.html灝忔槑灝忔槑Thu, 18 Apr 2013 09:32:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/18/398045.htmlhttp://www.tkk7.com/sandy/comments/398045.htmlhttp://www.tkk7.com/sandy/archive/2013/04/18/398045.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/398045.htmlhttp://www.tkk7.com/sandy/services/trackbacks/398045.html
1.姣忔鍙兘鍙樻崲涓涓瓧姣?
2.鎵鏈夌殑涓棿鍗曡瘝蹇呴』瀛樺湪浜庡瓧鍏鎬腑

姣斿錛?
杈撳叆錛?
start = "hit"
end = "cog"
dict = ["hot","dot","dog","lot","log"]

閭d箞鏈鐭殑鍙樺寲搴忓垪鏈変袱涓?
["hit","hot","dot","dog","cog"],
["hit","hot","lot","log","cog"]銆?
娉ㄦ剰錛?
1. 鎵鏈夊崟璇嶇殑闀垮害閮芥槸鐩稿悓鐨?
2. 鎵鏈夊崟璇嶉兘鍙惈鏈夊皬鍐欑殑瀛楁瘝銆?nbsp; 闃呰鍏ㄦ枃

灝忔槑 2013-04-18 17:32 鍙戣〃璇勮
]]>
鍚堝茍鎺掑簭濂界殑鏁扮粍http://www.tkk7.com/sandy/archive/2013/04/18/398017.html灝忔槑灝忔槑Thu, 18 Apr 2013 05:44:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/18/398017.htmlhttp://www.tkk7.com/sandy/comments/398017.htmlhttp://www.tkk7.com/sandy/archive/2013/04/18/398017.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/398017.htmlhttp://www.tkk7.com/sandy/services/trackbacks/398017.html
public class Solution {
public void merge(int A[], int m, int B[], int n) {
//write your code here }
}

娉ㄦ剰錛?
鍋囧畾A鏈夎凍澶熺殑棰濆鐨勫閲忓偍瀛楤鐨勫唴瀹癸紝m鍜宯鍒嗗埆涓篈鍜孊鐨勫垵濮嬪寲鍏冪礌鐨勪釜鏁般傝姹傜畻娉曞鏉傚害鍦∣(m+n)銆?nbsp; 闃呰鍏ㄦ枃

灝忔槑 2013-04-18 13:44 鍙戣〃璇勮
]]>
瀛楁娓告垙http://www.tkk7.com/sandy/archive/2013/04/18/398014.html灝忔槑灝忔槑Thu, 18 Apr 2013 04:46:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/18/398014.htmlhttp://www.tkk7.com/sandy/comments/398014.htmlhttp://www.tkk7.com/sandy/archive/2013/04/18/398014.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/398014.htmlhttp://www.tkk7.com/sandy/services/trackbacks/398014.html
1.姣忔鍙兘鍙樻崲涓涓瓧姣?
2.鎵鏈夌殑涓棿鍗曡瘝蹇呴』瀛樺湪浜庡瓧鍏鎬腑

姣斿錛?
杈撳叆錛?
start = "hit"
end = "cog"
dict = ["hot","dot","dog","lot","log"]

閭d箞鏈鐭殑鍙樺寲搴忓垪鏄?hit" -> "hot" -> "dot" -> "dog" -> "cog"錛屾墍浠ヨ繑鍥為暱搴︽槸5銆?
娉ㄦ剰錛?
1. 濡傛灉鎵句笉鍒拌繖鏍風(fēng)殑搴忓垪錛岃繑鍥?
2. 鎵鏈夊崟璇嶇殑闀垮害閮芥槸鐩稿悓鐨?
3. 鎵鏈夊崟璇嶉兘鍙惈鏈夊皬鍐欑殑瀛楁瘝銆?nbsp; 闃呰鍏ㄦ枃

灝忔槑 2013-04-18 12:46 鍙戣〃璇勮
]]>
浜屽弶鏍?wèi)姹傚拰闂?/title><link>http://www.tkk7.com/sandy/archive/2013/04/16/397901.html</link><dc:creator>灝忔槑</dc:creator><author>灝忔槑</author><pubDate>Tue, 16 Apr 2013 03:37:00 GMT</pubDate><guid>http://www.tkk7.com/sandy/archive/2013/04/16/397901.html</guid><wfw:comment>http://www.tkk7.com/sandy/comments/397901.html</wfw:comment><comments>http://www.tkk7.com/sandy/archive/2013/04/16/397901.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.tkk7.com/sandy/comments/commentRss/397901.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sandy/services/trackbacks/397901.html</trackback:ping><description><![CDATA[     鎽樿: 緇欏畾涓涓簩鍙夋爲(wèi)錛屾瘡涓妭鐐圭殑鍊兼槸涓涓暟瀛楋紙0-9錛夛紝姣忎釜浠庢牴鑺傜偣鍒板彾鑺傜偣鍧囪兘緇勬垚涓涓暟瀛椼?<br>姣斿濡傛灉浠庢牴鑺傜偣鍒板彾鑺傜偣鐨勮礬寰勬槸1-2-3錛岄偅涔堣繖浠h〃浜?23榪欎釜鏁板瓧銆?<br>姹傚嚭鎵鏈夎繖鏍蜂粠鏍硅妭鐐瑰埌鍙惰妭鐐圭殑鏁板瓧涔嬪拰銆?<br> <br>姣斿錛屽浜庝簩鍙夋爲(wèi) <br> 1 <br> / \ <br>2 3 <br> <br>涓鍏辨湁涓ゆ潯璺緞1->2鍜?->3錛岄偅涔堟眰鍜岀殑緇撴灉灝辨槸12+13=25 <br>/** <br> * Definition for binary tree <br> * public class TreeNode { <br> * int val; <br> * TreeNode left; <br> * TreeNode right; <br> * TreeNode(int x) { val = x; } <br> * } <br> */ <br>public class Solution { <br> public int sumNumbers(TreeNode root) { <br> //write c  <a href='http://www.tkk7.com/sandy/archive/2013/04/16/397901.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/sandy/aggbug/397901.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sandy/" target="_blank">灝忔槑</a> 2013-04-16 11:37 <a href="http://www.tkk7.com/sandy/archive/2013/04/16/397901.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍖呭洿鐨勫尯鍩?/title><link>http://www.tkk7.com/sandy/archive/2013/04/15/397875.html</link><dc:creator>灝忔槑</dc:creator><author>灝忔槑</author><pubDate>Mon, 15 Apr 2013 10:17:00 GMT</pubDate><guid>http://www.tkk7.com/sandy/archive/2013/04/15/397875.html</guid><wfw:comment>http://www.tkk7.com/sandy/comments/397875.html</wfw:comment><comments>http://www.tkk7.com/sandy/archive/2013/04/15/397875.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.tkk7.com/sandy/comments/commentRss/397875.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sandy/services/trackbacks/397875.html</trackback:ping><description><![CDATA[     鎽樿: 緇欏畾涓涓?D鐨勬鐩橈紝鍚湁鈥榅'鍜屸橭'錛屾壘鍒版墍鏈夎鈥榅'鍖呭洿鐨勨橭'錛岀劧鍚庢妸璇ュ尯鍩熺殑鈥極鈥欓兘鍙樻垚'X'銆?<br> <br>渚嬪瓙-杈撳叆錛?<br>X X X X <br>X O O X <br>X X O X <br>X O X X <br> <br>搴旇杈撳嚭錛?<br> <br>X X X X <br>X X X X <br>X X X X <br>X O X X <br> <br>public void solve(char[][] board) { <br>}  <a href='http://www.tkk7.com/sandy/archive/2013/04/15/397875.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/sandy/aggbug/397875.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sandy/" target="_blank">灝忔槑</a> 2013-04-15 18:17 <a href="http://www.tkk7.com/sandy/archive/2013/04/15/397875.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍥炴枃瀛楃涓茬殑鍒囧壊闂2http://www.tkk7.com/sandy/archive/2013/04/15/397847.html灝忔槑灝忔槑Mon, 15 Apr 2013 05:52:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/15/397847.htmlhttp://www.tkk7.com/sandy/comments/397847.htmlhttp://www.tkk7.com/sandy/archive/2013/04/15/397847.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/397847.htmlhttp://www.tkk7.com/sandy/services/trackbacks/397847.html瑕佹眰榪斿洖鎵鏈夊彲鑳界殑鍒嗗壊銆?

姣斿錛屽浜庡瓧絎︿覆s="aab",
榪斿洖:

[
["aa","b"],
["a","a","b"]
]
  闃呰鍏ㄦ枃

灝忔槑 2013-04-15 13:52 鍙戣〃璇勮
]]>
+1http://www.tkk7.com/sandy/archive/2013/04/15/397841.html灝忔槑灝忔槑Mon, 15 Apr 2013 03:22:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/15/397841.htmlhttp://www.tkk7.com/sandy/comments/397841.htmlhttp://www.tkk7.com/sandy/archive/2013/04/15/397841.html#Feedback3http://www.tkk7.com/sandy/comments/commentRss/397841.htmlhttp://www.tkk7.com/sandy/services/trackbacks/397841.htmlpublic class Solution {
public int[] plusOne(int[] digits) {
}
}  闃呰鍏ㄦ枃

灝忔槑 2013-04-15 11:22 鍙戣〃璇勮
]]>
蹇熷紑騫蟲柟http://www.tkk7.com/sandy/archive/2013/04/15/397836.html灝忔槑灝忔槑Mon, 15 Apr 2013 02:19:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/15/397836.htmlhttp://www.tkk7.com/sandy/comments/397836.htmlhttp://www.tkk7.com/sandy/archive/2013/04/15/397836.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/397836.htmlhttp://www.tkk7.com/sandy/services/trackbacks/397836.html璁$畻鍜岃繑鍥瀤鐨勫鉤鏂規(guī)牴銆?nbsp; 闃呰鍏ㄦ枃

灝忔槑 2013-04-15 10:19 鍙戣〃璇勮
]]>
鏈闀胯繛緇簭鍒楅棶棰?/title><link>http://www.tkk7.com/sandy/archive/2013/04/12/397751.html</link><dc:creator>灝忔槑</dc:creator><author>灝忔槑</author><pubDate>Fri, 12 Apr 2013 07:58:00 GMT</pubDate><guid>http://www.tkk7.com/sandy/archive/2013/04/12/397751.html</guid><wfw:comment>http://www.tkk7.com/sandy/comments/397751.html</wfw:comment><comments>http://www.tkk7.com/sandy/archive/2013/04/12/397751.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.tkk7.com/sandy/comments/commentRss/397751.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/sandy/services/trackbacks/397751.html</trackback:ping><description><![CDATA[     鎽樿: 緇欏畾涓涓湭鎺掑簭鐨勬暣鏁版暟緇勶紝姹傛渶闀跨殑榪炵畫搴忓垪鐨勯暱搴︺傝姹傜畻娉曠殑鏃墮棿澶嶆潅搴﹀湪O(n) <br>姣斿瀵逛簬鏁扮粍[100, 4, 200, 1, 3, 2]錛屽叾涓渶闀垮簭鍒椾負(fù)[1,2,3,4]錛屾墍浠ュ簲璇ヨ繑鍥? <br> <br>public class Solution { <br> public int longestConsecutive(int[] num) { <br> //write your code here <br> } <br>}  <a href='http://www.tkk7.com/sandy/archive/2013/04/12/397751.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/sandy/aggbug/397751.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/sandy/" target="_blank">灝忔槑</a> 2013-04-12 15:58 <a href="http://www.tkk7.com/sandy/archive/2013/04/12/397751.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍥炴枃瀛楃涓茬殑鍒囧壊闂http://www.tkk7.com/sandy/archive/2013/04/11/397689.html灝忔槑灝忔槑Thu, 11 Apr 2013 03:24:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/11/397689.htmlhttp://www.tkk7.com/sandy/comments/397689.htmlhttp://www.tkk7.com/sandy/archive/2013/04/11/397689.html#Feedback1http://www.tkk7.com/sandy/comments/commentRss/397689.htmlhttp://www.tkk7.com/sandy/services/trackbacks/397689.html姹傛渶灝戠殑鍒嗗壊嬈℃暟銆?nbsp; 闃呰鍏ㄦ枃

灝忔槑 2013-04-11 11:24 鍙戣〃璇勮
]]>
TopCoder MatchMaker瑙f硶http://www.tkk7.com/sandy/archive/2013/04/02/397286.html灝忔槑灝忔槑Tue, 02 Apr 2013 06:04:00 GMThttp://www.tkk7.com/sandy/archive/2013/04/02/397286.htmlhttp://www.tkk7.com/sandy/comments/397286.htmlhttp://www.tkk7.com/sandy/archive/2013/04/02/397286.html#Feedback0http://www.tkk7.com/sandy/comments/commentRss/397286.htmlhttp://www.tkk7.com/sandy/services/trackbacks/397286.html闂鎻忚堪錛?/div>
Problem Statement
THIS PROBLEM WAS TAKEN FROM THE SEMIFINALS OF THE TOPCODER INVITATIONAL
TOURNAMENT
DEFINITION
Class Name: MatchMaker
Method Name: getBestMatches
Paramaters: String[], String, int
Returns: String[]
Method signature (be sure your method is public):  String[]
getBestMatches(String[] members, String currentUser, int sf);
PROBLEM STATEMENT
A new online match making company needs some software to help find the "perfect
couples".  People who sign up answer a series of multiple-choice questions.
Then, when a member makes a "Get Best Mates" request, the software returns a
list of users whose gender matches the requested gender and whose answers to
the questions were equal to or greater than a similarity factor when compared
to the user's answers.
Implement a class MatchMaker, which contains a method getBestMatches.  The
method takes as parameters a String[] members, String currentUser, and an int
sf:
- members contains information about all the members.  Elements of members are
of the form "NAME G D X X X X X X X X X X" 
   * NAME represents the member's name
   * G represents the gender of the current user. 
   * D represents the requested gender of the potential mate. 
* Each X indicates the member's answer to one of the multiple-choice
questions.  The first X is the answer to the first question, the second is the
answer to the second question, et cetera. 
- currentUser is the name of the user who made the "Get Best Mates" request.  
- sf is an integer representing the similarity factor.
The method returns a String[] consisting of members' names who have at least sf
identical answers to currentUser and are of the requested gender.  The names
should be returned in order from most identical answers to least.  If two
members have the same number of identical answers as the currentUser, the names
should be returned in the same relative order they were inputted.
TopCoder will ensure the validity of the inputs.  Inputs are valid if all of
the following criteria are met:
- members will have between 1 and 50 elements, inclusive.
- Each element of members will have a length between 7 and 44, inclusive.
- NAME will have a length between 1 and 20, inclusive, and only contain
uppercase letters A-Z.
- G can be either an uppercase M or an uppercase F.
- D can be either an uppercase M or an uppercase F.
- Each X is a capital letter (A-D).
- The number of Xs in each element of the members is equal.  The number of Xs
will be between 1 and 10, inclusive. 
- No two elements will have the same NAME.
- Names are case sensitive.
- currentUser consists of between 1 and 20, inclusive, uppercase letters, A-Z,
and must be a member.
- sf is an int between 1 and 10, inclusive.
- sf must be less than or equal to the number of answers (Xs) of the members.
NOTES
The currentUser should not be included in the returned list of potential mates.
EXAMPLES
For the following examples, assume members =
{"BETTY F M A A C C",
 "TOM M F A D C A",
 "SUE F M D D D D",
 "ELLEN F M A A C A",
 "JOE M F A A C A",
 "ED M F A D D A",
 "SALLY F M C D A B",
 "MARGE F M A A C C"}
If currentUser="BETTY" and sf=2, BETTY and TOM have two identical answers and
BETTY and JOE have three identical answers, so the method should return
{"JOE","TOM"}.
If currentUser="JOE" and sf=1, the method should return
{"ELLEN","BETTY","MARGE"}.
If currentUser="MARGE" and sf=4, the method should return [].
Definition
Class:
MatchMaker
Method:
getBestMatches
Parameters:
String[], String, int
Returns:
String[]
Method signature:
String[] getBestMatches(String[] param0, String param1, int param2)
(be sure your method is public)


================================================================鎴戠殑浠g爜=============

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class MatchMaker {
    enum GENDER{MALE,FEMALE};
    
    //"NAME G D X X X X X X X X X X" 
    private static class Member{
        String name;
        GENDER gender;
        GENDER mate;
        String[] answers;
        int index;
        int matched = 0;
    }
    
    String[] getBestMatches(String[] members, String currentUser, int sf){
        List<Member> allMembers = new ArrayList<Member>();
        Member cu = null;
        for(int i=0;i<members.length;++i){
            String m = members[i];
            String[] c = m.split(" ");
            Member mem = new Member();
            mem.name= c[0];
            mem.gender = c[1].equals("M")?GENDER.MALE:GENDER.FEMALE;
            mem.mate = c[2].equals("M")?GENDER.MALE:GENDER.FEMALE;
            mem.index = i;
            mem.matched = 0;
            String[] answers = mem.answers = new String[c.length-3];
            for(int j=3;j<c.length;++j){
                answers[j-3] = c[j];
            }
            allMembers.add(mem);
            if(c[0].equals(currentUser)){
                cu = mem;
            }
        }
        List<Member> matched = new ArrayList<Member>();
        if(cu!=null){
            for(Member mem:allMembers){
                if(mem!=cu && mem.gender==cu.mate){
                    for(int i=0;i<mem.answers.length;++i){
                        if(mem.answers[i].equals(cu.answers[i])){
                            ++mem.matched;
                        }
                    }
                    if(mem.matched>=sf){
                        matched.add(mem);
                    }
                }
            }
            
            Collections.sort(matched, new Comparator<Member>(){
                public int compare(Member ma, Member mb) {
                    if(ma.matched!=mb.matched){
                        return mb.matched - ma.matched;
                    }
                    return ma.index-mb.index;
                }
            });
            
            String[] result = new String[matched.size()];
            for(int i=0;i<result.length;++i){
                result[i] = matched.get(i).name;
            }
            return result;
        }
        return new String[0];
    }
}




灝忔槑 2013-04-02 14:04 鍙戣〃璇勮
]]>
TopCoder Prerequisites瑙f硶http://www.tkk7.com/sandy/archive/2011/10/25/361989.html灝忔槑灝忔槑Tue, 25 Oct 2011 05:28:00 GMThttp://www.tkk7.com/sandy/archive/2011/10/25/361989.htmlhttp://www.tkk7.com/sandy/comments/361989.htmlhttp://www.tkk7.com/sandy/archive/2011/10/25/361989.html#Feedback3http://www.tkk7.com/sandy/comments/commentRss/361989.htmlhttp://www.tkk7.com/sandy/services/trackbacks/361989.htmlhttp://community.topcoder.com/stat?c=problem_statement&pm=164&rd=50

Class Name: Prerequisites

Mathod Name: orderClasses

Parameters: String[]

Returns: String[]

 

You are a student at a college with the most unbelievably complex prerequisite

structure ever. To help you schedule your classes, you decided to put together

a program that returns the order in which the classes should be taken. 

 

Implement a class Prerequisites which contains a method orderClasses. The

method takes a String[] that contains the classes you must take and returns a

String[] of classes in the order the classes should be taken so that all

prerequisites are met.

 

String[] elements will be of the form (and TopCoder will ensure this):

"CLASS: PRE1 PRE2 ..." where PRE1 and PRE2 are prerequisites of CLASS. CLASS,

PRE1, PRE2, ... consist of a department name (3 or 4 capital letters, A-Z

inclusive) followed by a class number (an integer between 100 and 999,

inclusive). The department name should be immediately followed by the class

number with no additional characters, numbers or spaces (i.e. MATH217). It is

not necessary for a class to have prerequisites. In such a case, the colon is

the last character in the String. 

 

You can only take one class at a time, therefore, use the following rules to

determine which class to take :

1) Any prerequisite class(es) listed for a class must be taken before the class

can be taken.

2) If multiple classes can be taken at the same time, you take the one with the

lowest number first, regardless of department.

3) If multiple classes with the same number can be taken at the same time, you

take the department name which comes first in alphabetical order. 

4) If the inputted course schedule has errors, return a String[] of length 0.

There is an error if it is impossible to return the classes in an order such

that all prerequisites are met, or if a prerequisite is a course that does not

have its own entry in the inputted String[].

 

Examples of valid input Strings are:

"CSE111: CSE110 MATH101"

"CSE110:"

 

Examples of invalid input Strings are:

"CS117:" (department name must consist of 3 - 4 capital letters, inclusive)

"cs117:" (department name must consist of 3 - 4 capital letters, inclusive)

"CS9E11:" (department name must be letters only)

"CSE110: " (no trailing spaces allowed)

"CSE110: CSE101 " (no trailing spaces allowed)

"MATH211: MAM2222" (class number to large)

"MATH211: MAM22" (class number to small)

"ENGIN517: MATH211" (department name to large)

 

Here is the method signature (be sure your method is public):

String[] orderClasses(String[] classSchedule);

 

TopCoder will make sure classSchedule contains between 1 and 20 Strings,

inclusive, all of the form above. The Strings will have between 1 and 50

characters, inclusive. TopCoder will check that the syntax of the Strings are

correct: The Strings will contain a valid class name, followed by a colon,

possibly followed by a series of unique prerequisite classes separated by

single spaces. Also, TopCoder will ensure that each class has at most one

entry in the String[].

 

Examples:

If classSchedule={

"CSE121: CSE110",

"CSE110:",

"MATH122:",

}

The method should return: {"CSE110","CSE121","MATH122"}

 

If classSchedule={

"ENGL111: ENGL110",

"ENGL110: ENGL111"

}

The method should return: {}

 

If classSchedule=[

"ENGL111: ENGL110"

}

The method should return: {}

 

If classSchedule={

"CSE258: CSE244 CSE243 INTR100"

"CSE221: CSE254 INTR100"

"CSE254: CSE111 MATH210 INTR100"

"CSE244: CSE243 MATH210 INTR100"

"MATH210: INTR100"

"CSE101: INTR100"

"CSE111: INTR100"

"ECE201: CSE111 INTR100"

"ECE111: INTR100"

"CSE243: CSE254"

"INTR100:"

}

The method should return:

{"INTR100","CSE101","CSE111","ECE111","ECE201","MATH210","CSE254","CSE221","CSE2

43","CSE244","CSE258"}

 

 

Definition

          

Class:      Prerequisites

Method:   orderClasses

Parameters:     String[]

Returns: String[]

Method signature:   String[] orderClasses(String[] param0)

(be sure your method is public)


------------------------------------------------------------鎴戠殑瑙f硶濡備笅----------------------------------------

鎯蟲硶寰堢畝鍗曪紝榪欓亾棰樻湰璐ㄤ笂鏄竴閬撴帓搴忛棶棰橈紝鎴戜滑鍙渶瑕佸畾涔夊ソ鎺掑簭鐨勯昏緫錛岀劧鍚庡簲鐢ㄥ揩鎺掑氨鍙互浜嗐?br />


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Prerequisites {
    
private static final String[] EMPTY = {};
    Map
<String,Klass> classes = new HashMap<String,Klass>();
    
    
static class Klass implements Comparable<Klass>{
        String name;
        
int number;
        String dept;
        List
<Klass> pres = new ArrayList<Klass>();
        
boolean exist = false;
        
        Klass(String name){
            
this.name = name;
            
int len = name.length();
            
this.number = Integer.parseInt(name.substring(len-3));
            
this.dept =name.substring(0,len-3);
        }
        
        
private boolean isPre(Klass k){
            
if(k==thisreturn false;
            
            
for(Klass p:this.pres){
                
if(k == p || p.isPre(k)) return true;
            }
            
return false;
        }

        @Override
        
public int compareTo(Klass that) {
            
boolean pre = this.isPre(that);
            
boolean sub = that.isPre(this);
            
            
if(pre && sub){
                
throw new RuntimeException("circle detected");
            }
            
else if(pre){
                
return 1;
            }
            
else if(sub){
                
return -1;
            }
            
if(this.number!=that.number) return this.number-that.number;
            
return this.dept.compareTo(that.dept);
        }
    }
    
    
private Klass getClass(String name){
        Klass k 
= classes.get(name);
        
if(k==null){
            k 
= new Klass(name);
            classes.put(name, k);
        }
        
return k;
    }
    
    
public String[] orderClasses(String[] classSchedule){
        classes.clear();
        //parse the input
        
for(String s:classSchedule){
            
int idx = s.indexOf(":");
            String name 
= s.substring(0,idx);
            Klass k 
= getClass(name);
            k.exist 
= true;
            
if(idx!=s.length()-1){
                String[] pres 
= s.substring(idx+1).split(" ");
                
for(String pre:pres){
                    
if(pre.length()>0){
                        Klass p 
= getClass(pre);
                        k.pres.add(p);
                    }
                }
            }
        }
        
        Klass [] sortedClasses 
=  (Klass[]) classes.values().toArray(new Klass[0]);
        
for(Klass k:sortedClasses){
            
if(!k.exist){
                
return EMPTY;
            }
        }
        
try {
            Arrays.sort(sortedClasses);
        } 
catch (Exception e) {
            
return EMPTY;
        }
        String[] result 
= new String[sortedClasses.length];
        
int c = 0;
        
for(Klass k:sortedClasses){
            result[c
++= k.name;
        }
        
return result;
    }
}




灝忔槑 2011-10-25 13:28 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲精品乱码久久久久久蜜桃图片 | 国产免费一区二区视频| 国产亚洲精品欧洲在线观看| 亚洲日韩乱码中文无码蜜桃臀| 亚洲爆乳无码专区| 国产成人亚洲精品青草天美| 亚洲小视频在线观看| 亚洲AV无码日韩AV无码导航| 亚洲国产无套无码av电影| 亚洲区小说区图片区QVOD| 亚洲五月综合缴情在线观看| 91在线亚洲精品专区| 亚洲人成高清在线播放| 亚洲成a人片在线网站| 亚洲A∨精品一区二区三区下载| 亚洲精品无码少妇30P| 亚洲精品无码高潮喷水A片软| 免费人成大片在线观看播放电影| 人成午夜免费大片在线观看| 一区二区视频免费观看| 九九热久久免费视频| 国产永久免费高清在线| 777成影片免费观看| xxxxwww免费| 可以免费看黄视频的网站| 无限动漫网在线观看免费| 午夜时刻免费入口| 免费乱理伦在线播放| 亚洲一级片免费看| 亚洲精品乱码久久久久久按摩| 亚洲成人一级电影| 无套内射无矿码免费看黄| 51精品视频免费国产专区| 在线观看免费人成视频色9| 亚洲一区二区三区在线视频| 亚洲人成影院在线高清| 国产免费一区二区三区免费视频| 99久久综合国产精品免费| 亚洲熟妇中文字幕五十中出| 亚洲色中文字幕在线播放| 日韩一级片免费观看|