锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产一区二区三区精品欧美日韩一区二区三区 ,国产日韩欧美三级,欧美午夜在线观看http://www.shnenglu.com/3144046cjc/archive/2009/07/26/91264.htmlChen JiecaoChen JiecaoSun, 26 Jul 2009 12:19:00 GMThttp://www.shnenglu.com/3144046cjc/archive/2009/07/26/91264.htmlhttp://www.shnenglu.com/3144046cjc/comments/91264.htmlhttp://www.shnenglu.com/3144046cjc/archive/2009/07/26/91264.html#Feedback0http://www.shnenglu.com/3144046cjc/comments/commentRss/91264.htmlhttp://www.shnenglu.com/3144046cjc/services/trackbacks/91264.html1090.  鎴樺湴緇熻緋葷粺(War Field Statistical System)
杈撳叆鏂囦歡鍚嶏細c.in     杈撳嚭鏂囦歡鍚嶏細c.out 鎻愪氦  璁ㄨ  榪愯鐘跺喌 

2050騫達紝浜虹被涓庡鏄熶漢涔嬮棿鐨勬垬浜夊凡瓚嬩簬鐧界儹鍖栥傚氨鍦ㄨ繖鏃訛紝浜虹被鍙戞槑鍑轟竴縐嶈秴綰ф鍣紝榪欑姝﹀櫒鑳藉鍚屾椂瀵圭浉閭葷殑澶氫釜鐩爣榪涜鏀誨嚮銆傚嚒鏄槻寰″姏灝忎簬鎴栫瓑浜? 榪欑姝﹀櫒鏀誨嚮鍔涚殑澶栨槦浜洪伃鍒板畠鐨勬敾鍑伙紝灝變細琚秷鐏傜劧鑰岋紝鎷ユ湁瓚呯駭姝﹀櫒鏄繙榪滀笉澶熺殑錛屼漢浠繕闇瑕佷竴涓垬鍦扮粺璁$郴緇熸椂鍒誨弽棣堝鏄熶漢閮ㄩ槦鐨勪俊鎭傝繖涓壈宸ㄧ殑浠? 鍔¤惤鍦ㄤ綘鐨勮韓涓娿傝浣犲敖蹇璁″嚭榪欐牱涓濂楃郴緇熴?

榪欏緋葷粺闇瑕佸叿澶囪兘澶熷鐞嗗涓?綾諱俊鎭殑鑳藉姏錛?

    1.澶栨槦浜哄悜[x1錛寈2]鍐呯殑姣忎釜浣嶇疆澧炴彺涓鏀槻寰″姏涓簐鐨勯儴闃熴?/p>

    2.浜虹被浣跨敤瓚呯駭姝﹀櫒瀵筟x1錛寈2]鍐呯殑鎵鏈変綅緗繘琛屼竴嬈℃敾鍑誨姏涓簐鐨勬墦鍑匯傜郴緇熼渶瑕佽繑鍥炲湪榪欐鏀誨嚮涓娑堢伃鐨勫鏄熶漢涓暟銆?

娉細闃插盡鍔涗負i鐨勫鏄熶漢閮ㄩ槦鐢眎涓鏄熶漢緇勬垚錛屽叾涓j涓鏄熶漢鐨勯槻寰″姏涓簀銆?/p>

杈撳叆鏍煎紡

浠庢枃浠禼.in絎竴琛岃鍏錛宮銆傚叾涓璶琛ㄧず鏈塶涓綅緗紝m琛ㄧず鏈塵鏉′俊鎭?

浠ヤ笅鏈塵琛岋紝姣忚鏈?涓暣鏁発錛寈1錛寈2錛寁鐢ㄦ潵鎻忚堪涓鏉′俊鎭?銆俴琛ㄧず榪欐潯淇℃伅灞炰簬絎琸綾匯倄1錛寈2錛寁涓虹浉搴斾俊鎭殑鍙傛暟銆俴=1 or 2銆?/p>

娉細浣犲彲浠ヨ涓烘渶鍒濈殑鎵鏈変綅緗兘娌℃湁澶栨槦浜哄瓨鍦ㄣ?/p>

瑙勬ā錛?<n≤1000錛?<x1≤x2≤n錛?<v≤1000錛?<m≤2000

杈撳嚭鏍煎紡

緇撴灉杈撳嚭鍒版枃浠禼.out銆傛寜欏哄簭杈撳嚭闇瑕佽繑鍥炵殑淇℃伅銆?

杈撳叆鏍蜂緥

3 5
1 1 3 4
2 1 2 3
1 1 2 2
1 2 3 1
2 2 3 5

杈撳嚭鏍蜂緥

6
9

鏍蜂緥璇存槑

杈撳叆鏍蜂緥   瀵瑰簲杈撳嚭     杈撳嚭鏍蜂緥
3 5 鏃? 6
1 1 3 4 鏃? 9
2 1 2 3 6
1 1 2 2 鏃?br>1 2 3 1 鏃?br>2 2 3 5 9

棰樼洰鏉ユ簮 錛?a >OIBH 淇℃伅瀛︾粌涔犺禌 #6

棰樼洰鏍囩 錛?

浜岀淮(1)   綰挎鏍?/font>(1)  

榪欎釜棰樼洰鐨勬爣絳炬槸浜岀淮+綰挎鏍?鎴戜及璁℃湁浜涘摜浠湡鐨勭敤浜岀淮綰挎鏍戞潵鍋氫簡,鏌ョ湅浜嗕竴涓嬪悗闈㈢殑浠g爜,鍙戠幇澶у鏁扮殑浜虹殑浠g爜閮借秴榪?k,鏈夌殑榪樿揪鍒皊鍥涗簲k涔嬪.
鎴戠殑鎬濊礬鏄妸榪欎釜棰樼洰杞寲鎴愮煩褰㈠垏鍓叉潵鍋?x,y,v涓変釜鍙傛暟浠ュ強榛樿鐨勪竴涓垵濮嬪間唬琛ㄤ簡涓涓煩褰㈠尯鍩?宸︿笅瑙?x1,y1)=(x,1),鍙充笂瑙?x2,y2)=(y,v);
鍒囧壊鐨勫ぇ浣撴柟娉曟槸浠嶶SACO涓婄殑涓涓鐩鏉ョ殑,綾諱技鏈ㄥ潡涓婃誕,浠庣涓涓煩褰竴鐩存誕鍒版渶涓婇潰鐨勭煩褰?姣忕鍒頒竴涓伄鐩栫殑鐭╁艦灝卞垎瑁傚綋鍓嶇煩褰?鍦ㄤ笂嫻殑榪囩▼涓綆楀嚭姣忔璇㈤棶鐨勭瓟妗?
濡傛灉浣犲鐭╁艦鍒囧壊寰堜簡瑙?鐩鎬俊鎴戠殑浠g爜榪樻槸姣旇緝瀹規槗鐞嗚В鐨?

 1 #include<iostream>
 2 using namespace std;
 3 const int MAXM=3000+100;
 4 struct rect
 5 {
 6   int x1,y1,x2,y2;
 7   rect(){};
 8   rect(int x1,int y1,int x2,int y2) : x1(x1),y1(y1),x2(x2),y2(y2) {}
 9 }temp,q[MAXM];
