锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品xxxav免费视频,国产精品网站在线播放,国产农村妇女精品一二区http://www.shnenglu.com/worm/涓轟粈涔堟垜鐨勭溂閲岄ケ鍚唱姘達紵鍥犱負鎴戠▼搴忔病鍐欏畬錛?/description>zh-cnSun, 30 Nov 2025 04:01:22 GMTSun, 30 Nov 2025 04:01:22 GMT60poj 3414瑙i鎶ュ憡(騫挎悳棰?http://www.shnenglu.com/worm/archive/2009/03/08/75917.htmlWORMWORMSun, 08 Mar 2009 10:40:00 GMThttp://www.shnenglu.com/worm/archive/2009/03/08/75917.htmlhttp://www.shnenglu.com/worm/comments/75917.htmlhttp://www.shnenglu.com/worm/archive/2009/03/08/75917.html#Feedback5http://www.shnenglu.com/worm/comments/commentRss/75917.htmlhttp://www.shnenglu.com/worm/services/trackbacks/75917.html闃呰鍏ㄦ枃

WORM 2009-03-08 18:40 鍙戣〃璇勮
]]>
poj 3191瑙i鎶ュ憡http://www.shnenglu.com/worm/archive/2009/03/08/75887.htmlWORMWORMSun, 08 Mar 2009 04:37:00 GMThttp://www.shnenglu.com/worm/archive/2009/03/08/75887.htmlhttp://www.shnenglu.com/worm/comments/75887.htmlhttp://www.shnenglu.com/worm/archive/2009/03/08/75887.html#Feedback1http://www.shnenglu.com/worm/comments/commentRss/75887.htmlhttp://www.shnenglu.com/worm/services/trackbacks/75887.htmlThe Moronic Cowmpouter
Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 1344 Accepted: 676

Description

Inexperienced in the digital arts, the cows tried to build a calculating engine (yes, it's a cowmpouter) using binary numbers (base 2) but instead built one based on base negative 2! They were quite pleased since numbers expressed in base −2 do not have a sign bit.

You know number bases have place values that start at 1 (base to the 0 power) and proceed right-to-left to base^1, base^2, and so on. In base −2, the place values are 1, −2, 4, −8, 16, −32, ... (reading from right to left). Thus, counting from 1 goes like this: 1, 110, 111, 100, 101, 11010, 11011, 11000, 11001, and so on.

Eerily, negative numbers are also represented with 1's and 0's but no sign. Consider counting from −1 downward: 11, 10, 1101, 1100, 1111, and so on.

Please help the cows convert ordinary decimal integers (range -2,000,000,000..2,000,000,000) to their counterpart representation in base −2.

Input

Line 1: A single integer to be converted to base −2

Output

Line 1: A single integer with no leading zeroes that is the input integer converted to base −2. The value 0 is expressed as 0, with exactly one 0.

Sample Input

-13

Sample Output

110111

Hint

Explanation of the sample:

Reading from right-to-left:
1*1 + 1*-2 + 1*4 + 0*-8 +1*16 + 1*-32 = -13
 棰樼洰鐨勬剰鎬濆氨鏄浣犳妸涓涓暟杞崲涓?2榪涘埗錛?br>鍩烘湰鍘熺悊:
               濡傛灉n涓哄鏁幫紝閭d箞鏈綅鑲畾涓?錛屽洜姝ゅ氨鍙互杞負姹?x-1)/-2 鐨勫瓙闂浜嗭紒 錛堥櫎浠?2鍙互綾繪瘮鍗佽繘鍒跺氨鑳界悊瑙d簡錛?br>               濡傛灉n涓哄伓鏁幫紝鏈綅蹇呬負0錛岀劧鍚庡啀杞負姹倄/-2鐨勫瓙闂錛?br>緇撴潫鏉′歡褰?n=1銆?br>鎬濊礬寰堢畝鍗曪紝浣嗘槸鏈変袱涓皬鏂歸潰瑕佹彁鎻愶紝涓瀹氳鑰冭檻n=0鐨勬儏鍐碉紝鎴戝氨鏄病鑰冭檻鑰屼竴鐩磋秴鏃訛紝閮侀椃錛岃繕鎵句笉鍑洪敊璇紝闄峰叆浜嗘寰幆鎬笉寰楄秴鏃訛紝榪樻湁娉ㄦ剰鐞冪殑緇撴灉鏄嗗簭鐨勶紒錛佸懙鍛典笅闈㈡槸浠g爜錛?br>
 1//============================================================================
 2// Name        : poj 3191.cpp
 3// Author      : worm
 4// Copyright   : Your copyright notice
 5// Description :鎶婁竴涓崄榪涘埗鐨勬暟杞崲涓?2榪涘埗鐨勬暟
 6//============================================================================
 7
 8#include <iostream>
 9#include <stdio.h>
