锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲欧洲在线观看,国产日韩亚洲欧美综合,亚洲国产精品尤物yw在线观看http://www.shnenglu.com/Johnnx/浠庢潵灝辨病鏈夋按棰橈紒zh-cnSat, 29 Nov 2025 09:03:54 GMTSat, 29 Nov 2025 09:03:54 GMT60POJ 3740錛圖FS錛?/title><link>http://www.shnenglu.com/Johnnx/archive/2009/09/16/96440.html</link><dc:creator>Johnnx</dc:creator><author>Johnnx</author><pubDate>Wed, 16 Sep 2009 09:40:00 GMT</pubDate><guid>http://www.shnenglu.com/Johnnx/archive/2009/09/16/96440.html</guid><wfw:comment>http://www.shnenglu.com/Johnnx/comments/96440.html</wfw:comment><comments>http://www.shnenglu.com/Johnnx/archive/2009/09/16/96440.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/Johnnx/comments/commentRss/96440.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/Johnnx/services/trackbacks/96440.html</trackback:ping><description><![CDATA[<a >http://acm.pku.edu.cn/JudgeOnline/problem?id=3740</a> <div>榪欓亾棰樼洰瑕佹眰錛氶夊嚭涓浜涜浣垮緱榪欎簺琛屾瀯鎴愮煩闃電殑姣忎竴鍒楅兘鏈変笖鍙湁涓涓?銆?div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); 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: #008080; "> 1</span> <span style="color: #000000; ">#include</span><span style="color: #000000; "><</span><span style="color: #000000; ">cstdio</span><span style="color: #000000; ">></span><span style="color: #000000; "><br></span><span style="color: #008080; "> 2</span> <span style="color: #000000; ">#include</span><span style="color: #000000; "><</span><span style="color: #0000FF; ">string</span><span style="color: #000000; ">.h</span><span style="color: #000000; ">></span><span style="color: #000000; "><br></span><span style="color: #008080; "> 3</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; "> 4</span> <span style="color: #000000; "><br></span><span style="color: #008080; "> 5</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> m,n,map[</span><span style="color: #000000; ">16</span><span style="color: #000000; ">][</span><span style="color: #000000; ">300</span><span style="color: #000000; ">];<br></span><span style="color: #008080; "> 6</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">bool</span><span style="color: #000000; "> used[</span><span style="color: #000000; ">300</span><span style="color: #000000; ">];<br></span><span style="color: #008080; "> 7</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">bool</span><span style="color: #000000; "> find;<br></span><span style="color: #008080; "> 8</span> <span style="color: #000000; "><br></span><span style="color: #008080; "> 9</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">bool</span><span style="color: #000000; "> match(){ //鍒ゆ柇鎵閫夊彇鐨勮鏋勬垚鐨勭煩闃墊槸鍚︾鍚堟儏鍐?br></span><span style="color: #008080; ">10</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; "> </span><span style="color: #000000; ">0</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; ">11</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(</span><span style="color: #000000; ">!</span><span style="color: #000000; ">used[i])</span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">false</span><span style="color: #000000; ">;<br></span><span style="color: #008080; ">12</span> <span style="color: #000000; ">    }<br></span><span style="color: #008080; ">13</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">true</span><span style="color: #000000; ">;<br></span><span style="color: #008080; ">14</span> <span style="color: #000000; ">}<br></span><span style="color: #008080; ">15</span> <span style="color: #000000; "><br></span><span style="color: #008080; ">16</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">bool</span><span style="color: #000000; "> check(</span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> row){ <br></span><span style="color: #008080; ">17</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; "> </span><span style="color: #000000; ">0</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; ">18</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(used[i] </span><span style="color: #000000; ">&&</span><span style="color: #000000; "> map[row][i])</span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">false</span><span style="color: #000000; ">; //used[i]&&map[row][i]琛ㄧず璇ュ垪鏈夐夊彇鐨勮鍒楁湁涓嶅彧涓涓?錛岃繑鍥瀎alse鏀懼純榪欑鎯呭喌銆?br></span><span style="color: #008080; ">19</span> <span style="color: #000000; ">    }<br></span><span style="color: #008080; ">20</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; "> </span><span style="color: #000000; ">0</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; ">21</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(map[row][i]){<br></span><span style="color: #008080; ">22</span> <span style="color: #000000; ">            used[i] </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">true</span><span style="color: #000000; ">;<br></span><span style="color: #008080; ">23</span> <span style="color: #000000; ">        }<br></span><span style="color: #008080; ">24</span> <span style="color: #000000; ">    }<br></span><span style="color: #008080; ">25</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">true</span><span style="color: #000000; ">;<br></span><span style="color: #008080; ">26</span> <span style="color: #000000; ">}<br></span><span style="color: #008080; ">27</span> <span style="color: #000000; "><br></span><span style="color: #008080; ">28</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> dfs(</span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> start){<br></span><span style="color: #008080; ">29</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(start</span><span style="color: #000000; ">></span><span style="color: #000000; ">m </span><span style="color: #000000; ">||</span><span style="color: #000000; "> find)</span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">;<br></span><span style="color: #008080; ">30</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(match()){<br></span><span style="color: #008080; ">31</span> <span style="color: #000000; ">        printf(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">Yes, I found it\n</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br></span><span style="color: #008080; ">32</span> <span style="color: #000000; ">        find </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">true</span><span style="color: #000000; ">;<br></span><span style="color: #008080; ">33</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; ">;<br></span><span style="color: #008080; ">34</span> <span style="color: #000000; ">    }<br></span><span style="color: #008080; ">35</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; "> start;i </span><span style="color: #000000; "><</span><span style="color: #000000; "> m </span><span style="color: #000000; ">&&</span><span style="color: #000000; "> </span><span style="color: #000000; ">!</span><span style="color: #000000; ">find;</span><span style="color: #000000; ">++</span><span style="color: #000000; ">i){<br></span><span style="color: #008080; ">36</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(check(i)){<br></span><span style="color: #008080; ">37</span> <span style="color: #000000; ">            dfs(i</span><span style="color: #000000; ">+</span><span style="color: #000000; ">1</span><span style="color: #000000; ">);<br></span><span style="color: #008080; ">38</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; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; ">;j </span><span style="color: #000000; "><</span><span style="color: #000000; "> n;</span><span style="color: #000000; ">++</span><span style="color: #000000; ">j){<br></span><span style="color: #008080; ">39</span> <span style="color: #000000; ">                </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(map[i][j])used[j] </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">false</span><span style="color: #000000; ">;<br></span><span style="color: #008080; ">40</span> <span style="color: #000000; ">            }<br></span><span style="color: #008080; ">41</span> <span style="color: #000000; ">        }<br></span><span style="color: #008080; ">42</span> <span style="color: #000000; ">    }<br></span><span style="color: #008080; ">43</span> <span style="color: #000000; ">}       <br></span><span style="color: #008080; ">44</span> <span style="color: #000000; "><br></span><span style="color: #008080; ">45</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> main()<br></span><span style="color: #008080; ">46</span> <span style="color: #000000; ">{<br></span><span style="color: #008080; ">47</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> i,j;<br></span><span style="color: #008080; ">48</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">while</span><span style="color: #000000; ">(scanf(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">%d%d</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,</span><span style="color: #000000; ">&</span><span style="color: #000000; ">m,</span><span style="color: #000000; ">&</span><span style="color: #000000; ">n)</span><span style="color: #000000; ">!=</span><span style="color: #000000; ">EOF){<br></span><span style="color: #008080; ">49</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">for</span><span style="color: #000000; ">(i </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0</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; ">i){<br></span><span style="color: #008080; ">50</span> <span style="color: #000000; ">            </span><span style="color: #0000FF; ">for</span><span style="color: #000000; ">(j </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; ">;j </span><span style="color: #000000; "><</span><span style="color: #000000; "> n;</span><span style="color: #000000; ">++</span><span style="color: #000000; ">j){<br></span><span style="color: #008080; ">51</span> <span style="color: #000000; ">                scanf(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">%d</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,</span><span style="color: #000000; ">&</span><span style="color: #000000; ">map[i][j]);<br></span><span style="color: #008080; ">52</span> <span style="color: #000000; ">            }<br></span><span style="color: #008080; ">53</span> <span style="color: #000000; ">        }<br></span><span style="color: #008080; ">54</span> <span style="color: #000000; ">        memset(used,</span><span style="color: #0000FF; ">false</span><span style="color: #000000; ">,</span><span style="color: #0000FF; ">sizeof</span><span style="color: #000000; ">(used));<br></span><span style="color: #008080; ">55</span> <span style="color: #000000; ">        find </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">false</span><span style="color: #000000; ">;<br></span><span style="color: #008080; ">56</span> <span style="color: #000000; ">        dfs(</span><span style="color: #000000; ">0</span><span style="color: #000000; ">);<br></span><span style="color: #008080; ">57</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(</span><span style="color: #000000; ">!</span><span style="color: #000000; ">find)printf(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">It is impossible\n</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br></span><span style="color: #008080; ">58</span> <span style="color: #000000; ">    }<br></span><span style="color: #008080; ">59</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; ">60</span> <span style="color: #000000; ">}<br></span><span style="color: #008080; ">61</span> </div></div><img src ="http://www.shnenglu.com/Johnnx/aggbug/96440.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/Johnnx/" target="_blank">Johnnx</a> 2009-09-16 17:40 <a href="http://www.shnenglu.com/Johnnx/archive/2009/09/16/96440.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>POJ 2528錛堢嚎孌墊爲(wèi)+紱繪暎鍖栵級http://www.shnenglu.com/Johnnx/archive/2009/09/16/96434.htmlJohnnxJohnnxWed, 16 Sep 2009 09:07:00 GMThttp://www.shnenglu.com/Johnnx/archive/2009/09/16/96434.htmlhttp://www.shnenglu.com/Johnnx/comments/96434.htmlhttp://www.shnenglu.com/Johnnx/archive/2009/09/16/96434.html#Feedback2http://www.shnenglu.com/Johnnx/comments/commentRss/96434.htmlhttp://www.shnenglu.com/Johnnx/services/trackbacks/96434.htmlhttp://acm.pku.edu.cn/JudgeOnline/problem?id=2528
榪欐槸涓閬撶粡鍏哥殑綰挎鏍?wèi)棰樼洰锛?/span>鍙﹀鍔犱笂紱繪暎鍖栫殑鏂規(guī)硶銆?/div>
    紱繪暎鍖栵細(xì)鐢變簬棰樼洰涓瓀all鏈?0000000bytes long錛岀洿鎺ョ嚎孌墊爲(wèi)鏃犵枒浼?xì)MLE銆傛墍浠ヨ瀵瑰叾紱繪暎鍖栵紝鍩烘湰鍋氭硶鏄細(xì)鍏堝鎵鏈夌鐐瑰潗鏍囪繘琛屾帓搴忥紝鐢?span style="COLOR:red">鐩稿簲搴忓彿浠f浛绔偣鍧愭爣鏋勯犵嚎孌墊爲(wèi)榪涜璁$畻銆傝繖鏍鋒渶澶х殑搴忓彿涔熷彧鏄?*n銆?/div>
   鍦ㄦ瀯閫犵嚎孌墊爲(wèi)鐨勮妭鐐圭粨鏋勪綋鏃訛紝娣誨姞鍙橀噺c銆俢=0鏃惰〃紺篶綰挎娌℃湁璐存搗鎶ワ紝鎴栬呰創(chuàng)浜嗕笉姝竴寮犳搗鎶ワ紱c>0鏃惰〃紺鴻創(chuàng)浜嗕竴寮犳搗鎶ワ紝騫朵笖c鐨勫艱〃紺鴻創(chuàng)鐨勬槸絎嚑寮犳搗鎶ャ?/div>
    綰挎鏍?wèi)鏇存柊鐨勫熀鏈師鐞啚鏄Q屽綋鎴戜滑璐存搗鎶鏃訛紝濡傛灉閬囧埌鏌愪竴綰挎鍖洪棿鑳藉琚綋鍓嶆搗鎶ュ畬鍏ㄨ鐩栵紝閭d箞鎴戜滑鏇存柊鍒版鍖洪棿鍗沖彲錛屽嵆璁╁畠鐨勫彉閲廲鏇存柊涓烘搗鎶錛岃褰曚笅i鐨勫箋傚鏋滀笉鑳借嫻鋒姤瀹屽叏瑕嗙洊錛屽垯鍙槸榪欎竴綰挎鍖洪棿鐨勯儴鍒嗗尯闂撮渶瑕佷慨鏀癸紝鍒欐洿鏀硅繖涓鍖洪棿鐨勫瓙鍖洪棿鍗沖彲銆?div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; ">  1 #include<iostream>
  2 #include<cstdio>
  3 #include<algorithm>
  4 #include<string.h>
  5 #define MAX 20001
  6 
  7 using namespace std;
  8 
  9 int c,n,ls[MAX];
 10 struct node{
 11     int l,r;
 12     int c;
 13 }tree[MAX*4];
 14 struct ln{
 15     int li,num;//num琛ㄧず絎嚑寮犳搗鎶?br> 16 }line[MAX];
 17 int set[MAX][2];
 18 bool visit[MAX];
 19 int ans;
 20 
 21 bool cmp(struct ln a,struct ln b){
 22     return a.li<b.li;
 23 }
 24 
 25 void Inittree(int pos,int ll,int rr){
 26     tree[pos].l = ll;
 27     tree[pos].r = rr;
 28     tree[pos].c = 0;
 29     if(ll!=rr){
 30         int mid = (ll+rr)>>1;
 31         Inittree(pos*2,ll,mid);
 32         Inittree(pos*2+1,mid+1,rr);
 33     }
 34 }
 35 
 36 void Insert(int pos,int ll,int rr,int color){
 37     if(tree[pos].l == ll && tree[pos].r == rr){
 38         tree[pos].c = color;
 39         return;
 40     }
 41     if(tree[pos].c > 0 && tree[pos].c != color){
 42         tree[pos*2].c = tree[pos].c;
 43         tree[pos*2+1].c = tree[pos].c;
 44         tree[pos].c = 0;
 45     }
 46     int mid = (tree[pos].l + tree[pos].r)>>1;
 47     if(rr<=mid){
 48         Insert(pos*2,ll,rr,color);
 49     }
 50     else if(ll>mid){
 51         Insert(pos*2+1,ll,rr,color);
 52     }
 53     else{
 54         Insert(pos*2,ll,mid,color);
 55         Insert(pos*2+1,mid+1,rr,color);
 56     }
 57 }
 58 
 59 void Search(int pos){
 60     if(tree[pos].c!=0){
 61         if(!visit[tree[pos].c]){//tree[pos].c
 62             visit[tree[pos].c] = true;
 63             ans++;
 64         }
 65         return ;
 66     }
 67     Search(2*pos);
 68     Search(2*pos+1);
 69 }
 70 
 71 int main()
 72 {
 73     int i;
 74     while(scanf("%d",&c)!=EOF){
 75         while(c--){
 76             scanf("%d",&n);
 77             for(i = 0;i < n;++i){//紱繪暎鍖?/span>
 78                 scanf("%d%d",&set[i][0],&set[i][1]);
 79                 line[2*i].li = set[i][0];
 80                 line[2*i].num = -(i+1);//鐢ㄨ礋鏁拌〃紺?綰挎璧風(fēng)偣
 81                 line[2*i+1].li = set[i][1];
 82                 line[2*i+1].num = i+1;
 83             }
 84             sort(line,line+2*n,cmp);
 85             int temp = line[0].li,tp = 1;
 86             for(i = 0;i < 2*n;++i){
 87                 if(line[i].li != temp){
 88                     tp++;
 89                     temp = line[i].li;
 90                 }
 91                 if(line[i].num < 0){
 92                     set[-line[i].num-1][0= tp;
 93                 }
 94                 else{
 95                     set[line[i].num-1][1= tp;
 96                 }
 97             }//紱繪暎鍖?/span>
 98         
 99             Inittree(1,1,tp);
100             for(i = 0;i < n;++i){
101                 Insert(1,set[i][0],set[i][1],i+1);
102             }
103             memset(visit,0,sizeof(visit));
104             ans = 0;
105             Search(1);
106             printf("%d\n",ans);
107         }
108     }
109     return 0;
110 }
111 


Johnnx 2009-09-16 17:07 鍙戣〃璇勮
]]>NKOJ 1007,1249http://www.shnenglu.com/Johnnx/archive/2009/07/24/91063.htmlJohnnxJohnnxFri, 24 Jul 2009 10:18:00 GMThttp://www.shnenglu.com/Johnnx/archive/2009/07/24/91063.htmlhttp://www.shnenglu.com/Johnnx/comments/91063.htmlhttp://www.shnenglu.com/Johnnx/archive/2009/07/24/91063.html#Feedback0http://www.shnenglu.com/Johnnx/comments/commentRss/91063.htmlhttp://www.shnenglu.com/Johnnx/services/trackbacks/91063.htmlhttp://acm.nankai.edu.cn/p1007.html,http://acm.nankai.edu.cn/p1249.html
榪欐槸涓や釜鍏充簬鍒嗚В绱犳暟鐨勯棶棰橈紝涓涓槸鍒嗚В涓虹礌鏁頒箣鍜岋紝涓涓槸鍒嗚В涓虹礌鏁頒箣縐傝嚜宸卞啓鐨勬籘LE錛屼簬鏄弬鑰冧簡鍒漢鐨勪唬鐮侊紝鎰熻鏂規(guī)硶鏋滅劧宸у銆傚浜庣礌鏁頒箣鍜屾槸鎵懼埌绱犳暟瑙勫緥浜嗐?div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; ">nkoj 1007
#include<stdio.h>
#include
<stdlib.h>
int n;
int main()
{
    scanf(
"%d",&n);
    
if(n%3){
    
switch(n%3){
        
case 1:printf("2 2 ");n-=4;break;
        
case 2:printf("");n-=2;break;
    }
    }
    
while(n){
        printf(
"");
        n
-=3;
    }
    system(
"pause");
    
return 0;
}
code
nkoj 1249
#include<stdio.h>
#include
<math.h>
int n,a;
int main()
{
    scanf(
"%d",&n);
    
while(n--){
        scanf(
"%d",&a);
        
int i,flag = 0;
        
int b=a;
        
for(i = 2;i <= b/2;i++){
            
if(a%i==0 && flag==0){
                flag 
= 1;
                a
/=i;
                printf(
"%d",i);
            }
            
while(a%i==0){
                a
/=i;
                printf(
"*%d",i);
            }
        }
        
if(flag == 0)printf("%d",a);
        printf(
"\n");
    }
    
return 0;
}
    


Johnnx 2009-07-24 18:18 鍙戣〃璇勮
]]>POJ grids 1664http://www.shnenglu.com/Johnnx/archive/2009/07/20/90639.htmlJohnnxJohnnxMon, 20 Jul 2009 08:56:00 GMThttp://www.shnenglu.com/Johnnx/archive/2009/07/20/90639.htmlhttp://www.shnenglu.com/Johnnx/comments/90639.htmlhttp://www.shnenglu.com/Johnnx/archive/2009/07/20/90639.html#Feedback0http://www.shnenglu.com/Johnnx/comments/commentRss/90639.htmlhttp://www.shnenglu.com/Johnnx/services/trackbacks/90639.html浠庤繖閬撻鐩垜璁よ瘑鍒伴掑綊鎬濇兂鐨勫己澶с?div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; ">#include<stdio.h>
int t;
int pro(int m,int n){
    
if(m == 0||== 1)return 1;
    
if(m < n)return pro(m,m);
    
return pro(m,n-1)+pro(m-n,n);
}
int main()
{
    scanf(
"%d",&t);
    
int m,n;
    
while(t--){
        scanf(
"%d%d",&m,&n);
        printf(
"%d\n",pro(m,n));
    }
    
return 0;
}