10 
11 int pos[MAXM],cp=0,ans[MAXM],n,m;
12 bool mark[MAXM];
13 
14 inline bool is_parted(rect& a,rect& b)
15 {
16   return (a.x2<b.x1 || a.x1>b.x2 || a.y2<b.y1 || a.y1>b.y2);
17 
18 
19 void Cut(int p,rect cur)
20 {
21   if (p>cp) return;
22   while ( p<=cp && is_parted(cur,q[pos[p]]) ) ++p;
23   if (p>cp) return;
24   rect ques=q[pos[p]];
25   int area=(cur.y2-cur.y1+1)*(cur.x2-cur.x1+1);
26   if (cur.x1<ques.x1){ 
27     area-=(ques.x1-cur.x1)*(cur.y2-cur.y1+1);
28     rect temp=cur;
29     cur.x1=ques.x1;
30     temp.x2=ques.x1-1;
31     Cut(p+1,temp);
32   }
33   if (cur.x2>ques.x2){
34     area-=(cur.x2-ques.x2)*(cur.y2-cur.y1+1);
35     rect temp=cur;
36     cur.x2=ques.x2;
37     temp.x1=ques.x2+1;
38     Cut(p+1,temp);
39   }
40   if (cur.y2>ques.y2){
41     area-=(cur.y2-ques.y2)*(cur.x2-cur.x1+1);
42     rect temp=cur;
43     cur.y2=ques.y2;
44     temp.y1=ques.y2+1;
45     Cut(p+1,temp);
46   }
47   if (cur.y1<ques.y1){
48     area-=(ques.y1-cur.y1)*(cur.x2-cur.x1+1);
49     rect temp=cur;
50     cur.y1=ques.y1;
51     temp.y2=ques.y1-1;
52     Cut(p+1,temp);
53   }
54   ans[p]+=area;
55 }
56 
57 int main()
58 {
59   freopen("c.in","r",stdin);
60   freopen("c.out","w",stdout);
61   memset(mark,0,sizeof(mark));
62   cin >> n >> m;
63   for (int i=0;i<m;++i){
64     int k,x,y,v;
65     cin >> k >> x >> y >> v;
66     q[i]=rect(x,1,y,v);
67     if (k==2){
68       mark[i]=1;
69       pos[++cp]=i;
70     }
71   }
72 
73   memset(ans,0,sizeof(ans));
74   int p=1;
75   for (int i=0;i<m;++i){
76     if (mark[i]) { ++p; continue; }
77     Cut(p,q[i]);
78   }
79   for (int i=1;i<=cp;++i) cout << ans[i] << endl;
80  
81   return 0;
82 }
83 



Chen Jiecao 2009-07-26 20:19 鍙戣〃璇勮
]]>
TJU_OI 1140 綆遍噷鐨勯挜鍖?/title><link>http://www.shnenglu.com/3144046cjc/archive/2009/07/26/91237.html</link><dc:creator>Chen Jiecao</dc:creator><author>Chen Jiecao</author><pubDate>Sun, 26 Jul 2009 04:43:00 GMT</pubDate><guid>http://www.shnenglu.com/3144046cjc/archive/2009/07/26/91237.html</guid><wfw:comment>http://www.shnenglu.com/3144046cjc/comments/91237.html</wfw:comment><comments>http://www.shnenglu.com/3144046cjc/archive/2009/07/26/91237.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/3144046cjc/comments/commentRss/91237.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/3144046cjc/services/trackbacks/91237.html</trackback:ping><description><![CDATA[<h1>1140.  綆遍噷鐨勯挜鍖?/h1> <div class="hvzpftn" id="pmisc"> <table style="width: 371px; height: 74px;"> <tbody> <tr> <td width="40%"> 杈撳叆鏂囧悕錛歜ox.in  <br> 杈撳嚭鏂囧悕錛歜ox.out </td> <td style="text-align: right;"> <a rel="nofollow" >鎻愪氦</a>  <a rel="nofollow" >璁ㄨ</a>  <a rel="nofollow" >榪愯鐘跺喌</a>  </td> </tr> </tbody> </table> </div> <hr> <p> 鏈塏涓紪鍙蜂負1鍒癗鐨勭瀛愬拰N涓紪鍙蜂負1鍒癗鐨勯挜鍖欙紝絎琲鍙烽挜鍖欏彧鑳界敤鏉ユ墦寮絎琲鍙風瀛愩傜幇鍦ㄦ垜浠殢鏈哄湴灝嗕竴鎶婇挜鍖欓攣榪涗竴涓瀛愰噷錛屽嵆姣忎釜綆卞瓙閲岄兘鎭板ソ鏈? 涓鎶婇挜鍖欙紝淇濊瘉鎵鏈夌殑鎯呭喌閮界瓑鍙兘鎬у湴鍑虹幇銆傜幇鍦ㄤ綘鏈塎涓偢寮癸紝姣忎釜鐐稿脊鍙互鐢ㄦ潵鐐稿紑涓涓瀛愶紝涓鏃︿綘鎶婃煇涓瀛愭墦寮錛屼綘灝卞彲浠ュ彇鍑哄叾涓殑閽ュ寵錛屼粠鑰屾湁鍙? 鑳界敤榪欓挜鍖欐墦寮鏇村鐨勭瀛愩備綘鐨勭瓥鐣ュ緢綆鍗曪紝褰撴病鏈夌瀛愬彲浠ユ墦寮鏃訛紝闅忎究閫変竴涓瀛愶紝鐢ㄧ偢寮圭偢寮瀹冿紝鍙栧嚭閽ュ寵騫剁戶緇墦寮灝藉彲鑳藉鐨勭瀛愶紝鐩磋嚦娌℃湁綆卞瓙鍙互 鎵撳紑錛岀劧鍚庣戶緇嬌鐢ㄤ笅涓棰楃偢寮廣? </p> <p> 鐜扮粰瀹歂錛屼綘鐨勪換鍔℃槸姹傚嚭浣犲彲浠ュ彇寰楁墍鏈夐挜鍖欑殑姒傜巼銆傝繖涓鐜囧繀欏昏緭鍑烘垚鍒嗘暟“A/B”鐨勫艦寮忥紝A鍜孊閮芥槸姝f暣鏁頒笖鍏害鏁板繀欏諱負1銆? </p> <p><strong> 杈撳叆鏍煎紡</strong> </p> <p> 杈撳叆涓琛岋紝鍖呭惈絀烘牸闅斿紑鐨勪袱涓暟N鍜孧 </p> <p><strong> 杈撳嚭鏍煎紡</strong> </p> <p> 杈撳嚭涓篈/B鐨勫艦寮忋? </p> <p><strong> 杈撳叆鏍蜂緥</strong> </p> <pre>3 1<br></pre> <p><strong> 杈撳嚭鏍蜂緥</strong> </p> <pre>1/3<br></pre> <p><strong> 鏁版嵁瑙勬ā涓庣害瀹?/strong> </p> <p> 1 ≤ N ≤ 20, 1 ≤ M ≤ N </p> <span style="color: red;">瑙f瀽</span>:<br>榪欎釜棰樼洰鍩烘湰涓婂氨鏄竴涓暟瀛﹂,娑夊強鍒扮涓綾籹tirling鏁扮殑姹傝В.<br>鎵璋?span style="color: red;">絎竴綾籹tirling鏁?/span>,渚嬪S[n,k]琛ㄧず<span style="color: red;">灝嗕竴涓ぇ灝忎負n鐨勯泦鍚堝垎鎴恔涓儴鍒?姣忎釜閮ㄥ垎鐨勫厓绱犱釜鏁頒笉灝忎簬1,涓斿艦鎴愮幆</span>鐨?span style="color: red;">鎬繪柟娉曟暟</span>.<br>涓涓厓绱犱篃綆椾綔鍗曠嫭鐨勭幆.<br>瀹規槗鐨勫埌<br>    S[1,1]=1;<br>    S[n,0]=0;<br>褰搉<k鏃?S[n,k]=0;<br>瀵瑰悎娉曠殑n,k,婊¤凍: S[n,k]=S[n-1,k-1]+(n-1)*S[n-1,k];<br>鎶妌褰撲綔閽ュ寵(涔熷嵆綆卞瓙)鐨勪釜鏁?k涓洪挜鍖欐墍鏀句綅緗艦鎴愮殑"鐜?,姣忕牬鍧忎竴涓瀛?閮藉彲浠ュ緱鍒拌綆卞瓙鎵灞炵幆鐨勬墍鏈夐挜鍖?k琛ㄧず瀹為檯鐨勭幆鐨勪釜鏁?br>褰搆>m鏃朵究涓嶅彲鑳藉彇寰楀埌鎵鏈夌殑閽ュ寵.<br>榪欐牱涓嬮潰鐨勪唬鐮佸氨寰堝ソ鐞嗚В浜?<br> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #008080;"> 1</span> <span style="color: #000000;">#include</span><span style="color: #000000;"><</span><span style="color: #000000;">iostream</span><span style="color: #000000;">></span><span style="color: #000000;"><br></span><span style="color: #008080;"> 2</span> <span style="color: #000000;"></span><span style="color: #0000ff;">using</span><span style="color: #000000;"> </span><span style="color: #0000ff;">namespace</span><span style="color: #000000;"> std;<br></span><span style="color: #008080;"> 3</span> <span style="color: #000000;"></span><span style="color: #0000ff;">const</span><span style="color: #000000;"> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> MAXN</span><span style="color: #000000;">=</span><span style="color: #000000;">30</span><span style="color: #000000;">;<br></span><span style="color: #008080;"> 4</span> <span style="color: #000000;">template </span><span style="color: #000000;"><</span><span style="color: #0000ff;">class</span><span style="color: #000000;"> T</span><span style="color: #000000;">></span><span style="color: #000000;"><br></span><span style="color: #008080;"> 5</span> <span style="color: #000000;">T Gcd(T a,T b)<br></span><span style="color: #008080;"> 6</span> <span style="color: #000000;">{<br></span><span style="color: #008080;"> 7</span> <span style="color: #000000;">  </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #000000;">a)</span><span style="color: #000000;">?</span><span style="color: #000000;"> b : Gcd(b</span><span style="color: #000000;">%</span><span style="color: #000000;">a,a);<br></span><span style="color: #008080;"> 8</span> <span style="color: #000000;">}<br></span><span style="color: #008080;"> 9</span> <span style="color: #000000;"><br></span><span style="color: #008080;">10</span> <span style="color: #000000;"></span><span style="color: #0000ff;">int</span><span style="color: #000000;"> main()<br></span><span style="color: #008080;">11</span> <span style="color: #000000;">{<br></span><span style="color: #008080;">12</span> <span style="color: #000000;">  freopen(</span><span style="color: #000000;">"</span><span style="color: #000000;">box.in</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">r</span><span style="color: #000000;">"</span><span style="color: #000000;">,stdin);<br></span><span style="color: #008080;">13</span> <span style="color: #000000;">  freopen(</span><span style="color: #000000;">"</span><span style="color: #000000;">box.out</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">"</span><span style="color: #000000;">w</span><span style="color: #000000;">"</span><span style="color: #000000;">,stdout);<br></span><span style="color: #008080;">14</span> <span style="color: #000000;">  </span><span style="color: #0000ff;">long</span><span style="color: #000000;"> </span><span style="color: #0000ff;">long</span><span style="color: #000000;"> n,m,S[MAXN][MAXN];<br></span><span style="color: #008080;">15</span> <span style="color: #000000;">  cin </span><span style="color: #000000;">>></span><span style="color: #000000;"> n </span><span style="color: #000000;">>></span><span style="color: #000000;"> m;<br></span><span style="color: #008080;">16</span> <span style="color: #000000;">  memset(S,</span><span style="color: #000000;">0</span><span style="color: #000000;">,</span><span style="color: #0000ff;">sizeof</span><span style="color: #000000;">(S));<br></span><span style="color: #008080;">17</span> <span style="color: #000000;">  S[</span><span style="color: #000000;">1</span><span style="color: #000000;">][</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">18</span> <span style="color: #000000;">  </span><span style="color: #0000ff;">for</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">2</span><span style="color: #000000;">;i</span><span style="color: #000000;"><=</span><span style="color: #000000;">n;</span><span style="color: #000000;">++</span><span style="color: #000000;">i)<br></span><span style="color: #008080;">19</span> <span style="color: #000000;">    </span><span style="color: #0000ff;">for</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> j</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;j</span><span style="color: #000000;"><=</span><span style="color: #000000;">i;</span><span style="color: #000000;">++</span><span style="color: #000000;">j)<br></span><span style="color: #008080;">20</span> <span style="color: #000000;">      S[i][j]</span><span style="color: #000000;">=</span><span style="color: #000000;">S[i</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">][j</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">+</span><span style="color: #000000;">(i</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">*</span><span style="color: #000000;">S[i</span><span style="color: #000000;">-</span><span style="color: #000000;">1</span><span style="color: #000000;">][j];<br></span><span style="color: #008080;">21</span> <span style="color: #000000;">  </span><span style="color: #0000ff;">long</span><span style="color: #000000;"> </span><span style="color: #0000ff;">long</span><span style="color: #000000;"> B</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br></span><span style="color: #008080;">22</span> <span style="color: #000000;">  </span><span style="color: #0000ff;">for</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">2</span><span style="color: #000000;">;i</span><span style="color: #000000;"><=</span><span style="color: #000000;">n;</span><span style="color: #000000;">++</span><span style="color: #000000;">i) B</span><span style="color: #000000;">*=</span><span style="color: #000000;">i;<br></span><span style="color: #008080;">23</span> <span style="color: #000000;">  </span><span style="color: #0000ff;">long</span><span style="color: #000000;"> </span><span style="color: #0000ff;">long</span><span style="color: #000000;"> A</span><span style="color: #000000;">=</span><span style="color: #000000;">B;<br></span><span style="color: #008080;">24</span> <span style="color: #000000;">  </span><span style="color: #0000ff;">for</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">m</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;">;i</span><span style="color: #000000;"><=</span><span style="color: #000000;">n;</span><span style="color: #000000;">++</span><span style="color: #000000;">i) A</span><span style="color: #000000;">-=</span><span style="color: #000000;">S[n][i];<br></span><span style="color: #008080;">25</span> <span style="color: #000000;">  </span><span style="color: #0000ff;">long</span><span style="color: #000000;"> </span><span style="color: #0000ff;">long</span><span style="color: #000000;"> G</span><span style="color: #000000;">=</span><span style="color: #000000;">Gcd(A,B);<br></span><span style="color: #008080;">26</span> <span style="color: #000000;">  cout </span><span style="color: #000000;"><<</span><span style="color: #000000;"> A</span><span style="color: #000000;">/</span><span style="color: #000000;">G </span><span style="color: #000000;"><<</span><span style="color: #000000;"> </span><span style="color: #000000;">'</span><span style="color: #000000;">/</span><span style="color: #000000;">'</span><span style="color: #000000;"> </span><span style="color: #000000;"><<</span><span style="color: #000000;"> B</span><span style="color: #000000;">/</span><span style="color: #000000;">G </span><span style="color: #000000;"><<</span><span style="color: #000000;"> endl;<br></span><span style="color: #008080;">27</span> <span style="color: #000000;">  </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">;<br></span><span style="color: #008080;">28</span> <span style="color: #000000;">}<br></span><span style="color: #008080;">29</span> <span style="color: #000000;"></span></div> <br> <img src ="http://www.shnenglu.com/3144046cjc/aggbug/91237.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/3144046cjc/" target="_blank">Chen Jiecao</a> 2009-07-26 12:43 <a href="http://www.shnenglu.com/3144046cjc/archive/2009/07/26/91237.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>TJU_OI 1094 鐝嶇彔欏歸摼http://www.shnenglu.com/3144046cjc/archive/2009/07/22/90832.htmlChen JiecaoChen JiecaoWed, 22 Jul 2009 07:15:00 GMThttp://www.shnenglu.com/3144046cjc/archive/2009/07/22/90832.htmlhttp://www.shnenglu.com/3144046cjc/comments/90832.htmlhttp://www.shnenglu.com/3144046cjc/archive/2009/07/22/90832.html#Feedback0http://www.shnenglu.com/3144046cjc/comments/commentRss/90832.htmlhttp://www.shnenglu.com/3144046cjc/services/trackbacks/90832.html

