锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品18,久久久久亚洲Av无码专,久久久久久国产a免费观看不卡http://www.shnenglu.com/yesg/category/19621.htmlzh-cnFri, 13 Jul 2012 07:15:50 GMTFri, 13 Jul 2012 07:15:50 GMT60鎵╁睍嬈у嚑閲屽痙鍜屼腑鍥藉墿浣欏畾鐞?/title><link>http://www.shnenglu.com/yesg/archive/2012/06/02/177192.html</link><dc:creator>nk_ysg</dc:creator><author>nk_ysg</author><pubDate>Sat, 02 Jun 2012 06:31:00 GMT</pubDate><guid>http://www.shnenglu.com/yesg/archive/2012/06/02/177192.html</guid><wfw:comment>http://www.shnenglu.com/yesg/comments/177192.html</wfw:comment><comments>http://www.shnenglu.com/yesg/archive/2012/06/02/177192.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/yesg/comments/commentRss/177192.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/yesg/services/trackbacks/177192.html</trackback:ping><description><![CDATA[<div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008000; ">/*</span><span style="color: #008000; "><br /></span><span style="color: #008000; ">*/</span><br />#include <iostream><br /><span style="color: #0000FF; ">using</span> <span style="color: #0000FF; ">namespace</span> std;<br /><br /><span style="color: #008000; ">/*</span><span style="color: #008000; "><br />娉ㄦ剰鍒板浜巊cd(a,b) = d 鎴戜滑瀵?a, b)鐢ㄦ鍑犻噷寰瘋緱杞浉闄や細鏈緇堝緱鍒?br />(d, 0)姝ゆ椂瀵逛簬鎶奱 =d, b = 0 甯﹀叆a*x + b*y = d錛屾樉鐒秞 = 1錛寉鍙互涓轟換鎰忓鹼紝<br />榪欓噷y鍙互涓轟換鎰忓煎氨鎰忓懗鐫瑙d細鏈夋棤鏁頒釜銆傛垜浠彲浠ョ敤a = d, b = 0鐨勬儏鍐甸嗘帹鍑烘潵<br />浠諱綍gcd(a, b) = d 婊¤凍a*x + b*y = d鐨勮В銆傚鏋渪0, y0鏄痓*x + (a%b)*y = d 鐨勮В錛?br />閭d箞瀵逛簬a*x + b*y = d鐨勮В鍛紵<br />b*x0 + (a%b)*y0 = d => b*x0 + (a - [a/b]*b)*y0 = a*y0 + b*(x0 - [a/b]*y0)錛?br />鎵浠*x + b*y = d鐨勮Вx1 = y0錛?nbsp;y1 = x0 - [a/b]*y0; 榪欐牱鎴戜滑鍙互紼嬪簭榪甫浜嗐?br /></span><span style="color: #008000; ">*/</span><br /><span style="color: #0000FF; ">int</span> extEuclid(<span style="color: #0000FF; ">int</span> a, <span style="color: #0000FF; ">int</span> b, <span style="color: #0000FF; ">int</span> &x, <span style="color: #0000FF; ">int</span> &y)<br />{<br />    <span style="color: #0000FF; ">if</span> (b == 0)<br />    {<br />        x = 1;<br />        y = 0;<br />        <span style="color: #0000FF; ">return</span> a;<br />    }<br />    <span style="color: #0000FF; ">int</span> d = extEuclid(b, a % b, x, y);<br />    <span style="color: #0000FF; ">int</span> iTemp = x;<br />    x = y;<br />    y = iTemp - (a / b)* y;<br />    <span style="color: #0000FF; ">return</span> d;<br />}<br /><span style="color: #008000; ">//</span><span style="color: #008000; ">瑙e悓浣欐柟紼媋x = b(mod n) (榪斿洖鏈灝忕殑姝f暟x)</span><span style="color: #008000; "><br /></span><br /><span style="color: #0000FF; ">int</span> modularLinearEquation(<span style="color: #0000FF; ">int</span> a, <span style="color: #0000FF; ">int</span> b, <span style="color: #0000FF; ">int</span> n)<br />{<br />    <span style="color: #008000; ">//</span><span style="color: #008000; ">絳変環浜庢眰ax + cn = b;<br />    </span><span style="color: #008000; ">//</span><span style="color: #008000; ">鍏堟眰a*x1 + c1*n = gcd(a, n)</span><span style="color: #008000; "><br /></span>    <span style="color: #0000FF; ">int</span> x, y, d;<br />    d = extEuclid(a, n, x, y);<br />    <span style="color: #0000FF; ">if</span> (b % d != 0)<br />       <span style="color: #0000FF; ">return</span> -1;<br />    x = x * (b / d);<br />    x = (( x % n) + n) % n;<br />    <span style="color: #0000FF; ">return</span> x;<br />}<br /><br /><span style="color: #008000; ">//</span><span style="color: #008000; ">涓浗鍓╀綑瀹氱悊錛屾帹瀵奸兘鏄暟瀛?/span><span style="color: #008000; "><br /></span><span style="color: #0000FF; ">int</span> solModularEquations(<span style="color: #0000FF; ">int</span> b[], <span style="color: #0000FF; ">int</span> m[], <span style="color: #0000FF; ">int</span> k)<br />{<br /><br />    <span style="color: #0000FF; ">int</span> iTemp;<br />    <span style="color: #0000FF; ">int</span> y;<br />    <span style="color: #0000FF; ">int</span> result;<br /><br />    <span style="color: #0000FF; ">int</span> M = 1;<br />    <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i = 0; i < k; i++)<br />      M *= m[i];<br /><br />    result = 0;<br />    <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">int</span> i = 0; i < k; i++)<br />    {<br />      iTemp = M / m[i];<br />      y = modularLinearEquation(iTemp, 1, m[i]);<br />      result = (result + b[i] * iTemp * y) % M;<br />    }<br />    <span style="color: #0000FF; ">return</span> result;<br />}<br /><br /><span style="color: #0000FF; ">int</span> main()<br />{<br />    <span style="color: #0000FF; ">int</span> x, y , d;<br />    d = extEuclid(1001, 767, x, y);<br />    cout << x << endl;<br />    cout << y << endl;<br />    cout << d << endl;<br />    cout << "1001 * x + 767 * y = " << (1001 * x + 767 * y) << endl;<br />    cout << modularLinearEquation(3, 2, 100) << endl;<br />    <span style="color: #0000FF; ">return</span> 0;<br />}</div><img src ="http://www.shnenglu.com/yesg/aggbug/177192.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/yesg/" target="_blank">nk_ysg</a> 2012-06-02 14:31 <a href="http://www.shnenglu.com/yesg/archive/2012/06/02/177192.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏁板瓧涓夎褰?璁板繂鍖栨悳绱㈠拰閫掑綊)http://www.shnenglu.com/yesg/archive/2011/10/08/157731.htmlnk_ysgnk_ysgFri, 07 Oct 2011 17:24:00 GMThttp://www.shnenglu.com/yesg/archive/2011/10/08/157731.htmlhttp://www.shnenglu.com/yesg/comments/157731.htmlhttp://www.shnenglu.com/yesg/archive/2011/10/08/157731.html#Feedback0http://www.shnenglu.com/yesg/comments/commentRss/157731.htmlhttp://www.shnenglu.com/yesg/services/trackbacks/157731.html/*
緇欏畾涓涓敱n琛屾暟瀛楃粍鎴愮殑鏁板瓧涓夎褰㈠涓嬪浘鎵紺恒?br />璇曡璁′竴涓畻娉曪紝璁$畻鍑轟粠涓夎褰㈢殑欏惰嚦搴曠殑涓鏉¤礬寰勶紝浣胯璺緞緇忚繃鐨勬暟瀛楁誨拰
瀵逛簬緇欏畾鐨勭敱n琛屾暟瀛楃粍鎴愮殑鏁板瓧涓夎褰紝
緙栫▼璁$畻浠庝笁瑙掑艦鐨勯《鑷沖簳鐨勮礬寰勭粡榪囩殑鏁板瓧鍜岀殑鏈澶у?br /> 
*/
#include 
<stdio.h>
#include 
<string.h>