Johnnx 2009-07-20 16:56 鍙戣〃璇勮
]]>
NKOJ 1019http://www.shnenglu.com/Johnnx/archive/2009/07/18/90426.htmlJohnnxJohnnxSat, 18 Jul 2009 06:18:00 GMThttp://www.shnenglu.com/Johnnx/archive/2009/07/18/90426.htmlhttp://www.shnenglu.com/Johnnx/comments/90426.htmlhttp://www.shnenglu.com/Johnnx/archive/2009/07/18/90426.html#Feedback0http://www.shnenglu.com/Johnnx/comments/commentRss/90426.htmlhttp://www.shnenglu.com/Johnnx/services/trackbacks/90426.htmlhttp://acm.nankai.edu.cn/p1019.html
澶ф暟鐩稿姞錛屽埄鐢ㄦ暟緇勫瓨鍌紝鍐嶅姞涓婇傚綋澶勭悊銆?div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; "> 1 #include<stdio.h>
 2 #include<string.h>
 3 char a[101],b[101];
 4 int c[101];
 5 int main()
 6 {
 7     while(scanf("%s%s",a,b) != EOF){
 8         memset(c,0,sizeof(c));
 9         int i,j,k;
10         for(i = strlen(a)-1,j = strlen(b)-1,k = 0;i>=0 || j>=0;k++){
11             c[k] = (i>=0?(a[i--]-'0'):0+ (j>=0?(b[j--]-'0'):0);
12         }
13         for(i = 0;i < k;++i){
14             if(c[i] > 9){
15                 c[i+1+= c[i]/10;
16                 c[i] = c[i]%10;
17             }
18         }
19         while(!c[k]){
20             k--;
21         }
22         for(i = k;i>=0;--i){
23             printf("%d",c[i]);
24         }
25         printf("\n");
26     }
27     return 0;
28 }


Johnnx 2009-07-18 14:18 鍙戣〃璇勮
]]>
NKOJ 1002http://www.shnenglu.com/Johnnx/archive/2009/07/18/90425.htmlJohnnxJohnnxSat, 18 Jul 2009 06:14:00 GMThttp://www.shnenglu.com/Johnnx/archive/2009/07/18/90425.htmlhttp://www.shnenglu.com/Johnnx/comments/90425.htmlhttp://www.shnenglu.com/Johnnx/archive/2009/07/18/90425.html#Feedback0http://www.shnenglu.com/Johnnx/comments/commentRss/90425.htmlhttp://www.shnenglu.com/Johnnx/services/trackbacks/90425.htmlhttp://acm.nankai.edu.cn/p1002.html
涔嶇湅涓嶉毦錛屽叾瀹炰篃涓嶉毦銆傚氨鏄笉鑳界敤閫掑綊鏉ュ仛銆傚閥濡欏湴鍒╃敤鍙橀噺l鏉ュ鐞嗭紝浣撲細(xì)錛?div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; "> 1 #include<stdio.h>
 2 #include<stdlib.h>
 3 long n;
 4 int main()
 5 {
 6     while(scanf("%d",&n) != EOF){
 7         long l = 1;
 8         while(l>0){
 9             if(n >= 50025002){
10                 n -= 5;
11                 l--;
12             }
13             else{
14                 n += 2005;
15                 l++;
16             }
17         }
18         printf("%d\n",n);
19     }
20     system("pause");
21     return 0;
22 }
23 