1094.  鐝嶇彔欏歸摼

杈撳叆鏂囦歡鍚嶏細necklace.in    
杈撳嚭鏂囦歡鍚嶏細necklace.out
鎻愪氦  璁ㄨ  榪愯鐘跺喌 

鏈変竴涓茬敱n涓弽鐝犵粍鎴愮殑鐝嶇彔欏歸摼錛岀弽鐝犵殑緙栧彿涓?..n錛屾瘡涓弽鐝犻兘鏈夊悇鑷殑浠峰鹼紝鎴戜滑鐢╳[i]琛ㄧず緙栧彿涓篿鐨勭弽鐝犵殑浠峰鹼紙娉ㄦ剰錛歸[i]鍙互灝忎簬 闆訛級錛屽凡鐭ヨ繖n涓弽鐝犵殑浠峰奸噺鎬誨拰鏄痭-1,鐜拌姹備綘鍦ㄩ」閾劇殑鏌愪釜浣嶇疆鏂紑錛屼嬌寰楁柇寮鍚庣殑鐝嶇彔閾炬弧瓚沖浜庝換鎰弅,鍓峩涓弽鐝犵殑浠峰奸噺鎬誨拰涓嶈秴榪噆-1. (瀵規柇寮鐨勪竴鐐硅鏄? 濡傛灉鍦ㄤ綅緗畃鏂紑, 閭d箞寰楀埌鐨勭弽鐝犻摼灝嗕竴瀹氭槸p,p+1,...,n,1,2,...,p-1)

