锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久频这里精品99香蕉久,久久se精品一区精品二区,一级做a爰片久久毛片免费陪http://m.shnenglu.com/zoyi-zhang/category/6623.html縐嶇摐寰楃摐~~~縐嶈眴寰楄眴zh-cnMon, 29 Sep 2008 00:20:29 GMTMon, 29 Sep 2008 00:20:29 GMT60澶х礌鏁扮殑媯楠?/title><link>http://m.shnenglu.com/zoyi-zhang/archive/2008/09/23/62572.html</link><dc:creator>zoyi</dc:creator><author>zoyi</author><pubDate>Tue, 23 Sep 2008 05:26:00 GMT</pubDate><guid>http://m.shnenglu.com/zoyi-zhang/archive/2008/09/23/62572.html</guid><wfw:comment>http://m.shnenglu.com/zoyi-zhang/comments/62572.html</wfw:comment><comments>http://m.shnenglu.com/zoyi-zhang/archive/2008/09/23/62572.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/zoyi-zhang/comments/commentRss/62572.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/zoyi-zhang/services/trackbacks/62572.html</trackback:ping><description><![CDATA[     鎽樿:   <a href='http://m.shnenglu.com/zoyi-zhang/archive/2008/09/23/62572.html'>闃呰鍏ㄦ枃</a><img src ="http://m.shnenglu.com/zoyi-zhang/aggbug/62572.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/zoyi-zhang/" target="_blank">zoyi</a> 2008-09-23 13:26 <a href="http://m.shnenglu.com/zoyi-zhang/archive/2008/09/23/62572.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>spoj Sum of one-sequencehttp://m.shnenglu.com/zoyi-zhang/archive/2008/07/12/55950.htmlzoyizoyiSat, 12 Jul 2008 04:08:00 GMThttp://m.shnenglu.com/zoyi-zhang/archive/2008/07/12/55950.htmlhttp://m.shnenglu.com/zoyi-zhang/comments/55950.htmlhttp://m.shnenglu.com/zoyi-zhang/archive/2008/07/12/55950.html#Feedback0http://m.shnenglu.com/zoyi-zhang/comments/commentRss/55950.htmlhttp://m.shnenglu.com/zoyi-zhang/services/trackbacks/55950.html鍦╬oi鐨勫垪琛ㄤ笂鏄痚asy銆傘傘傘?br>鎴戝掋傘傝繖涔焑asy銆傘傘傘傘傘?br>榪欓亾棰樺浜忎簡javaman銆傘傚懙鍛點傘傝繖涓嬈°傘備粬璁茬殑鎸烘竻妤氱殑銆傘傘傝阿璋粬涓涓?br>
棰樼洰澶ф剰錛?br>      鏍規嵁杈撳叆錛屽簭鍒楃殑闀垮害錛屽簭鍒楀拰錛屾眰榪欐牱涓涓插簭鍒?br>      搴忓垪婊¤凍浠ヤ笅鎯呭喌錛?/p>
  • for any k, such that 1 <= k < n : |ak - ak+1| = 1 and
  • a1 = 0

  濡傛灉娌℃湁濡傛搴忓垪鍒欒緭鍑?No"

鎴戜滑鍋囪n-->搴忓垪闀垮害錛孲-->搴忓垪鍜岋紱

S=sigma a[i](1<=i<=n)
浠i=a[i+1]-a[i] (1<=i<n)

S=sigama b[i]+sigama a[i] (1<=i<n) ----> S= sgama (n-i)b[i]; (1<=i<n)//榪唬鍔犱竴涓嬪氨鑳芥帹鍑烘潵

b[i]-->-1 or 1

S=sigama (n-i)(b[i]+1)-sigama(n-i)
   =2*sigama ((n-i)(b[i]+1)/2)  -  n*(n-1)/2

d[i]=(b[i]+1)/2-->0 or 1
鏍規嵁涓婂紡寰楋細
no-->
1: S+n*(n-1)/2 涓哄鏁?br>2: abs(S)>n*(n-1)/2  //important ....鎴戝氨鏄繖閲屼竴鐩撮敊...緇濆鍊?..娌¤冭檻....