Johnnx 2009-07-18 14:14 鍙戣〃璇勮
]]>
POJ grids 2692http://www.shnenglu.com/Johnnx/archive/2009/07/18/90424.htmlJohnnxJohnnxSat, 18 Jul 2009 06:09:00 GMThttp://www.shnenglu.com/Johnnx/archive/2009/07/18/90424.htmlhttp://www.shnenglu.com/Johnnx/comments/90424.htmlhttp://www.shnenglu.com/Johnnx/archive/2009/07/18/90424.html#Feedback0http://www.shnenglu.com/Johnnx/comments/commentRss/90424.htmlhttp://www.shnenglu.com/Johnnx/services/trackbacks/90424.html鍒╃敤鏋氫婦錛屼粠'A'鍒?L'銆傚垽鏂潯浠舵槸錛氬鏋滄槸'even'錛屽垯澶╁鉤涓よ竟鏃犲亣甯侊紱濡傛灉鏄?up'錛岃嫢涓簂ight錛屽垯鍋囧竵涓瀹氬湪澶╁鉤鍙充晶錛岃嫢涓篽eavy錛屽垯鍋囧竵涓瀹氬湪澶╁鉤宸︿晶錛涘鏋滄槸'down'錛屾儏鍐電浉鍙嶃?div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; "> 1 #include<stdio.h>
 2 #include<string.h>
 3 #include<stdlib.h>
 4 char left[3][7],right[3][7],result[3][5];
 5 bool isLight(char c);
 6 bool isheavy(char c);
 7 int main()
 8 {
 9     int n;
10     while(scanf("%d",&n) != EOF){
11         while(n--){
12             for(int i = 0;i < 3;i++)
13                 scanf("%s%s%s",left[i],right[i],result[i]);
14             char x;
15             for(x = 'A';x <= 'L';x++){
16                 if(isLight(x)){
17                     printf("%c is the counterfeit coin and it is light.\n",x);
18                     break;
19                 }
20                 if(isheavy(x)){
21                     printf("%c is the counterfeit coin and it is heavy.\n",x);
22                     break;
23                 }
24             }
25         }
26     }
27     system("pause");
28     return 0;           
29 }
30 
31 bool isLight(char c)
32 {
33     for(int i = 0;i < 3;i++){
34         if(!strcmp(result[i],"even"))
35             if(strchr(left[i],c) != NULL || strchr(right[i],c) != NULL)return false;
36         if(!strcmp(result[i],"up"))
37             if(strchr(right[i],c) == NULL)return false;
38         if(!strcmp(result[i],"down"))
39             if(strchr(left[i],c) == NULL)return false;
40     }
41     return true;
42 }
43 
44 bool isheavy(char c)
45 {
46     for(int i = 0;i < 3;i++){
47         if(!strcmp(result[i],"even"))
48             if(strchr(left[i],c) != NULL || strchr(right[i],c) != NULL)return false;
49         if(!strcmp(result[i],"up"))
50             if(strchr(left[i],c) == NULL)return false;
51         if(!strcmp(result[i],"down"))
52             if(strchr(right[i],c) == NULL)return false;
53     }
54     return true;
55 }
56 

