锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品中文騷妇女内射,亚洲∧v久久久无码精品,久久99精品久久久久久久不卡http://www.shnenglu.com/doer-xee/category/12416.htmlOne step and One step...zh-cnWed, 02 Dec 2009 13:50:30 GMTWed, 02 Dec 2009 13:50:30 GMT60HDU 1787 GCD Again 錛堟鎷夊嚱鏁幫級http://www.shnenglu.com/doer-xee/archive/2009/12/02/102408.html瑗塊钀х憻瑗塊钀х憻Wed, 02 Dec 2009 12:34:00 GMThttp://www.shnenglu.com/doer-xee/archive/2009/12/02/102408.htmlhttp://www.shnenglu.com/doer-xee/comments/102408.htmlhttp://www.shnenglu.com/doer-xee/archive/2009/12/02/102408.html#Feedback0http://www.shnenglu.com/doer-xee/comments/commentRss/102408.htmlhttp://www.shnenglu.com/doer-xee/services/trackbacks/102408.htmlhttp://acm.hdu.edu.cn/showproblem.php?pid=1787

/***
count the number of the integers M (0<M<N) which satisfies gcd(N,M)>1.
鍗籌細N - 1 - phi(N)
  
鐢變簬1<N<100000000, 涓嶈偗鑳介澶勭悊鎵鏈夌殑嬈ф媺鍑芥暟
閲囩敤嬈ф媺鎬ц川錛?br>    1.鑻鏄川鏁皃鐨刱嬈″箓錛?#966;錛坣錛? 錛坧-1錛塸^(k-1)
    2.鑻錛宯浜掕川錛?#966;錛坢n錛? φ(m)φ(n)

鑻?nbsp;n =p1^a1 * p2^a2 ** pn^an
鍒?nbsp;  phi(n)    = (p1-1)*p1^(a1-1) * (p2-1)*p2^(a2-1) ** (pn-1)*pn^(an-1)
            = N * (p1-1)*(p2-2)**(pn-1)/(p1*p2**pn)
*
*/

#include 
<stdio.h>
#define N 10001
__int64 p[
5000];
int hash[10001];
int main()
{
    __int64 i, j, ans, n, m, temp;
    
    p[
0= 1//璁板綍绱犳暟涓暟
    p[1= 2;
    
for (i=3; i<N; i+=2)
    {
        
if (hash[i])
            
continue;
        p[
++p[0]] = i;
        
for (j=i*i; j<N; j+=i)
            hash[j] 
= 1;
    } 
//絳涚礌鏁?nbsp;   
    
    
    
while (scanf("%I64d"&n), n)
    {        
        ans 
= 1;
        m 
= n;        
        
for (i=1; p[i]<=&& i<=p[0]; i++)
            
if (m%p[i]==0)
            {
                temp 
= 1;
                
while (m%p[i] == 0)
                {
                    m 
/= p[i];
                    temp 
*= p[i];
                }
                temp 
/= p[i];
                ans
*=(p[i]-1)*temp;
            }
        
if (m>1)
        {
            ans 
*= (m-1);
        }    
//濡傛灉鍓╀笅閭d釜鏁板ぇ浜?,m涓哄ぇ浜?0000鐨勮川鏁?/span>
        
        printf(
"%I64d\n", n-ans-1);
    }





瑗塊钀х憻 2009-12-02 20:34 鍙戣〃璇勮
]]>
hdu2824 The Euler function 嬈ф媺鍑芥暟http://www.shnenglu.com/doer-xee/archive/2009/12/01/102353.html瑗塊钀х憻瑗塊钀х憻Tue, 01 Dec 2009 11:21:00 GMThttp://www.shnenglu.com/doer-xee/archive/2009/12/01/102353.htmlhttp://www.shnenglu.com/doer-xee/comments/102353.htmlhttp://www.shnenglu.com/doer-xee/archive/2009/12/01/102353.html#Feedback0http://www.shnenglu.com/doer-xee/comments/commentRss/102353.htmlhttp://www.shnenglu.com/doer-xee/services/trackbacks/102353.html
瀹氫箟錛?nbsp;   瀵逛簬姝f暣鏁皀錛?#966;(n)鏄皬浜庢垨絳変簬n鐨勬鏁存暟涓紝涓巒浜掕川鐨勬暟鐨勬暟鐩紱
                渚嬪: φ(
8= 4, 鍥犱負1錛?/span>3錛?/span>5錛?鍧囧拰8浜掕川銆?br>鎬ц川錛?nbsp; 1.    鑻鏄川鏁幫紝φ錛坧錛?/span>= p-1.
               2.    鑻鏄川鏁皃鐨刱嬈″箓錛?#966;錛坣錛?/span>= 錛坧-1錛塸^(k-1)   
                        鍥犱負闄や簡p鐨勫嶆暟閮戒笌n浜掕川
               3.    嬈ф媺鍑芥暟鏄Н鎬у嚱鏁幫紝鑻錛宯浜掕川錛?#966;錛坢n錛?/span>= φ(m)φ(n)
               鏍規嵁榪?鏉℃ц川鎴戜滑灝卞彲浠ラ鍑轟竴涓暣鏁扮殑嬈ф媺鍑芥暟鐨勫叕寮忥紝鍥犱負涓涓暟鎬誨彲浠ヤ竴浜涜川鏁扮殑涔樼Н鐨勫艦寮忋?br>               E(k) 
= (p1-1)(p2-1)…(pi-1)*(p1^(a1-1))(p2^(a2-1))…(pi^(ai-1))
                        
= k*(p1-1)(p2-1)…(pi-1)/(p1*p2*…pi)
      
                  = k*(1-1/p1)*(1-1/p2)…(1-1/pk)
鍦ㄧ▼搴忎腑鍒╃敤嬈ф媺鍑芥暟濡備笅鎬ц川錛屽彲浠ュ揩閫熸眰鍑烘鎷夊嚱鏁扮殑鍊?a涓篘鐨勮川鍥犵礌) 
鑻?N
%a==0 && (N/a)%a==0) 鍒欐湁:E(N)=E(N/a)*a;          
鑻?N
%a==0 && (N/a)%a!=0) 鍒欐湁:E(N)=E(N/a)*(a-1);