杈撳叆鏍煎紡

杈撳叆鏂囦歡鐨勭涓琛屾湁涓涓敮涓鐨勬暣鏁皀,

鎺ヤ笅鏉涓敤絀烘牸鍜屾崲琛岀闅斿紑鐨勬暣鏁板垎鍒〃紺簑[1],w[2],...,w[n]

杈撳嚭鏍煎紡

濡傛灉鏃犺В璇瘋緭鍑轟竴琛?Impossible"錛堜笉鍚紩鍙鳳級鍚﹀垯杈撳嚭涓涓暣鏁拌〃紺烘柇寮鍚庣殑鐝嶇彔閾劇涓涓弽鐝犵殑緙栧彿

杈撳叆鏍蜂緥

5
1 1 1 1 0

杈撳嚭鏍蜂緥

5

鏁版嵁瑙勬ā涓庣害瀹?/strong>

3≤n≤200,000 -1,000,000,000≤w[i]≤1,000,000,000

40%鐨勬祴璇曟暟鎹弧瓚硁≤1,000

棰樼洰鏉ユ簮 錛?a >OIBH 淇℃伅瀛︾粌涔犺禌 #8


浠g爜:
 1 #include<iostream>
 2 using namespace std;
 3 const int MAXN=200000+100;
 4 long long n,w[MAXN<<1];
 5 int main()
 6 {
 7   freopen("necklace.in","r",stdin);
 8   freopen("necklace.out","w",stdout);
 9   cin >> n;
10   for (int i=0;i<n;++i) cin >> w[i],w[i+n]=w[i];
11   long long len=0,tot=0;;
12   for (int i=0;i<n*2;++i)
13     {
14       if (tot+w[i]<=len) tot+=w[i],++len;
15       else
16     { tot=0; len=0; }
17       if (len==n) { cout << i-len+2 << endl; return 0; }
18     }
19   cout << "Impossible\n";
20   return 0;
21 }
22  
23 
鍩烘湰涓?灝辨槸鏋氫婦鐝嶇彔,濡傛灉鏌愪釜鐝嶇彔鍙互浣滀負絎竴棰楃弽鐝?閭d箞鎺ョ潃鎶婂畠鐨勪笅涓棰楀綋浣滅浜岄,濡傛灉鍚堟硶,緇х畫涓嬩竴棰?濡傛灉涓嶅悎娉?鐩存帴鎶婂綋鍓嶄笉鍚堟硶鐨勮繖涓棰楃殑涓嬩竴棰楀綋浣滅涓棰楃戶緇灇涓?
涓轟粈涔堟尅褰撳墠鐨勮繖棰楃弽鐝犲湪榪欎釜浣嶇疆涓嶈,灝變笉鐢ㄥ湪鍒殑浣嶇疆灝濊瘯鍛?榪欐槸鍥犱負涓鏃︽煇棰楃弽鐝犱綔涓烘柇鎺変箣鍚庣殑閾劇k棰椾笉鍚堟硶鐨勮瘽,瀹冧篃涓瀹氫笉鍙兘鍦ㄥ綋浣滅1銆佺2........鎴栫k-1棰楁椂鍚堟硶,鐣ヨ瘉濡備笅:
鑻[1],A[2],A[3]......A[k-1] 浣滀負鍓?k-1)棰楃弽鐝犲悎娉?...............................................................................(1)
鑰孉[1]+A[2]+A[3]+......+A[k]>k-1   涓嶅悎娉?..........................................................................................(2)
閭d箞鎴戜滑鏈?br>A[t+1]+A[t+1]+......+A[k]>k-1-(A[1]+A[2]+......+A[t])       (1<=t<k).............................................(3)
(1)==> A[1]+A[2]+.......A[t]<=t-1
鎵浠ョ敱(3)鐭?A[t+1]+A[t+2]+......A[k]>k-1-(t-1)=k-t...........................................................................(4)
鑰岃鎯蟲妸A[t+1],A[t+2],.......A[k]褰撲綔絎?,2,.........(k-t)棰楃弽鐝犱笖鍚堟硶,蹇呴』鏈?br>A[t+1]+A[t+2]+.......A[k]<=k-t-1  (鏈塳-t棰楃彔瀛?..................................................................................(5)
(4),(5)鐭涚浘,鎵浠ョ孩鑹查儴鍒嗗緱璇?



]]>
URAL 1022 Genealogical treehttp://www.shnenglu.com/3144046cjc/archive/2009/07/21/90748.htmlChen JiecaoChen JiecaoTue, 21 Jul 2009 09:14:00 GMThttp://www.shnenglu.com/3144046cjc/archive/2009/07/21/90748.htmlhttp://www.shnenglu.com/3144046cjc/comments/90748.htmlhttp://www.shnenglu.com/3144046cjc/archive/2009/07/21/90748.html#Feedback0http://www.shnenglu.com/3144046cjc/comments/commentRss/90748.htmlhttp://www.shnenglu.com/3144046cjc/services/trackbacks/90748.html
 1 /* 鎷撴墤鎺掑簭 */
 2 
 3 #include<iostream>
 4 #include<vector>
 5 using namespace std;
 6 const int MAXN=120;
 7 vector<int> adj[MAXN];
 8 
 9 int into[MAXN];