Johnnx 2009-07-18 14:09 鍙戣〃璇勮
]]>
POJ grids 2977http://www.shnenglu.com/Johnnx/archive/2009/07/18/90423.htmlJohnnxJohnnxSat, 18 Jul 2009 06:02:00 GMThttp://www.shnenglu.com/Johnnx/archive/2009/07/18/90423.htmlhttp://www.shnenglu.com/Johnnx/comments/90423.htmlhttp://www.shnenglu.com/Johnnx/archive/2009/07/18/90423.html#Feedback0http://www.shnenglu.com/Johnnx/comments/commentRss/90423.htmlhttp://www.shnenglu.com/Johnnx/services/trackbacks/90423.html棰樼洰鏄姹備笁涓敓鐞嗗懆鏈熼珮宄板嚭鐜板湪鍚屼竴澶╃殑鏃墮棿錛屽嵆涓変釜鏁扮殑鏈灝忓叕鍊嶆暟銆?div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; "> 1 #include<stdio.h>
 2 int p,e,j,d;
 3 int main()
 4 {
 5     int k = 1;
 6     int i;
 7     while(scanf("%d%d%d%d",&p,&e,&j,&d) != EOF && p != -1){
 8         for(i = d+1;i < 21252;++i)
 9             if((i-p)%23 == 0)break;
10         for(;i < 21252;i+=23)
11             if((i-e)%28 == 0)break;
12         for(;i < 21252;i+=23*28)
13             if((i-j)%33 == 0)break;
14         printf("Case %d: the next triple peak occurs in %d days.\n",k++,i-d);
15     }
16     return 0;
17 }
18 