const int MAXN = 100 + 10;

int a[MAXN][MAXN],d[MAXN][MAXN];
int n;

inline 
int max(int a,int b) { return a > b ? a : b;}

int dfs(int i,int j)
{
    
if (d[i][j] >= 0return d[i][j];
    
return d[i][j] = a[i][j] + (i == n ? 0 : max(dfs(i+1,j),dfs(i+1,j+1)));
}

int main()
{
    
int i;
    
int j;
    freopen(
"1.txt","r",stdin);
    
while (scanf("%d",&n) != EOF)
    {
        memset(d,
-1,sizeof(d));
        
for (i = 1; i <= n; ++i)
        {
            
for (j = 1; j <= i; ++j)
                scanf(
"%d",&a[i][j]);
        }
        printf(
"%d\n",dfs(1,1));
    }
    
return 0;
}

#include <stdio.h>

const int MAXN = 100 + 10;

int a[MAXN][MAXN],d[MAXN][MAXN];

int n;

inline 
int max(int a, int b) { return a > b ? a : b; }

int main()
{
    
int i,j;
    freopen(
"1.txt","r",stdin);
    
while (scanf("%d",&n) != EOF)
    {
        
for (i = 1; i <= n; ++i)
            
for (j = 1; j <= i; ++j)
                scanf(
"%d",&a[i][j]);

        
for (j = 1; j <= n; j++) d[n][j] = a[n][j];
        
for (i = n - 1; i >= 1; i--)
            
for (j = 1; j <= i; j++)
                d[i][j] 
= a[i][j] + max(d[i+1][j],d[i+1][j+1]);
        printf(
"%d\n",d[1][1]);
    }

    
return 0;
}



nk_ysg 2011-10-08 01:24 鍙戣〃璇勮
]]>
鍒嗘暟鎷嗗垎http://www.shnenglu.com/yesg/archive/2011/10/07/157701.htmlnk_ysgnk_ysgFri, 07 Oct 2011 09:04:00 GMThttp://www.shnenglu.com/yesg/archive/2011/10/07/157701.htmlhttp://www.shnenglu.com/yesg/comments/157701.htmlhttp://www.shnenglu.com/yesg/archive/2011/10/07/157701.html#Feedback0http://www.shnenglu.com/yesg/comments/commentRss/157701.htmlhttp://www.shnenglu.com/yesg/services/trackbacks/157701.html 1 /*
 2 杈撳叆姝f暣鏁発,鎵懼埌鎵鏈夌殑姝f暣鏁皒>=y,浣垮緱1/k = 1/x + 1/y.
 3 鏍蜂緥杈撳叆:
 4 2
 5 12
 6 鏍蜂緥杈撳嚭
 7 2
 8 1/2=1/6+1/3
 9 1/2=1/4+1/4