浠ヤ笅鏄?縐嶆眰嬈ф媺鍑芥暟鐨勭畻娉?br>
 1 void init()
 2 {
 3     __int64 i,j;
 4     e[1= 1;
 5     for(i=2;i<=N;i++)
 6         if(!e[i])
 7         {             
 8             for(j=i; j<=N; j+=i)
 9             {    
10                 if (!e[j])
11                     e[j] = j;
12                 e[j] = e[j] / i * (i-1);
13             }    
14         }
15 }


鍒╃敤绱犳暟絳涢夛細
void init()
{
    __int64 i, j;
    
    p[
0= 1//璁板綍绱犳暟涓暟
    p[1= 2;
    
for (i=3; i<N; i+=2)
    {
        
if (hash[i])
            
continue;
        p[
++p[0]] = i;
        
for (j=i*i; j<N; j+=i)
            hash[j] 
= true;
    } 
//絳涚礌鏁?/span>
    
    e[
1= 1;

    
for (i=1; i<=p[0]; i++)
        e[p[i]] 
= p[i] - 1//鍒濆鍖栫礌鏁扮殑phi

    
for (i=2; i<N; i++)
    {
        
if(!e[i])
        {
            
for (j=1; j<=p[0]; j++)
                
if (i % p[j]==0)
                {
                    
if (i / p[j] % p[j])
                        e[i] 
= e[i / p[j]] * e[p[j]];
                    
else
                        e[i] 
= e[i / p[j] ]* p[j];
                    
break;
                } 
// 鍒╃敤涓婅堪鎬ц川姹傝В
        }        
    }
    
return ;
}

鏄庢樉絎竴縐嶇殑緙栫▼澶嶆潅搴﹁浣庡緢澶?br>鎵浠ワ紝涓鑸儏鍐典笅錛圢涓嶆槸寰堝ぇ錛夛紝閲囩敤絎竴縐嶅嵆鍙紱
璐村湪榪欓噷渚涗互鍚庡涔?img border=0 src="http://www.shnenglu.com/Emoticons/QQ/13.gif" width=20 height=20>


瑗塊钀х憻 2009-12-01 19:21 鍙戣〃璇勮
]]>
hdu3215 The first place of 2^n錛堝鏁版濇兂錛?/title><link>http://www.shnenglu.com/doer-xee/archive/2009/11/27/102056.html</link><dc:creator>瑗塊钀х憻</dc:creator><author>瑗塊钀х憻</author><pubDate>Fri, 27 Nov 2009 06:25:00 GMT</pubDate><guid>http://www.shnenglu.com/doer-xee/archive/2009/11/27/102056.html</guid><wfw:comment>http://www.shnenglu.com/doer-xee/comments/102056.html</wfw:comment><comments>http://www.shnenglu.com/doer-xee/archive/2009/11/27/102056.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/doer-xee/comments/commentRss/102056.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/doer-xee/services/trackbacks/102056.html</trackback:ping><description><![CDATA[<a >http://acm.hdu.edu.cn/showproblem.php?pid=3215</a><br>棰樼洰澶ф剰鏄綆?^0鍒?^n涓瘡涓暟鐨勬渶宸﹁竟涓浣嶏紝鐒跺悗璁板綍1-9姣忎釜鏁板瓧鍑虹幇鐨勬鏁板茍渚濇鎵撳嵃鍑烘潵錛?br>鑰冭檻鍒皀鐨勮寖鍥?[0,10000]錛?涓嶅彲鑳藉幓璁$畻 2^n <br><br>hdu 1060 Leftmost Digit <a >http://acm.hdu.edu.cn/showproblem.php?pid=1060</a> 涓庢棰樹竴鏍?<br> <div style="BORDER-BOTTOM: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; PADDING-BOTTOM: 4px; BACKGROUND-COLOR: #eeeeee; PADDING-LEFT: 4px; WIDTH: 98%; PADDING-RIGHT: 5px; FONT-SIZE: 13px; WORD-BREAK: break-all; BORDER-TOP: #cccccc 1px solid; BORDER-RIGHT: #cccccc 1px solid; PADDING-TOP: 4px"><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">*<br>    鍏堢湅涓涓緥瀛愶細<br><br>        31415926   鏈宸﹂潰閭d綅鏁版槸3錛屽浣曞緱鏉ワ紵<br><br>        鍙栧鏁幫細 lg(3.1415926 * 10^7) = lg(3.1415926) + 7<br>        涔熷氨鏄錛屼竴涓暣鏁板彇瀵規暟浠ュ悗鍙樹負2閮ㄥ垎錛屼笉濡ㄨ灝忔暟閮ㄥ垎涓篈 (0 <= A < 1)錛屾暣鏁伴儴鍒嗕負B<br>        鎵浠ワ紝涓涓暣鏁板彲浠ュ啓鎴?nbsp;10^A * 10^B<br>        鑷充簬 10^B 鏄ぇ瀹剁啛鎮夌殑 10000…… <br>        鑰?nbsp;10^A 鏄粈涔堟牱瀛愮殑鍛紵 鑲畾鏄皬浜?0鐨勫皬鏁?nbsp;   (涓轟粈涔堝憿錛屽鏋滃ぇ浜?0浜嗭紝B鐨勫煎垯鍔?)<br>        閭d箞 A 鐨勬暣鏁伴儴鍒嗗氨鏄垜浠姹傜殑鏁?br>        澶ц嚧鎬濊礬灝辨槸錛氬涓涓暟x姹傚鏁幫紝鍙栧嚭灝忔暟閮ㄥ垎A錛屽垯10^A鐨勬暣鏁伴儴鍒嗗氨鏄痻鐨勬渶宸﹂潰鐨勯偅浣嶆暟<br><br><br>    榪涘叆鏈錛?br><br>        x = 2^n<br>        lg(x) = n * lg(2)<br>        A = lg(x) - lg(x)鐨勬暣鏁伴儴鍒?br>        10^A = ……<br><br>    鍏跺疄榪欓亾棰樺崱鐨勪簨綺懼害闂錛屾暣鏁頒笌灝忔暟鏉ュ洖杞寲鑲畾鏈夌簿搴︽崯澶?nbsp;榪欓噷鐨凙瑕佸姞涓?.0e-6<br></span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><br>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br>#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">math.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> eps (1.0e-6)</span><span style="COLOR: #000000"><br><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> f[</span><span style="COLOR: #000000">10010</span><span style="COLOR: #000000">][</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">];<br><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i, j, y;<br>    </span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000"> A, x, s</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">log10(</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">);<br><br>    f[</span><span style="COLOR: #000000">0</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: #0000ff">for</span><span style="COLOR: #000000"> (i</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">10000</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">) {<br>        </span><span style="COLOR: #0000ff">for</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">10</span><span style="COLOR: #000000">; j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>            f[i][j] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> f[i</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">][j];<br><br>        x </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> i </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> s;<br>        A </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> x </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">)x;<br>        y </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">) (pow(</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">, A)</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">eps);    <br>        <br>        f[i][y]</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">;<br>    }<br>    <br>    </span><span style="COLOR: #0000ff">while</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">y),y</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">) {<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, f[y][</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]);<br>        </span><span style="COLOR: #0000ff">for</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">10</span><span style="COLOR: #000000">; i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>            printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> %d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,f[y][i]);<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br>    }<br>    <br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>}</span></div> <img src ="http://www.shnenglu.com/doer-xee/aggbug/102056.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/doer-xee/" target="_blank">瑗塊钀х憻</a> 2009-11-27 14:25 <a href="http://www.shnenglu.com/doer-xee/archive/2009/11/27/102056.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.um258.cn" target="_blank">久久综合久久自在自线精品自</a>| <a href="http://www.fandele.cn" target="_blank">国产精品亚洲美女久久久</a>| <a href="http://www.qxri.cn" target="_blank">无夜精品久久久久久</a>| <a href="http://www.duange.com.cn" target="_blank">欧美久久久久久</a>| <a href="http://www.anfuwang.cn" target="_blank">久久久久高潮毛片免费全部播放 </a>| <a href="http://www.spbbs.cn" target="_blank">日本欧美国产精品第一页久久</a>| <a href="http://www.zyxslswx.cn" target="_blank">久久综合伊人77777</a>| <a href="http://www.laqn.cn" target="_blank">久久综合九色综合网站</a>| <a href="http://www.msomso.cn" target="_blank">久久国产视屏</a>| <a href="http://www.gocq8.cn" target="_blank">精品久久久噜噜噜久久久</a>| <a href="http://www.bqtao.cn" target="_blank">免费精品久久久久久中文字幕</a>| <a href="http://www.153u.cn" target="_blank">亚洲熟妇无码另类久久久</a>| <a href="http://www.00225858.cn" target="_blank">久久国产福利免费</a>| <a href="http://www.iptid.com.cn" target="_blank">精品久久久久中文字幕日本</a>| <a href="http://www.xajh2.cn" target="_blank">波多野结衣久久精品</a>| <a href="http://www.chcrw.cn" target="_blank">国产精品99久久不卡</a>| <a href="http://www.kinbay.cn" target="_blank">国产午夜福利精品久久2021 </a>| <a href="http://www.neang.cn" target="_blank">久久99国产精品久久久</a>| <a href="http://www.bbwdx.cn" target="_blank">久久久国产亚洲精品</a>| <a href="http://www.okfupo.cn" target="_blank">久久久WWW成人免费精品</a>| <a href="http://www.enkids.cn" target="_blank">狠狠色婷婷综合天天久久丁香</a>| <a href="http://www.ovyp.cn" target="_blank">大香伊人久久精品一区二区 </a>| <a href="http://www.gpuk.cn" target="_blank">久久久久亚洲AV片无码下载蜜桃 </a>| <a href="http://www.xxysw.com.cn" target="_blank">97超级碰碰碰碰久久久久</a>| <a href="http://www.t1303.cn" target="_blank">成人久久免费网站</a>| <a href="http://www.tobeok.cn" target="_blank">亚洲另类欧美综合久久图片区</a>| <a href="http://www.0x5e.cn" target="_blank">亚洲国产成人久久综合一</a>| <a href="http://www.fzcxpc.cn" target="_blank">久久超碰97人人做人人爱</a>| <a href="http://www.jiademandu.cn" target="_blank">久久天天躁狠狠躁夜夜avapp</a>| <a href="http://www.spiralstar.com.cn" target="_blank">国产精品99久久久久久猫咪</a>| <a href="http://www.jxhcgd.cn" target="_blank">精品久久一区二区三区</a>| <a href="http://www.xsylsh.cn" target="_blank">日产精品久久久久久久</a>| <a href="http://www.lightingtruss.cn" target="_blank">伊人久久大香线焦AV综合影院</a>| <a href="http://www.xwiw.cn" target="_blank">久久天天躁夜夜躁狠狠躁2022</a>| <a href="http://www.esfjjr.cn" target="_blank">性高湖久久久久久久久AAAAA</a>| <a href="http://www.pchenshimin.com.cn" target="_blank">久久99久久成人免费播放</a>| <a href="http://www.npoq.cn" target="_blank">国产免费久久精品99久久</a>| <a href="http://www.sunriseydy.cn" target="_blank">国产999精品久久久久久</a>| <a href="http://www.werro.cn" target="_blank">亚洲国产成人久久精品影视</a>| <a href="http://www.port1.com.cn" target="_blank">日本一区精品久久久久影院</a>| <a href="http://www.hzmgdj.com.cn" target="_blank">精品久久久久久综合日本</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>