#include<iostream>
#include
<math.h>
int N,S;
int main()
{
    
int std,i,d,pre;
    
int T;
    scanf(
"%d",&T);
    
for(int j=1;j<=T;j++)
    {
        scanf(
"%d%d",&N,&S);
        std
=(N*(N-1))/2;
        
if((S+std)%2||abs(S)>std)
        {
            printf(
"No\n");
            
if(j!=T)printf("\n");
            continue;
        }
        printf(
"0\n");
        
for(pre=0,std+=S,std/=2,i=1;i<N;i++)
        {
            
if(std>=N-i)
            {    
                d
=1;
                std
-=N-i;
            }
            
else d=0;
            printf(
"%d\n",pre=2*d-1+pre);
        }
        
if(j!=T)printf("\n");
    }
    return 
0;
}


zoyi 2008-07-12 12:08 鍙戣〃璇勮
]]>
pku 2917 Diophantus of Alexandria http://m.shnenglu.com/zoyi-zhang/archive/2008/07/09/55696.htmlzoyizoyiWed, 09 Jul 2008 02:41:00 GMThttp://m.shnenglu.com/zoyi-zhang/archive/2008/07/09/55696.htmlhttp://m.shnenglu.com/zoyi-zhang/comments/55696.htmlhttp://m.shnenglu.com/zoyi-zhang/archive/2008/07/09/55696.html#Feedback1http://m.shnenglu.com/zoyi-zhang/comments/commentRss/55696.htmlhttp://m.shnenglu.com/zoyi-zhang/services/trackbacks/55696.html涓閬撴暟瀛﹂銆傚急寮變笉浼氬仛銆傘?br>
寮濮嬩竴鐩撮捇鐗涜灝栥傘傜敤鏆村姏鎶婃暟鎹窇浜嗕竴涓嬨傜劧鍚庢壘瑙勫緥銆傘傚彂鐜板ソ鍍忔槸鎵緉鐨勪簰璐ㄧ殑璐ㄥ洜鏁板鏁般傘?br>灝忕殑鏁版嵁鐢ㄦ墜綆楁槸鍙互綆楀嚭鏉ョ殑銆傘備絾鏄笉鐭ラ亾鎬庝箞鐢ㄧ▼搴忔潵綆椼傘?br>
鍚庨潰鍙傝僷c鐨勩傘傘傘傜煡閬撲簡鏄庝箞鍥炰簨銆傘?br>鎴戞兂浠ュ悗濡傛灉鏈夐渶瑕佹眰璐ㄥ洜鏁板鏁扮殑涓暟銆傘傚彲浠ョ敤榪欑鏂規硶鍙嶈繃鏉ユ眰銆傘?br>
涓嬮潰鏄唬鐮侊細

#include<iostream>
int N;
int solve(int N)
{
    
int i,ans=1,t;
    
for(i=2;i*i<=N;i++)
    {
        t
=0;
        
while(!(N%i))
        {
            t
++;
            N
/=i;
        }
        ans
*=2*t+1;
    }
    
if(ans==1||N!=1)ans*=3;
    return ans;
}
int main()
{
    
int T,cas,id;
    scanf(
"%d",&T);
    
for(cas=1;cas<=T;cas++)
    {
        scanf(
"%d",&N);
        id
=solve(N);
        
if(N==1)id=1;
        printf(
"Scenario #%d:\n%d\n\n",cas,(id+1)/2);
    }
    return 
0;
}


zoyi 2008-07-09 10:41 鍙戣〃璇勮
]]>
騫抽潰涓殑鐩寸嚎闂http://m.shnenglu.com/zoyi-zhang/archive/2008/04/10/46790.htmlzoyizoyiThu, 10 Apr 2008 15:36:00 GMThttp://m.shnenglu.com/zoyi-zhang/archive/2008/04/10/46790.htmlhttp://m.shnenglu.com/zoyi-zhang/comments/46790.htmlhttp://m.shnenglu.com/zoyi-zhang/archive/2008/04/10/46790.html#Feedback2http://m.shnenglu.com/zoyi-zhang/comments/commentRss/46790.htmlhttp://m.shnenglu.com/zoyi-zhang/services/trackbacks/46790.html2008騫?鏈?0鏃?3:52:47
絎竴涓棶棰橈細
鐢卞鉤闈腑鐨刵鏉$洿綰跨‘瀹氱殑鏈澶у尯鍩熸暟Ln
 L0=1錛?br>Ln=Ln-1+n(n>0);