Johnnx 2009-07-18 14:02 鍙戣〃璇勮
]]>
POJ 1068http://www.shnenglu.com/Johnnx/archive/2009/07/04/89250.htmlJohnnxJohnnxSat, 04 Jul 2009 11:53:00 GMThttp://www.shnenglu.com/Johnnx/archive/2009/07/04/89250.htmlhttp://www.shnenglu.com/Johnnx/comments/89250.htmlhttp://www.shnenglu.com/Johnnx/archive/2009/07/04/89250.html#Feedback1http://www.shnenglu.com/Johnnx/comments/commentRss/89250.htmlhttp://www.shnenglu.com/Johnnx/services/trackbacks/89250.htmlhttp://acm.pku.edu.cn/JudgeOnline/problem?id=1068
榪欓亾棰樼洰鏄竴閬撴ā鎷熼銆侾-sequence琛ㄧず絎琲涓?#8216;)’涔嬪墠鏈夊嚑涓?#8216;(’錛學(xué)-sequence琛ㄧず絎琲涓?#8216;()’鍖呭惈鍑犲‘()’錛岃姹傚搴擯鐨刉銆傞鐩腑娌℃湁瑕佽緭鍑篠錛屾晠‘(’‘)’鍙互鍒嗗埆鐢?錛?鏉ヤ唬鏇褲傛牴鎹甈鍙互杞繪槗鐭ラ亾‘)’鐨勪綅緗細(xì)location = p[i] + i銆傜敤value璁板綍w[i]鐨勫鹼紝鐢╢lag璁板綍鎷彿鏄惁鎴愬銆?div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; "> 1 #include<stdio.h>
 2 #include<string.h>
 3 #include<stdlib.h>
 4 int t,n;
 5 int s[41],p[21],w[21];
 6 int main()
 7 {
 8     scanf("%d",&t);
 9     while(t--){
10         scanf("%d",&n);
11         int temp,flag,value;
12         memset(s,0,sizeof(s));
13         for(int i = 0;i < n;++i){
14             scanf("%d",&p[i]);
15             temp = p[i] + i;
16             s[temp] = 1;
17             for(int k = temp-1,value = 1,flag = 0;k >= 0;--k){
18                 if(s[k] == 0 && flag == 0){
19                     w[i] = value;
20                     break;
21                 }
22                 else if(s[k] == 1){
23                     value++;
24                     flag++;
25                 }
26                 else if(s[k] == 0)flag--;
27             }
28         }
29         for(int i = 0;i < n;++i)printf("%d ",w[i]);
30         printf("\n");
31     }
32     system("pause");
33     return 0;
34 }
35 
code