10 
11 int main()
12 {
13   //freopen("data.in","r",stdin);
14   //freopen("data.out","w",stdout);
15   int n;
16   memset(into,0,sizeof(into));
17   cin >> n;
18   for (int i=1;i<=n;++i)
19     {
20       int x;
21       cin >> x;
22       while (x!=0
23     {
24       adj[i].push_back(x);
25       ++into[x];
26       cin >> x;
27     }
28     }
29  //for (int i=1;i<=n;++i) cout << into[i] << ' '; cout << endl;
30   bool everp=0;
31   for (int k=0;k<n;++k)
32     {
33       int i=1;
34       for (;i<=n;i++if (!into[i]) break;
35       (everp) ? cout << ' ' << i : cout << i;
36       everp=1;
37       --into[i];
38       for (int j=0;j<adj[i].size();++j) --into[ adj[i][j] ];
39     }
40   cout << endl;
41   return 0;
42 }
43 




]]>
URAL 1021 Sacrament of the sumhttp://www.shnenglu.com/3144046cjc/archive/2009/07/21/90747.htmlChen JiecaoChen JiecaoTue, 21 Jul 2009 09:12:00 GMThttp://www.shnenglu.com/3144046cjc/archive/2009/07/21/90747.htmlhttp://www.shnenglu.com/3144046cjc/comments/90747.htmlhttp://www.shnenglu.com/3144046cjc/archive/2009/07/21/90747.html#Feedback0http://www.shnenglu.com/3144046cjc/comments/commentRss/90747.htmlhttp://www.shnenglu.com/3144046cjc/services/trackbacks/90747.html
 1 #include<iostream>
 2 using namespace std;
 3 const int MAXN=50005;
 4 
 5 
 6 int main()
 7 {
 8   freopen("data.in","r",stdin);
 9   freopen("data.out","w",stdout);
10   int c,cc,num[MAXN];
11   cin >> c;
12   for (int i=0;i<c;++i) cin >> num[i];
13   num[c]=31440461;
14   cin >> cc;
15   int p=0;
16   for (int i=0;i<cc;++i)
17     {
18       int x;
19       cin >> x;
20       while (x+num[p]<10000++p;
21       if (x+num[p]==10000) { cout << "YES\n"return 0; }
22     }
23   cout << "NO\n";
24   return 0;
25 }
26 




]]>
URAL 1020 Ropehttp://www.shnenglu.com/3144046cjc/archive/2009/07/20/90636.htmlChen JiecaoChen JiecaoMon, 20 Jul 2009 08:49:00 GMThttp://www.shnenglu.com/3144046cjc/archive/2009/07/20/90636.htmlhttp://www.shnenglu.com/3144046cjc/comments/90636.htmlhttp://www.shnenglu.com/3144046cjc/archive/2009/07/20/90636.html#Feedback0http://www.shnenglu.com/3144046cjc/comments/commentRss/90636.htmlhttp://www.shnenglu.com/3144046cjc/services/trackbacks/90636.html
 1 #include<iostream>
 2 #include<math.h>
 3 using namespace std;
 4 const double PI=3.1415926;
 5 
 6 template <class T>
 7 T dis(T x1,T y1,T x2,T y2)
 8 {
 9   return sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
10 }
11 int main()
12 {
13   int n;
14   double r,len=0;
15   //freopen("data.in","r",stdin);
16   //freopen("data.out","w",stdout);
17   cin >> n >> r;
18   double x0,y0,x,y;
19   cin >> x0 >> y0;
20   double px=x0,py=y0;
21 if (n==1goto L1;
22   for (int i=1;i<n;++i)
23     {
24       cin >> x >> y;
25       len+=dis(px,py,x,y);
26       px=x;
27       py=y;
28     }
29   len+=dis(x,y,x0,y0);
30 L1:  len+= 2*PI*r ;
31   printf("%.2f\n",len);
32   return 0;
33 }
34 




]]>
URAL 1019 A line paintinghttp://www.shnenglu.com/3144046cjc/archive/2009/07/20/90624.htmlChen JiecaoChen JiecaoMon, 20 Jul 2009 07:00:00 GMThttp://www.shnenglu.com/3144046cjc/archive/2009/07/20/90624.htmlhttp://www.shnenglu.com/3144046cjc/comments/90624.htmlhttp://www.shnenglu.com/3144046cjc/archive/2009/07/20/90624.html#Feedback0http://www.shnenglu.com/3144046cjc/comments/commentRss/90624.htmlhttp://www.shnenglu.com/3144046cjc/services/trackbacks/90624.htmlA Line painting
Time Limit: 2.0 second
Memory Limit: 16 MB
The segment of numerical axis from 0 to 109 is painted into white color. After that some parts of this segment are painted into black, then some into white again and so on. In total there have been made N re-paintings (1 ≤ N ≤ 5000). You are to write a program that finds the longest white open interval after this sequence of re-paintings.

Input

The first line of input contains the only number N. Next N lines contain information about re-paintings. Each of these lines has a form:
ai bi ci
where ai and bi are integers, ci is symbol 'b' or 'w', ai, bi, ci are separated by spaces.
This triple of parameters represents repainting of segment from ai to bi into color ci ('w' 鈥?white, 'b' 鈥?black). You may assume that 0 < ai < bi < 109.

Output