Ln=1+n*(n+1)/2;

絎簩涓棶棰橈細
鏄鉤闈㈢洿綰跨殑鍙樺艦闂錛岀敤寮洸鐨勭嚎鏉ヤ唬鏇跨洿綰匡紝姣忎竴涓集鏇茬嚎鍚湁涓涓?#8220;閿嬌褰㈢殑杞”錛屽悓鏍風‘瀹氬鉤闈㈠尯鍩熺殑鏈澶т釜鏁癦n
錛堟垜浠妸涓鏉″集鏇叉姌綰挎娊璞′負涓ゆ潯錛屼絾鏄悎騫朵簡鏌愪簺鍖哄煙錛?br>Zn=L2n-2*n=2*n*n-n+1;(n>=0);

絎笁涓棶棰橈細
灝辨槸涓涓嬭繖涓棶棰橈細
count the regions

鑻ュ綋鍓嶆湁n-1鏉¤竟錛岄偅涔堝湪寰閲岄潰鍔犱竴鏉¤竟錛岃繖鏉℃柊鍔犵殑杈規渶澶氬拰浠ュ墠鐨勮竟鏈?*(n-1)涓氦鐐癸紝
閭d箞浼氭坊鍔?9*錛坣-1錛?1涓潰
榪欐潯瑙勫緥瀵逛簬涓婇潰涓ょ涔熸槸鐢紝鍔爔涓偣錛岄偅涔堝氨浼氭坊鍔爔+1涓潰

閭d箞鎬葷粨涓嬫潵 Xn=Xn-1+9*(n-1)+1
鍗砐n=(9/2)*n*n-(7/2)*n+1;

浠ヤ笅鏄垜鐨勪唬鐮侊細

#include<stdio.h>
int main()
{
    
long long  n;
    
long long  ans;
    
while(scanf("%lld",&n)!=EOF){
        ans
=9*n*n-7*n+2;
        ans
/=2;
        printf(
"%lld\n",ans);
    }
    return 
0;
}


zoyi 2008-04-10 23:36 鍙戣〃璇勮
]]>
AAA级久久久精品无码片| 久久久久亚洲AV无码网站| 91精品国产91热久久久久福利| 亚洲成色999久久网站| 久久无码国产| 久久精品一区二区三区AV| 97精品依人久久久大香线蕉97| 国产精品久久久香蕉| 国产精品久久久久9999| 人人狠狠综合久久亚洲高清| 久久综合给合久久狠狠狠97色69| 国产—久久香蕉国产线看观看| 久久精品极品盛宴观看| 一本久久久久久久| 婷婷久久综合| 国产午夜精品理论片久久| 久久午夜夜伦鲁鲁片免费无码影视 | 久久精品欧美日韩精品| 久久精品成人免费看| 国产午夜精品理论片久久| 少妇人妻综合久久中文字幕| 麻豆一区二区99久久久久| 好久久免费视频高清| 一本色综合久久| 狠狠色丁香久久综合婷婷| 久久综合给合综合久久| 69国产成人综合久久精品| 色婷婷狠狠久久综合五月| 久久夜色精品国产噜噜麻豆| 欧美亚洲日本久久精品| 奇米影视7777久久精品| 丁香色欲久久久久久综合网| 久久成人国产精品二三区| 久久精品九九亚洲精品| 伊人色综合久久天天人手人婷 | 久久久SS麻豆欧美国产日韩| 色综合合久久天天给综看| 久久五月精品中文字幕| 欧美综合天天夜夜久久| 亚洲一区二区三区日本久久九| 久久美女网站免费|