10 
11 8
12 1/12 = 1/156 + 1/13
13 1/12 = 1/84 + 1/14
14 1/12 = 1/60 + 1/15
15 1/12 = 1/48 + 1/16
16 1/12 = 1/36 + 1/18
17 1/12 = 1/30 + 1/20
18 1/12 = 1/28 + 1/21
19 1/12 = 1/24 + 1/24
20 */
21 #include <stdio.h>
22 
23 const int MAXN = 1000 + 10;
24 int x[MAXN],y[MAXN];
25 
26 int main()
27 {
28     int k;
29     int ans;
30     int i;
31     while (scanf("%d",&k) != EOF)
32     {
33         ans = 0;
34         for (i = k + 1; i <= 2*k; ++i)
35         {
36             if ((k * i) % (i-k) == 0) { x[ans] = (k*i)/(i-k),y[ans++= i; } 
37         }
38         printf("%d\n",ans);
39         for (i = 0; i < ans; ++i)
40         {
41             printf("1/%d = 1/%d + 1/%d\n",k,x[i],y[i]);
42         }
43     }
44     return 0;
45 }
46 

nk_ysg 2011-10-07 17:04 鍙戣〃璇勮
]]>
鎷撴墤鎺掑簭(鎰熻阿RoBa鍜孨OCOW)http://www.shnenglu.com/yesg/archive/2011/10/06/157651.htmlnk_ysgnk_ysgThu, 06 Oct 2011 11:19:00 GMThttp://www.shnenglu.com/yesg/archive/2011/10/06/157651.htmlhttp://www.shnenglu.com/yesg/comments/157651.htmlhttp://www.shnenglu.com/yesg/archive/2011/10/06/157651.html#Feedback0http://www.shnenglu.com/yesg/comments/commentRss/157651.htmlhttp://www.shnenglu.com/yesg/services/trackbacks/157651.html


Genealogical tree. 瀹惰氨鏍? Time Limit: 1 second Memory Limit: 16M


Background 澶ф剰錛氱伀鏄熶漢鐨勭鏃忓叧緋繪瘮杈冩販涔便傚畻鏃忕鐞嗗鍛樹細榪涜寮浼氬彂璦絳夋椿鍔ㄦ椂錛屽張鎯抽伒瀹堝厛闀胯緢錛屽悗鏅氳緢鐨勯『搴忋?浜庢槸鏈変笅闈㈢殑闂錛?