Output should contain two numbers x and y (x < y) divided by space(s). These numbers should define the longest white open interval. If there are more than one such an interval output should contain the one with the smallest x.

Sample

input output
4
1 999999997 b
40 300 w
300 634 w
43 47 b
47 634                                                        
榪欎釜棰樼洰鏈鐩存帴鐨勫姙娉曟槸紱繪暎鍖?紱繪暎鍖栦簡涔嬪悗灝卞ソ鎶樿吘浜?鍥犱負鎿嶄綔鎸囦護寰堝皯,鎵浠ユ垜閫夋嫨紱繪暎+鏈寸礌鏌撹壊.
澶嶆潅搴︿笂鐣屼負O(M*M),榪欓噷M琛ㄧず紱繪暎鍖栧悗寰楀埌鐨勫尯闂翠釜鏁?

 1 #include<iostream>
 2 #include<algorithm>
 3 using namespace std;
 4 const int MAXN=10005;
 5 const int MAXL=1000000000;
 6 struct re
 7 {
 8   int a,b;
 9   char c;
10 }op[MAXN];
11 
12 int n,p=0,que[MAXN];
13 bool color[MAXN<<1];
14 
15 /* 浜屽垎鏌ユ壘 */
16 int find(int num)
17 {
18   int l=0,r=p+1,mid;
19   while (r-l>1)
20     {
21       mid=(l+r) >> 1;
22       (que[mid]<=num)? l=mid : r=mid;
23       if (que[l]==num) return l;
24     }
25   return l;
26 }
27 
28 void disp(re& op)
29 {
30   /* 鍖洪棿鐢?寮濮嬫暟,鑰屼笉鏄敱0寮濮?nbsp;*/
31   op.a=find(op.a)+1;
32   op.b=find(op.b);
33 }
34 
35 void mark(int l,int r,char c)
36 {
37   for (int i=l;i<=r;++i) color[i]=(c=='b');
38 }
39 
40 int main()
41 {
42  // freopen("data.in","r",stdin);
43  // freopen("data.out","w",stdout);
44   cin >> n;
45   for (int i=0;i<n;++i)
46     {
47       cin >> op[i].a >> op[i].b >> op[i].c;
48       que[++p]=op[i].a;
49       que[++p]=op[i].b;
50     }
51   que[++p]=MAXL;
52   /* 鍒犻櫎閲嶅鍑虹幇鐨勬暟瀛?nbsp;*/
53   int rp=0;
54   for (int i=1;i<=p;++i)
55     if (que[rp]!=que[i]) que[++rp]=que[i];
56   p=rp;
57   /* 鎺掑簭,渚夸簬瀹氫綅鍜岀鏁e寲 */
58   sort(que,que+p+1);
59   que[p+1]=MAXL+1;
60   /* 瀵規搷浣滆繘琛岀鏁e鐞?nbsp;*/
61   for (int i=0;i<n;++i) disp(op[i]);
62   /* 澶勭悊鎿嶄綔搴忓垪 */
63   memset(color,0,sizeof(color));
64   for (int i=0;i<n;++i) mark(op[i].a,op[i].b,op[i].c);
65   int t=1,a,b,mlen=0;
66   for (int i=2;i<=p+1;++i)
67     if (color[i]!=color[t] || i>p)
68       { 
69     if ((!color[t]) && (que[i-1]-que[t-1]>mlen)) { a=que[t-1];b=que[i-1];mlen=que[i-1]-que[t-1];}
70     t=i;
71       }
72   cout << a << ' ' << b << endl;
73   //system("pause");
74   return 0;
75 }
76 
涓埆鐩爣榪滃ぇ鐨勫悓瀛﹀彲鑳藉茍涓嶄粎浠呮槸鎯寵В鍐寵繖涓鐩?榪欐椂鍊欏緩璁綘浣跨敤紱繪暎鍖?綰挎鏍?澶嶆潅搴︿細澶уぇ鍦伴檷浣?br>

]]>
URAL 1018 A Binary Apple Treehttp://www.shnenglu.com/3144046cjc/archive/2009/07/19/90553.htmlChen JiecaoChen JiecaoSun, 19 Jul 2009 15:02:00 GMThttp://www.shnenglu.com/3144046cjc/archive/2009/07/19/90553.htmlhttp://www.shnenglu.com/3144046cjc/comments/90553.htmlhttp://www.shnenglu.com/3144046cjc/archive/2009/07/19/90553.html#Feedback0http://www.shnenglu.com/3144046cjc/comments/commentRss/90553.htmlhttp://www.shnenglu.com/3144046cjc/services/trackbacks/90553.html

A Binary Apple Tree


Time Limit: 1.0 second
Memory Limit: 16 MB
Let's imagine how apple tree looks in binary computer world. You're right, it looks just like a binary tree, i.e. any biparous branch splits up to exactly two new branches. We will enumerate by natural numbers the root of binary apple tree, points of branching and the ends of twigs. This way we may distinguish different branches by their ending points. We will assume that root of tree always is numbered by 1 and all numbers used for enumerating are numbered in range from 1 to N, where N is the total number of all enumerated points. For instance in the picture below N is equal to 5. Here is an example of an enumerated tree with four branches:
2   5
\ /
3 4
\ /
1
As you may know it's not convenient to pick an apples from a tree when there are too much of branches. That's why some of them should be removed from a tree. But you are interested in removing branches in the way of minimal loss of apples. So your are given amounts of apples on a branches and amount of branches that should be preserved. Your task is to determine how many apples can remain on a tree after removing of excessive branches.

Input

First line of input contains two numbers: N and Q (1 ≤ QN; 1 < N ≤ 100). N denotes the number of enumerated points in a tree. Q denotes amount of branches that should be preserved. Next N−1 lines contains descriptions of branches. Each description consists of a three integer numbers divided by spaces. The first two of them define branch by it's ending points. The third number defines the number of apples on this branch. You may assume that no branch contains more than 30000 apples.

Output

Output should contain the only number 鈥?amount of apples that can be preserved. And don't forget to preserve tree's root ;-)

Sample

input output
5 2
1 3 1
1 4 10
2 3 20
3 5 20
                                 21

綆鏋?
      榪欐槸涓涓畝鍗曠殑鏍戝艦鍔ㄦ佽鍒掗棶棰?澶ф鍙互鎷挎潵褰撹繖綾婚鐩殑鍏ラ棬璁粌棰?铏界劧榪欐槸URAL涓婄殑絎竴涓爲褰P,浣嗘槸鎴戝鎬殑鏄畠鐨勯氳繃鐜囧茍涓嶅緢楂?
      瀵逛簬鍘熼鐩殑鍥懼艦,鐢ㄦ暟緇剉alue[a][b]琛ㄧずa,b鐐歸棿鑻規灉鐨勪釜鏁?鐢╪d[p].L,nd[p].R鍒嗗埆琛ㄧず鑺傜偣p鐨勫乏鍙沖効瀛?閫氳繃build_tree(1)鑾峰緱鏁扮粍nd[],浠庤岃幏寰楁暣媯墊爲鐨勪俊鎭?