10#include <string>
11#include <math.h>
12using namespace std;
13string a= "";
14int main() {
15    int x;
16    cin >> x;
17    if (x == 0{
18        cout <<"0"<<endl;
19        return 0;
20    }

21
22    while (x != 1{
23        if (abs(x) % 2 == 1{
24            a += '1';
25            x = (x-1)/-2;
26            continue;
27        }

28        a += '0';
29        x /= -2;
30    }

31    cout <<"1";
32    for (int i = a.length() - 1; i >= 0; i--{
33        printf("%c",a[i]);
34    }

35
36    return 0;
37}

38


WORM 2009-03-08 12:37 鍙戣〃璇勮
]]>
poj 3126 Prim Path 絎竴閬揃FShttp://www.shnenglu.com/worm/archive/2009/03/08/75880.htmlWORMWORMSun, 08 Mar 2009 02:36:00 GMThttp://www.shnenglu.com/worm/archive/2009/03/08/75880.htmlhttp://www.shnenglu.com/worm/comments/75880.htmlhttp://www.shnenglu.com/worm/archive/2009/03/08/75880.html#Feedback1http://www.shnenglu.com/worm/comments/commentRss/75880.htmlhttp://www.shnenglu.com/worm/services/trackbacks/75880.html鎸虹畝鍗曪紝鐪嬩唬鐮佸簲璇ュ彲浠ョ湅鎳傦紝涓嬮潰鏄唬鐮?
9#include <iostream>
10#include <queue>
11#include <math.h>
12using namespace std;
13int a, b;
14int p[9999= 0 };
15int visited[9999= 0 };
16bool isprime(int x) {
17
18    for (int i = 2; i <= sqrt((double) x); ++i) {
19        if (x % i == 0)
20            return false;
21    }

22    return true;
23}

24int BFS(int s, int r) {
25    queue<int> q;
26    q.push(s);
27    p[s] = 0;
28    visited[s] = 1;
29    while (!q.empty()) {
30        int temp = q.front();
31        q.pop();
32        for (int i = 0; i <= 9; i++{
33            int y1 = (temp / 10* 10 + i;
34            if (isprime(y1) && !visited[y1]) {
35                q.push(y1);
36                p[y1] = p[temp] + 1;
37                visited[y1] = 1;
38            }

39            int y2 = temp % 10 + (temp / 100* 100 + i * 10;
40            if (isprime(y2) && !visited[y2]) {
41                q.push(y2);
42                p[y2] = p[temp] + 1;
43                visited[y2] = 1;
44            }

45            int y3 = temp % 100 + (temp / 1000* 1000 + 100 * i;
46            if (isprime(y3) && !visited[y3]) {
47                q.push(y3);
48                p[y3] = p[temp] + 1;
49                visited[y3] = 1;
50            }

51            if (i != 0{
52                int y4 = temp % 1000 + i * 1000;
53                if (isprime(y4) && !visited[y4]) {
54                    q.push(y4);
55                    p[y4] = p[temp] + 1;
56                    visited[y4] = 1;
57                }

58            }

59            if (visited[r])
60                return p[r];
61        }

62
63    }

64    return 0;
65}

66int main() {
67    int n;
68    cin >> n;
69    while (n--{
70        memset(visited,0,sizeof(visited));
71        memset(p,0,sizeof(p));
72        cin >> a >> b;
73        cout << BFS(a, b) << endl;
74
75    }

76    return 0;
77}

78


WORM 2009-03-08 10:36 鍙戣〃璇勮
]]>
絎竴閬撳箍搴︽悳绱FS綰康 poj 3278 婧愪唬鐮?/title><link>http://www.shnenglu.com/worm/archive/2009/03/07/75838.html</link><dc:creator>WORM</dc:creator><author>WORM</author><pubDate>Sat, 07 Mar 2009 10:31:00 GMT</pubDate><guid>http://www.shnenglu.com/worm/archive/2009/03/07/75838.html</guid><wfw:comment>http://www.shnenglu.com/worm/comments/75838.html</wfw:comment><comments>http://www.shnenglu.com/worm/archive/2009/03/07/75838.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.shnenglu.com/worm/comments/commentRss/75838.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/worm/services/trackbacks/75838.html</trackback:ping><description><![CDATA[   鍙傝冧簡鍒漢鐨勬濊礬錛屽仛鍑轟簡絎竴閬揃FS錛岃櫧鐒跺湪澶х墰浠湅鏉ヤ笉灞戜竴欏?but about me,I really happy for it, I'm coming ! worm never give up!!<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080"> 1</span><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">//</span><span style="COLOR: #008000">============================================================================<br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Name        : poj.cpp<br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Author      :<br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Version     :<br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Copyright   : Your copyright notice<br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Description : Hello World in C++, Ansi-style<br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">============================================================================</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#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">10</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">queue</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></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">12</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>queue</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> q;<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">    result[</span><span style="COLOR: #000000">100001</span><span style="COLOR: #000000">];<br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img id=Codehighlighter1_419_421_Open_Image onclick="this.style.display='none'; Codehighlighter1_419_421_Open_Text.style.display='none'; Codehighlighter1_419_421_Closed_Image.style.display='inline'; Codehighlighter1_419_421_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_419_421_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_419_421_Closed_Text.style.display='none'; Codehighlighter1_419_421_Open_Image.style.display='inline'; Codehighlighter1_419_421_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> visited[</span><span style="COLOR: #000000">100001</span><span style="COLOR: #000000">] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span id=Codehighlighter1_419_421_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_419_421_Open_Text><span style="COLOR: #000000">{</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">}</span></span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img id=Codehighlighter1_451_976_Open_Image onclick="this.style.display='none'; Codehighlighter1_451_976_Open_Text.style.display='none'; Codehighlighter1_451_976_Closed_Image.style.display='inline'; Codehighlighter1_451_976_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_451_976_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_451_976_Closed_Text.style.display='none'; Codehighlighter1_451_976_Open_Image.style.display='inline'; Codehighlighter1_451_976_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> BFS(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> start,</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> end) </span><span id=Codehighlighter1_451_976_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_451_976_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (start </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> end)<br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </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">18</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    q.push(start);<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    result[start] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    visited[start] </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">21</span><span style="COLOR: #000000"><img id=Codehighlighter1_560_963_Open_Image onclick="this.style.display='none'; Codehighlighter1_560_963_Open_Text.style.display='none'; Codehighlighter1_560_963_Closed_Image.style.display='inline'; Codehighlighter1_560_963_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_560_963_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_560_963_Closed_Text.style.display='none'; Codehighlighter1_560_963_Open_Image.style.display='inline'; Codehighlighter1_560_963_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">q.empty()) </span><span id=Codehighlighter1_560_963_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_560_963_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> temp </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> q.front();<br></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        q.pop();<br></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> next;<br></span><span style="COLOR: #008080">25</span><span style="COLOR: #000000"><img id=Codehighlighter1_639_960_Open_Image onclick="this.style.display='none'; Codehighlighter1_639_960_Open_Text.style.display='none'; Codehighlighter1_639_960_Closed_Image.style.display='inline'; Codehighlighter1_639_960_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_639_960_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_639_960_Closed_Text.style.display='none'; Codehighlighter1_639_960_Open_Image.style.display='inline'; Codehighlighter1_639_960_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </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"> </span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">; </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">i) </span><span id=Codehighlighter1_639_960_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_639_960_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">26</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">if</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">)<br></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                next </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> temp </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">28</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (i </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">29</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                next </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> temp </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">30</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (i </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">31</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                next </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> temp</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">32</span><span style="COLOR: #000000"><img id=Codehighlighter1_780_799_Open_Image onclick="this.style.display='none'; Codehighlighter1_780_799_Open_Text.style.display='none'; Codehighlighter1_780_799_Closed_Image.style.display='inline'; Codehighlighter1_780_799_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_780_799_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_780_799_Closed_Text.style.display='none'; Codehighlighter1_780_799_Open_Image.style.display='inline'; Codehighlighter1_780_799_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(next </span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">100000</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">||</span><span style="COLOR: #000000"> next </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">) </span><span id=Codehighlighter1_780_799_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_780_799_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">33</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">continue</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">34</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">35</span><span style="COLOR: #000000"><img id=Codehighlighter1_828_911_Open_Image onclick="this.style.display='none'; Codehighlighter1_828_911_Open_Text.style.display='none'; Codehighlighter1_828_911_Closed_Image.style.display='inline'; Codehighlighter1_828_911_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_828_911_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_828_911_Closed_Text.style.display='none'; Codehighlighter1_828_911_Open_Image.style.display='inline'; Codehighlighter1_828_911_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (visited[next] </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">) </span><span id=Codehighlighter1_828_911_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_828_911_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">36</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                q.push(next);<br></span><span style="COLOR: #008080">37</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                result[next] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> result[temp] </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">38</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                visited[next] </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">39</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">40</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (next </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> end)<br></span><span style="COLOR: #008080">41</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> result[next];<br></span><span style="COLOR: #008080">42</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">43</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">44</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </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">45</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">46</span><span style="COLOR: #000000"><img id=Codehighlighter1_989_1055_Open_Image onclick="this.style.display='none'; Codehighlighter1_989_1055_Open_Text.style.display='none'; Codehighlighter1_989_1055_Closed_Image.style.display='inline'; Codehighlighter1_989_1055_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_989_1055_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_989_1055_Closed_Text.style.display='none'; Codehighlighter1_989_1055_Open_Image.style.display='inline'; Codehighlighter1_989_1055_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main() </span><span id=Codehighlighter1_989_1055_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_989_1055_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">47</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> n,k;<br></span><span style="COLOR: #008080">48</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    cin </span><span style="COLOR: #000000">>></span><span style="COLOR: #000000"> n </span><span style="COLOR: #000000">>></span><span style="COLOR: #000000"> k;<br></span><span style="COLOR: #008080">49</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> BFS(n,k) </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br></span><span style="COLOR: #008080">50</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </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">51</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">52</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <img src ="http://www.shnenglu.com/worm/aggbug/75838.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/worm/" target="_blank">WORM</a> 2009-03-07 18:31 <a href="http://www.shnenglu.com/worm/archive/2009/03/07/75838.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>poj 3705瑙i鎬濊礬鍙婃簮浠g爜http://www.shnenglu.com/worm/archive/2009/03/06/75700.htmlWORMWORMFri, 06 Mar 2009 00:52:00 GMThttp://www.shnenglu.com/worm/archive/2009/03/06/75700.htmlhttp://www.shnenglu.com/worm/comments/75700.htmlhttp://www.shnenglu.com/worm/archive/2009/03/06/75700.html#Feedback0http://www.shnenglu.com/worm/comments/commentRss/75700.htmlhttp://www.shnenglu.com/worm/services/trackbacks/75700.html 1//============================================================================
 2// Name        : poj.cpp
 3// Author      :
 4// Version     :
 5// Copyright   : Your copyright notice
 6// Description : 棰樼洰澶ф剰灝辨槸灝嗘搴忔暟鍒?,2,3,,n,閫氳繃鏈灝戠殑“澶嶅埗綺樿創”鏁?br> 7// 鍙樹負閫嗗簭搴忓垪鐨勯棶棰樸?br> 8//鍩烘湰鎬濇兂錛?nbsp; 濡傛灉n涓哄鏁幫紝鍋囪n = 7錛?br> 9// 1 2 3 4 5 6 7          灝唍宸﹁竟鐨勬渶涓棿鐨勪袱涓暟渚濇縐誨埌7鐨勫彸杈?br>10// 1 2 5 6 7 3 4       鐨勬渶涓棿
11// 1 6 7 3 2 5 4
12// 7 3 2 1 6 5 4          灝?nbsp;3 2 1涓?nbsp;6 5 4 浜ゆ崲
13// 7 6 5 4 3 2 1
14//鎬葷殑嬈℃暟涓?n+1)/2;
15// n =  鍋舵暟鏃訛紝鍙互鍏堟妸n涓嶇錛岃繖鏍穘-1灝變負濂囨暟鐨勬儏鍐碉紝姹傚嚭鍚庣殑搴忓垪鍦ㄥ拰n浜ゆ崲涓涓?br>16//鍗沖彲錛岀粨鏋滀負n/2 + 1;
17//============================================================================
18
19#include <iostream>
20using namespace std;
21void solve(int n) {
22    int x = (n+1)/2 - 1;
23    int y = n;
24    for (int i = 0; i < x; ++i) {
25        cout << n/2 << " " << 2 << " " << y-2-<< endl;
26        n -= 2;
27    }

28    cout <<"" << x << " " << x + 1 << endl;
29}

30
31int main() {
32    int n;
33    cin >> n;
34    if (n == 1{
35        cout << 0 <<endl;
36        return 0;
37    }

38    if (n == 2{
39        cout << "1" <<endl;
40        cout << "1 1 1" <<endl;
41        return 0;
42    }

43    if (n % 2 != 0{
44        cout << (n+1)/2 <<endl;
45         solve(n);
46    }

47    else {
48        cout << n/2 + 1 << endl;
49        solve(n-1);
50        cout << 1 << " "<< n-1 <<" 1" <<endl;
51    }

52
53    return 0;
54}

55
鏈鍚庝竴瀹氳娉ㄦ剰1 鍜?2 鐨勬儏鍐碉紝鎴戝洜涓哄繕浜嗚冭檻錛寃a浜嗗嚑嬈★紝鍛靛懙...

WORM 2009-03-06 08:52 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            欧美激情中文不卡| 欧美国产亚洲视频| 在线亚洲精品| 免费人成网站在线观看欧美高清| 校园春色国产精品| 欧美成人国产va精品日本一级| 欧美一区二区三区电影在线观看| 免费日韩av片| 欧美mv日韩mv国产网站app| 国产毛片一区二区| 亚洲视频在线观看一区| 一二三四社区欧美黄| 欧美高清视频在线播放| 免费成人在线视频网站| 在线观看日韩| 久久视频在线看| 美女福利精品视频| 极品少妇一区二区三区精品视频 | 中文一区二区在线观看| 欧美电影在线观看完整版| 欧美电影免费观看大全| 136国产福利精品导航网址| 久久精品一区二区三区四区 | 国产欧美精品久久| 亚洲砖区区免费| 欧美一区二区视频观看视频| 国产精品综合| 亚洲欧美日韩一区二区| 欧美主播一区二区三区美女 久久精品人 | 久久久久国内| 激情成人综合网| 久久婷婷色综合| 亚洲国产岛国毛片在线| 亚洲福利在线视频| 欧美激情第10页| 亚洲午夜精品网| 久久久精品性| 最新亚洲视频| 国产精品成人播放| 欧美一区二区三区在线免费观看 | 欧美精品大片| 一区二区三区久久网| 欧美在线综合视频| **欧美日韩vr在线| 欧美精品在线网站| 亚洲午夜一区二区| 久久综合成人精品亚洲另类欧美| 亚洲国产精品久久久久婷婷884| 欧美成人综合网站| 亚洲素人一区二区| 美国十次成人| 亚洲午夜视频在线观看| 国产片一区二区| 欧美成人精品一区二区| 亚洲一区二区四区| 欧美国产精品劲爆| 欧美与黑人午夜性猛交久久久| 黄色成人免费观看| 欧美日韩一二三区| 久久综合色婷婷| 一区二区三区四区蜜桃| 免费的成人av| 午夜精品久久久久久99热| 亚洲观看高清完整版在线观看| 欧美日韩国产a| 久久久久成人精品免费播放动漫| 亚洲高清成人| 久久精视频免费在线久久完整在线看 | 国产日韩欧美一区在线| 欧美高清视频一二三区| 亚洲影视在线播放| 亚洲精品日韩激情在线电影| 久久精品一本久久99精品| 日韩一区二区久久| 亚洲国产99| 国产午夜精品视频免费不卡69堂| 欧美福利电影网| 久久久久久一区二区| 亚洲综合999| 亚洲精品国产精品久久清纯直播| 久久久精彩视频| 午夜精品久久久久久99热| av成人免费观看| 亚洲欧洲一区二区三区久久| 国产亚洲精品aa| 国产精品久久久爽爽爽麻豆色哟哟| 免费观看在线综合色| 亚洲欧美精品在线| 一区二区三区欧美| 99在线精品观看| 亚洲片在线观看| 亚洲国产精品女人久久久| 蜜桃av一区二区| 裸体丰满少妇做受久久99精品 | 亚洲国产精品黑人久久久| 久久久夜精品| 久久天堂av综合合色| 欧美在线观看你懂的| 午夜精品福利视频| 亚洲欧美中文日韩在线| 亚洲免费一在线| 亚洲永久免费视频| 亚洲欧美日产图| 性色av一区二区三区| 欧美一区精品| 久久精品国产成人| 久久久久天天天天| 免费欧美电影| 欧美激情第一页xxx| 欧美激情无毛| 亚洲精品一区二区三区99| 亚洲三级影院| 亚洲午夜电影| 亚洲欧美日韩精品在线| 午夜久久资源| 久久精品在线| 欧美黄色片免费观看| 欧美日韩精品免费| 国产精品国产精品国产专区不蜜| 国产精品成人一区二区三区吃奶 | 亚洲啪啪91| 一本色道久久综合狠狠躁的推荐| 日韩一本二本av| 香蕉成人久久| 巨乳诱惑日韩免费av| 亚洲风情在线资源站| 亚洲精品视频一区二区三区| 99国产精品久久久久久久成人热 | 国产伦一区二区三区色一情| 国产一区二区三区久久久| 亚洲国产成人一区| 亚洲午夜羞羞片| 久久久高清一区二区三区| 免费成人美女女| 一本色道久久| 久久久免费观看视频| 欧美~级网站不卡| 国产精品h在线观看| 国产综合亚洲精品一区二| 亚洲人成人一区二区三区| 亚洲欧美日韩在线播放| 美女精品一区| 亚洲美女色禁图| 久久疯狂做爰流白浆xx| 欧美精品一区二区三区在线看午夜 | 欧美在线不卡视频| 欧美激情亚洲激情| 亚洲在线网站| 欧美日韩八区| 在线欧美一区| 欧美一区二区在线| 亚洲福利在线视频| 欧美一级黄色网| 欧美日韩精品系列| 亚洲电影激情视频网站| 午夜精品久久久久久久蜜桃app| 欧美电影电视剧在线观看| 亚洲专区在线| 欧美视频1区| 亚洲欧洲视频| 另类图片综合电影| 性色av一区二区三区| 欧美日韩视频专区在线播放 | 宅男66日本亚洲欧美视频| 免费日韩av| 午夜亚洲福利在线老司机| 欧美激情精品久久久六区热门 | 嫩草影视亚洲| 在线高清一区| 久久亚洲精品视频| 亚洲专区一区| 国产精品久久久久久久久免费| 亚洲精品久久7777| 免费影视亚洲| 久久久久久精| 国产亚洲成年网址在线观看| 亚洲字幕一区二区| 亚洲精品在线观看免费| 另类激情亚洲| 在线精品亚洲| 狂野欧美性猛交xxxx巴西| 欧美在线视频a| 国产婷婷一区二区| 欧美在线视频一区二区| 亚洲影院色在线观看免费| 欧美亚一区二区| 亚洲一二三区在线观看| 99精品福利视频| 欧美视频1区| 亚洲欧美成人综合| 一区二区三区色| 国产精品qvod| 久久精品国产精品亚洲精品| 午夜精品一区二区三区在线 | 亚洲经典三级| 亚洲人成在线观看一区二区| 欧美理论大片| 亚洲欧美怡红院| 欧美亚洲三区| 在线日本成人|