Johnnx 2009-07-04 19:53 鍙戣〃璇勮
]]>
POJ 1008http://www.shnenglu.com/Johnnx/archive/2009/07/03/89193.htmlJohnnxJohnnxFri, 03 Jul 2009 14:28:00 GMThttp://www.shnenglu.com/Johnnx/archive/2009/07/03/89193.htmlhttp://www.shnenglu.com/Johnnx/comments/89193.htmlhttp://www.shnenglu.com/Johnnx/archive/2009/07/03/89193.html#Feedback0http://www.shnenglu.com/Johnnx/comments/commentRss/89193.htmlhttp://www.shnenglu.com/Johnnx/services/trackbacks/89193.htmlhttp://acm.pku.edu.cn/JudgeOnline/problem?id=1008
榪欐槸涓閬撳叧浜庡巻娉曡漿鎹㈢殑闂銆備粠榪欓亾棰樻垜寰楀埌2鐐規(guī)敹鑾鳳細(xì)涓銆侀鐩腑鏈堜喚鎴栬呮棩鏈熸槸鐢ㄥ瓧絎︿覆鏉ヨ〃紺虹殑錛岃繖鏃跺埄鐢ㄤ簩浣嶆暟緇勫彲浠ヨ交鏉懼疄鐜頒粠瀛楃涓插埌鏁板瓧鐨勮漿鎹紱浜屻乀zolkin涓殑鏃ユ湡鍜屾湀鏁版槸鐩鎬簰鐙珛鐨勶紝鍙垎鍒彇浣欍?/div>
鍙﹀錛屾垜瑙夊緱寰堥噸瑕佺殑涓鐐瑰氨鏄紝涓瀹氳娓呮棰樼洰鏄粠0錛岃繕鏄粠1寮濮嬫暟鐨勶紝騫朵笖鍦ㄥ彇浣欐椂鍊欏叧浜庤繖鏂歸潰涓瀹氳淇濇寔澶磋剳娓呴啋銆傚緢瀹規(guī)槗鍑洪敊銆?div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; "> 1 #include<stdio.h>
 2 #include<string.h>
 3 #include<stdlib.h>
 4 int n;
 5 char haabmonth[19][10= {"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
 6 char tzolkinday[20][10= {"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
 7 int day;
 8 char month[10];
 9 int year;
10 int main()
11 {
12     scanf("%d",&n);
13     printf("%d\n",n);
14     for(int i = 0;i < n;++i){
15         scanf("%d. %s %d",&day,month,&year);
16         int days;
17         for(int k = 0;k < 19;++k){
18             if(!strcmp(haabmonth[k],month)){
19                 days = year * 365 + k * 20 + day;
20                 break;
21             }
22         }
23         int m = days % 260;
24         printf("%d %s %d\n",m%13+1,tzolkinday[m%20],days/260);
25     }
26     system("pause");
27     return 0;
28 }
29 
code


Johnnx 2009-07-03 22:28 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            牛牛影视久久网| 久热精品视频在线观看| 欧美激情亚洲激情| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲中无吗在线| 欧美激情一区二区三区全黄 | 国产精品日韩在线| 亚洲精品乱码久久久久| 久久视频国产精品免费视频在线| 一本色道久久加勒比精品| 模特精品在线| 尤物99国产成人精品视频| 欧美一区二区在线看| 日韩午夜在线电影| 欧美美女bbbb| 亚洲欧洲在线看| 欧美成人蜜桃| 久久免费视频网| 国产在线欧美日韩| 久久精品人人做人人综合 | 在线观看国产精品网站| 久久av最新网址| 亚洲综合色在线| 国产精品久久久久久久久婷婷| 一区二区三区日韩欧美精品| 亚洲国产婷婷综合在线精品| 久久这里有精品15一区二区三区| 狠狠色伊人亚洲综合网站色| 久久露脸国产精品| 欧美在线视频免费观看| 国产午夜亚洲精品羞羞网站 | 欧美日韩成人综合天天影院| 亚洲欧洲午夜| 91久久精品视频| 欧美国产视频一区二区| 亚洲国产二区| 欧美激情国产日韩| 欧美77777| 日韩视频免费| 亚洲美女黄网| 欧美日韩在线观看一区二区三区| 亚洲午夜精品久久久久久app| 亚洲精品一区在线| 国产精品h在线观看| 午夜国产一区| 欧美一区二区三区日韩视频| 国内精品模特av私拍在线观看| 久久米奇亚洲| 麻豆精品视频| 亚洲美女精品成人在线视频| 亚洲久久一区| 国产精品成人一区二区三区夜夜夜| 亚洲主播在线播放| 欧美夜福利tv在线| 一区二区亚洲精品| 亚洲第一久久影院| 欧美日韩精品高清| 午夜在线电影亚洲一区| 欧美有码在线视频| 亚洲国产精品国自产拍av秋霞| 亚洲国产精选| 国产精品久久久久久久久久直播 | 亚洲一区二区三区精品在线观看| 亚洲一区制服诱惑| 黄色综合网站| 亚洲高清在线播放| 国产精品jvid在线观看蜜臀| 欧美一区二区三区四区在线| 久久久久久九九九九| 亚洲精品视频免费在线观看| 一级日韩一区在线观看| 国产亚洲成年网址在线观看| 欧美成人午夜激情视频| 欧美日韩中文另类| 久久精品日产第一区二区| 蜜桃久久精品乱码一区二区| 亚洲一区精彩视频| 久久精品欧洲| 一区二区三区四区蜜桃| 香蕉成人伊视频在线观看| 亚洲经典视频在线观看| 中文成人激情娱乐网| 极品少妇一区二区三区| 亚洲精品欧美在线| 国产又爽又黄的激情精品视频| 欧美激情亚洲一区| 国产麻豆91精品| 欧美国产日本| 国产精品视频网址| 亚洲高清久久网| 国产精品丝袜白浆摸在线| 欧美岛国激情| 国产精品视频导航| 亚洲国产激情| 国产日韩一区二区三区在线| 亚洲国产三级网| 国产欧美在线看| 亚洲日韩视频| 国语自产精品视频在线看8查询8 | 欧美xxxx在线观看| 国产精品另类一区| 欧美激情精品久久久久久免费印度 | 国产在线不卡| 99re6热只有精品免费观看 | 日韩视频欧美视频| 精品动漫一区二区| 亚洲一区二区3| 亚洲每日更新| 久久久爽爽爽美女图片| 香蕉久久夜色精品| 欧美区一区二| 欧美大尺度在线| 国产视频一区免费看| 一本到12不卡视频在线dvd| 亚洲电影激情视频网站| 亚洲欧美影院| 亚洲综合色激情五月| 欧美国产日本在线| 美女国内精品自产拍在线播放| 国产精品一二三视频| 99精品久久久| 亚洲精品美女在线观看| 久久久精品一品道一区| 欧美一区二区三区在线观看视频| 欧美日韩1区2区| 亚洲国产视频一区| 亚洲大片在线观看| 久久av资源网站| 欧美一区国产在线| 国产精品国产一区二区| 亚洲精品少妇网址| 亚洲美女中文字幕| 女人色偷偷aa久久天堂| 模特精品在线| 一区二区亚洲| 久久激情婷婷| 久久免费少妇高潮久久精品99| 国产精品一区毛片| 亚洲欧美国产高清va在线播| 亚洲午夜久久久| 欧美日韩喷水| 日韩一级大片| 亚洲天堂网在线观看| 欧美日韩国产色视频| 亚洲人成人一区二区在线观看| 91久久国产综合久久蜜月精品 | 老巨人导航500精品| 久久一区二区三区超碰国产精品| 国产情侣一区| 午夜精品久久久99热福利| 欧美亚洲视频| 国产乱码精品一区二区三区五月婷| 亚洲性夜色噜噜噜7777| 亚洲欧美日韩精品久久久久| 国产精品久久久久一区二区| 亚洲小说区图片区| 亚洲欧美综合另类中字| 国产精品性做久久久久久| 亚洲综合日韩在线| 久久不射电影网| 狠狠色综合色区| 久久男人av资源网站| 欧美顶级大胆免费视频| 亚洲日本成人网| 欧美日韩精品在线视频| 99国产精品视频免费观看| 亚洲一区二区视频在线| 国产精品日韩欧美一区二区三区| 亚洲欧美制服另类日韩| 久久婷婷国产麻豆91天堂| 亚洲第一天堂av| 欧美大胆成人| 一区二区三区高清在线| 欧美一级视频精品观看| 激情成人av在线| 欧美国产视频一区二区| 一本色道久久综合狠狠躁篇怎么玩 | 亚洲国产精品久久久久婷婷884| 日韩午夜在线| 国产精品免费aⅴ片在线观看| 亚洲欧美精品suv| 久久伊人一区二区| 亚洲精品一级| 国产精品女主播| 久久国产精品久久久| 亚洲国产精品va在线看黑人| 亚洲影院色无极综合| 国产亚洲精品美女| 免费不卡亚洲欧美| 中文亚洲欧美| 可以看av的网站久久看| 亚洲理论电影网| 国产精品自拍三区| 麻豆精品一区二区综合av| 99视频热这里只有精品免费| 久久精品成人欧美大片古装| 亚洲国产精品一区二区www| 欧美性片在线观看| 久久久久久成人| 一区二区三区国产盗摄|