鎺ョ潃,鐢╝ns[p][i]琛ㄧず浠ヨ妭鐐筽涓虹瀹楃殑瀛愭爲,淇濈暀鐨勬灊鏉′笉瓚呰繃i鏉℃椂鎵鑳戒繚鐣欑殑鏈澶氱殑鑻規灉,鐘舵佽漿縐繪湁涓涓嬪嚑縐嶆儏鍐?
鍦ㄩ櫎鍘誨浣欐灊鏉$殑鍚庣殑鍥句腑,
1.  p鍙笌涓涓効瀛愮浉榪?
    ans[p][i]=max(ans[left_son][i-1]+value[left_son][p],ans[right_son][i-1]+value[right_son][p]);
2.  p涓庝袱涓効瀛愮浉榪?
    for (int j=0;j<=i-2;++j)
      ans[p][i]=max(ans[p][i],ans[left_son][j]+ans[right_son][i-j-2]+d); 
    榪欓噷,d=value[left_son][p]+value[right_son][p];

綆楁硶鍦╫(N*Q*Q)綰у埆
 1 #include<iostream>
 2 using namespace std;
 3 const int MAXN=102;
 4 int n,q,value[MAXN][MAXN],ans[MAXN][MAXN];
 5 struct node
 6 {
 7   int l,r;
 8 }nd[MAXN];
 9 
10 void build_tree(int p)
11 {
12   int flg=0;
13   for (int i=1;i<=n;++i)
14     if (value[p][i] && (!nd[i].l))
15       {
16     flg=1;
17     if (nd[p].l==0) nd[p].l=i;
18     else
19       {nd[p].r=i; break;}
20       }
21   if (!flg) return;
22   if (nd[p].l) build_tree(nd[p].l);
23   if (nd[p].r) build_tree(nd[p].r);
24 }
25 
26 void calc(int p)
27 {
28   if (!nd[p].l) return;
29   int l=nd[p].l,r=nd[p].r;
30   calc(l);
31   calc(r);
32   ans[p][1]=max(value[l][p],value[r][p]);
33 
34   int d=value[l][p]+value[r][p];
35   for (int i=2;i<=q;++i)
36   {  
37     ans[p][i]=max(ans[l][i-1]+value[l][p],ans[r][i-1]+value[r][p]);
38     for (int j=0;j<=i-2;++j)
39       ans[p][i]=max(ans[p][i],ans[l][j]+ans[r][i-j-2]+d);
40   }
41 }
42 
43 
44 int main()
45 {
46   //freopen("data.in","r",stdin);
47   //freopen("data.out","w",stdout);
48   cin >> n >> q;
49   memset(value,0,sizeof(value));
50   for (int i=1;i<n;++i)
51     {
52       int a,b,c;
53       cin >> a >> b >> c;
54       value[a][b]=c;
55       value[b][a]=c;
56     }
57   memset(nd,0,sizeof(nd));
58   build_tree(1);
59   calc(1);
60   cout << ans[1][q] << endl;
61   return 0;
62 }
63 





]]>
娌℃湁鍐欎笅鍘葷殑嬈叉湜浜?/title><link>http://www.shnenglu.com/3144046cjc/archive/2009/07/18/90437.html</link><dc:creator>Chen Jiecao</dc:creator><author>Chen Jiecao</author><pubDate>Sat, 18 Jul 2009 08:38:00 GMT</pubDate><guid>http://www.shnenglu.com/3144046cjc/archive/2009/07/18/90437.html</guid><wfw:comment>http://www.shnenglu.com/3144046cjc/comments/90437.html</wfw:comment><comments>http://www.shnenglu.com/3144046cjc/archive/2009/07/18/90437.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/3144046cjc/comments/commentRss/90437.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/3144046cjc/services/trackbacks/90437.html</trackback:ping><description><![CDATA[       C++,鍐欏啓OI鐨勪笢瑗跨幇鍦ㄦ槸澶熶簡,涔熺湅浜嗕竴浜涗功,姣斿 Essential C++, Accelerate C++,鎴戠殑鐩殑鍊掍篃涓嶆槸鎯寵揪鍒頒粈涔堥珮搴?鍍廡emplate,鍩烘湰鑳界敤灝辮,綾諱篃鍙鏈夌偣姒傚康,鑳界湅鎳傚氨澶熶簡.鑰屽湪USACO涓婂仛榪欎簺宸茬粡鍋氳繃鐨勯鐩灝戞樉寰椾箯鍛?鍐嶈?鐢變簬鑴戝瓙閲岀暀鐫瀵瑰師鏉ョ畻娉曠殑鍗拌薄,鎴戠殑娼滄剰璇嗘繪槸寮曞鎴戠洿鎺ラ粯鍐?榪欐牱鐨刢oding緇濆綆椾笉涓婁竴縐嶄韓鍙?<br>      鎵浠ユ垜鎵撶畻鎸戝嚑涓鐩仛鍋?鑰屼笉蹇呮満姊板紡鍦伴噸澶?涔熷彲浠ュ幓USACO涓婃壘浜涘巻嬈℃湀璧涚殑棰樼洰,閲戠墝緇勭殑閭d簺榪樻槸鏈夌偣鎰忔濈殑,寰堝瑕佹眰瀵歸珮綰ф暟鎹粨鏋勮繘琛屾敼閫?鎴戜互鍓嶅仛浜嗗嚑涓鐩?鎰熻鏀惰幏鏋佷赴瀵?閾剁墝緇勭殑涔熻繕姣旇緝鏈夎叮.<br>      鎴戠殑鑰愭х湡鐨勪笉鎬庝箞鏍?Vijos涓婂仛浜?9棰?TJU鐨勭綉绔欎笂鍋氫簡鍑犲崄棰?URAL涓婂仛浜嗗嚑鍗侀,PKU鍋氳繃涓鐐?SPOJ涔熺帺榪囦竴涓?榪為儹浣沖疂鍚屽織鐨凮J涓婁篃鍒囦簡涓浜涢鐩?鑺辨牱寰堝,鍙槸娌℃湁涓涓搴撲笂涓鐧鵑鐨?鑰愭т笉澶?涔熸槸紼嬪簭鍛樼殑澶у繉.   <br>     鎵璋揢SACO,閲嶈蛋闀垮緛璺?鐪嬫潵鏄褰撻冨叺浜?鎴栬?綆楁槸韙╅珮璺?Accelerate?<br><br><img src ="http://www.shnenglu.com/3144046cjc/aggbug/90437.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/3144046cjc/" target="_blank">Chen Jiecao</a> 2009-07-18 16:38 <a href="http://www.shnenglu.com/3144046cjc/archive/2009/07/18/90437.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>USACO 1.5.1 Number Triangleshttp://www.shnenglu.com/3144046cjc/archive/2009/07/17/90312.htmlChen JiecaoChen JiecaoFri, 17 Jul 2009 03:18:00 GMThttp://www.shnenglu.com/3144046cjc/archive/2009/07/17/90312.htmlhttp://www.shnenglu.com/3144046cjc/comments/90312.htmlhttp://www.shnenglu.com/3144046cjc/archive/2009/07/17/90312.html#Feedback0http://www.shnenglu.com/3144046cjc/comments/commentRss/90312.htmlhttp://www.shnenglu.com/3144046cjc/services/trackbacks/90312.html
 1 /*
 2 ID: 31440461
 3 LANG: C++
 4 TASK: numtri
 5 */
 6 #include<iostream>
 7 using namespace std;
 8 const int MAXN=1000+10;
 9 int data[2][MAXN];