Problem 緙栧啓涓涓▼搴忓緇欏畾鐨勪漢鍛橈紝鍐沖畾涓涓厛鍚庨『搴忥紝 榪欎釜欏哄簭蹇呴』閬靛畧鍏堥暱杈堬紝鍚庢櫄杈堢殑鍘熷垯銆?

Input 棣栬涓篘錛?1 <= N <= 100 ,N涓烘諱漢鏁般傛牴鎹櫨騫翠紶緇燂紝緇欎漢鍛樼敤鑷劧鏁扮紪鍙蜂負1鑷砃銆備互涓嬬殑N琛岋紝絎琁琛屼負絎琁涓漢鐨勫瓙瀛欏垪琛紝瀛愬瓩鐨勯『搴忔槸浠繪剰鐨勶紝鐢ㄧ┖鏍奸殧寮錛屼笖浠?涓虹粨鏉熴傚瓙瀛欏垪琛ㄥ彲浠ユ槸絀虹殑銆?

Output 鍦ㄤ竴琛屽唴杈撳嚭鍙戣█鐨勯『搴忋?濡傛湁澶氫釜欏哄簭婊¤凍鏉′歡錛屽垯杈撳嚭浠諱竴涓傝嚦灝戜細鏈変竴涓弧瓚崇殑欏哄簭鐨勩?

Sample Input

5 0 4 5 1 0 1 0 5 3 0 3 0

Sample Output

2 4 5 3 1
/* URAL 1022 Genealogical tree
 * 900803 09:04:18 21 Aug 2005 RoBa 1022 C++ Accepted 0.001 190 KB 
 * 鎷撴墤鎺掑簭 
 
*/
 
#include 
<stdio.h>
#include 
<stdlib.h>
#include 
<string.h>

const int MAX = 101;
int map[MAX][MAX],inde[MAX],taken[MAX];

int main()
{
    
int i,n,tmp,j;
    
while (scanf("%d",&n)!=EOF)
    {
        memset(map,
0,sizeof(map));
        memset(inde,
0,sizeof(inde));
        
for (i = 1 ; i <= n ; i++)
            
while (scanf("%d",&tmp),tmp)
            {
                map[i][tmp] 
= 1;
                
++inde[tmp];
            }
        
while (1)
        {
            
for (i = 1 ; i <= n ; i++)
                
if (inde[i] == 0 && taken[i] == 0break;
            
if (i > n) break;
            
for (j = 1 ; j <= n ; j++)
                
if (map[i][j])
                {
                    map[i][j] 
= 0;
                    
--inde[j];
                }
            taken[i] 
= 1;
            printf(
"%d ",i);   
        }
        printf(
"\n");
    }
    
return 0;
}               


nk_ysg 2011-10-06 19:19 鍙戣〃璇勮
]]>
久久一区二区三区99| 久久久久这里只有精品| 久久婷婷国产综合精品| 亚洲伊人久久精品影院| 久久久久综合中文字幕| 久久精品国产99久久久古代| 久久久一本精品99久久精品66| 久久久国产精品福利免费| 四虎亚洲国产成人久久精品| 日韩精品久久无码人妻中文字幕 | 久久国产成人| 国产亚洲精久久久久久无码77777 国产亚洲精品久久久久秋霞 | 久久精品成人免费网站| 久久精品亚洲福利| 99精品国产在热久久| 久久无码专区国产精品发布| 国内精品久久久久久久久电影网| 亚洲国产天堂久久综合| 色综合久久最新中文字幕| 麻豆成人久久精品二区三区免费| 久久精品国产亚洲7777| 国内精品伊人久久久久| 久久国产乱子伦免费精品| 精品国产青草久久久久福利| 久久久精品无码专区不卡| 欧美亚洲国产精品久久蜜芽| 亚洲AV无一区二区三区久久| 色播久久人人爽人人爽人人片AV| 亚洲国产精品婷婷久久| 国产精品久久久久天天影视| 天天躁日日躁狠狠久久| 99久久无色码中文字幕人妻| 亚洲精品乱码久久久久久不卡| 久久精品国产亚洲Aⅴ蜜臀色欲| 久久99精品国产麻豆宅宅| 久久91亚洲人成电影网站| 久久精品国产亚洲AV麻豆网站 | 久久激情五月丁香伊人| 久久精品国产一区二区三区不卡| 久久九九青青国产精品| 久久久久久久综合日本亚洲 |