10 
11 int main()
12 {
13   freopen("numtri.in","r",stdin);
14   freopen("numtri.out","w",stdout);
15   int n,flg=0;
16   cin >> n;
17   for (int i=1;i<=n;++i)
18     {
19       flg=1-flg;
20       for (int j=1;j<=i;++j)
21     {
22       int x;
23       cin >> x;
24       data[flg][j]=max(data[!flg][j-1],data[!flg][j])+x;
25     }
26     }
27   int m=0;
28   for (int i=1;i<=n;++i) m=max(m,data[flg][i]);
29   cout << m << endl;
30   return 0;
31 
32 




]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              正在播放欧美视频| 欧美一区二区在线播放| 日韩视频在线免费| 亚洲精品视频一区| 一本大道久久a久久综合婷婷 | 亚洲欧美日韩网| 一区二区三区导航| 亚洲免费视频中文字幕| 亚洲综合另类| 欧美一区国产二区| 久久久午夜精品| 欧美国产高潮xxxx1819| 亚洲激情成人网| 日韩视频久久| 亚洲欧美日韩一区在线| 久久久久久久久久久成人| 免费观看成人网| 欧美精品一区在线观看| 国产精品免费观看在线| 国内精品久久久久影院薰衣草| 在线免费观看成人网| 日韩午夜在线| 欧美怡红院视频| 媚黑女一区二区| 91久久香蕉国产日韩欧美9色| 一区二区三区免费看| 欧美中文字幕视频在线观看| 免费欧美网站| 国产精品性做久久久久久| 狠狠久久婷婷| 一本色道久久综合亚洲精品按摩| 欧美一区二区三区男人的天堂| 免费久久99精品国产自| 日韩一级黄色片| 久久精品成人一区二区三区| 欧美超级免费视 在线| 国产精品二区在线观看| 在线欧美小视频| 亚洲午夜免费视频| 六月婷婷一区| 亚洲无吗在线| 男同欧美伦乱| 国产麻豆成人精品| 亚洲理论在线| 久久婷婷麻豆| 中文av一区特黄| 麻豆久久婷婷| 国产欧美日韩免费| 一区二区电影免费在线观看| 久久精品成人一区二区三区| 亚洲激情社区| 久久激情五月丁香伊人| 欧美午夜宅男影院在线观看| 1204国产成人精品视频| 午夜在线一区二区| 亚洲国产一区在线| 久久久久成人网| 国产精品一区二区久久久久| 亚洲理伦电影| 免费永久网站黄欧美| 亚洲欧美日韩国产综合在线| 欧美日韩国产色综合一二三四| 又紧又大又爽精品一区二区| 午夜亚洲伦理| 一区二区成人精品| 欧美激情第五页| 亚洲国产高清高潮精品美女| 欧美专区在线| 亚洲一区二区精品视频| 欧美日韩国产不卡在线看| 亚洲国产精品一区制服丝袜| 久久精品av麻豆的观看方式| 亚洲视频精品| 欧美日韩天堂| 一本一道久久综合狠狠老精东影业| 猛男gaygay欧美视频| 欧美在线在线| 国产一区二区三区久久悠悠色av| 亚洲欧美日韩综合aⅴ视频| 99视频超级精品| 欧美人成网站| 一区二区高清在线| 亚洲精品在线免费| 欧美夫妇交换俱乐部在线观看| 在线免费观看视频一区| 久久久久久久激情视频| 午夜精品久久久久久99热软件| 国产精品乱看| 亚洲一区日韩在线| 在线视频亚洲| 国产精品黄色| 性欧美video另类hd性玩具| 亚洲午夜黄色| 国产精品亚洲综合久久| 欧美影院一区| 欧美一级黄色网| 激情久久五月天| 美女诱惑一区| 麻豆久久精品| 亚洲免费电影在线| 日韩视频久久| 国产精品久久久免费| 欧美一区亚洲二区| 欧美在线91| 黄色一区二区在线| 欧美国产第一页| 欧美激情第3页| 亚洲私人影吧| 亚洲一区二区久久| 国产在线一区二区三区四区 | 亚洲人妖在线| 欧美婷婷久久| 久久成人综合网| 久久精品国产成人| 91久久一区二区| 一级成人国产| 国产午夜精品视频免费不卡69堂| 久久一区视频| 欧美国产日韩一区二区在线观看| 中文一区二区| 亚洲欧美自拍偷拍| 在线精品亚洲| 99视频在线观看一区三区| 国产精品久久久久久久电影| 久久激情视频免费观看| 久久资源av| 亚洲午夜羞羞片| 欧美一区二区网站| 亚洲剧情一区二区| 亚洲欧美国产日韩天堂区| 极品尤物久久久av免费看| 亚洲国产一区二区在线| 国产精品日韩一区二区三区| 久久亚洲影音av资源网| 欧美精品在线播放| 欧美在线视频免费观看| 欧美.日韩.国产.一区.二区| 亚洲免费视频观看| 久久在线视频| 亚洲宅男天堂在线观看无病毒| 久久精精品视频| 一级日韩一区在线观看| 欧美在线网址| 亚洲视频播放| 久久夜色精品一区| 亚洲综合日韩在线| 免费不卡在线观看| 欧美一区网站| 欧美日韩视频在线第一区| 久久青青草综合| 欧美性事在线| 亚洲国产高潮在线观看| 国产精品网站在线播放| 亚洲国产综合视频在线观看| 国产视频精品va久久久久久| 亚洲日韩视频| 永久久久久久| 香蕉精品999视频一区二区| 99国产精品自拍| 久久一本综合频道| 欧美在线在线| 欧美午夜理伦三级在线观看| 欧美国产在线电影| 国产日韩欧美成人| 一级日韩一区在线观看| 亚洲精品一区二区三区蜜桃久| 欧美一区二区高清| 亚洲免费在线视频| 欧美高清在线视频| 女人香蕉久久**毛片精品| 国产欧美日韩视频| 一区二区三区鲁丝不卡| 日韩一级精品视频在线观看| 久久免费99精品久久久久久| 欧美中文字幕视频| 国产精品久久久久秋霞鲁丝| 91久久国产综合久久蜜月精品| 激情文学一区| 欧美一区影院| 久久大逼视频| 国产精品日韩精品欧美精品| 99综合精品| 一区二区成人精品| 欧美区日韩区| 最新亚洲一区| 亚洲免费观看视频| 欧美成人高清| 亚洲国产成人一区| 亚洲人在线视频| 免费久久久一本精品久久区| 美日韩精品免费观看视频| 国语自产精品视频在线看抢先版结局 | 久久一区视频| 韩日欧美一区二区| 久久av一区二区三区| 久久久爽爽爽美女图片| 国内外成人免费激情在线视频网站| 亚洲欧美三级伦理| 欧美在线视频免费播放| 国产日韩欧美一二三区|