锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久一区二区三区免费,天堂无码久久综合东京热,99久久精品毛片免费播放http://www.shnenglu.com/MiYu/category/14426.html ______________鐧界櫧銇眿zh-cnThu, 26 Aug 2010 07:03:24 GMTThu, 26 Aug 2010 07:03:24 GMT60HDOJ 1253 HDU 1253 鑳滃埄澶ч冧骸 ACM 1253 IN HDUhttp://www.shnenglu.com/MiYu/archive/2010/08/25/124645.htmlMiYuMiYuWed, 25 Aug 2010 03:30:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/25/124645.htmlhttp://www.shnenglu.com/MiYu/comments/124645.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/25/124645.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/124645.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/124645.html

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?nbsp;______________鐧界櫧銇眿    

 

 棰樼洰鍦板潃:

      http://acm.hdu.edu.cn/showproblem.php?pid=1253 

棰樼洰鎻忚堪:

鑳滃埄澶ч冧骸

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 4785    Accepted Submission(s): 1454


Problem Description
Ignatius琚瓟鐜嬫姄璧頒簡,鏈変竴澶╅瓟鐜嬪嚭宸幓浜?榪欏彲鏄疘gnatius閫冧骸鐨勫ソ鏈轟細(xì).

欖旂帇浣忓湪涓涓煄鍫¢噷,鍩庡牎鏄竴涓狝*B*C鐨勭珛鏂逛綋,鍙互琚〃紺烘垚A涓狟*C鐨勭煩闃?鍒氬紑濮婭gnatius琚叧鍦?0,0,0)鐨勪綅緗?紱誨紑鍩庡牎鐨勯棬鍦?A-1,B-1,C-1)鐨勪綅緗?鐜板湪鐭ラ亾欖旂帇灝嗗湪T鍒嗛挓鍚庡洖鍒板煄鍫?Ignatius姣忓垎閽熻兘浠庝竴涓潗鏍囪蛋鍒扮浉閭?cè)潥勫叚涓潗鏍囦腑鐨勫叾涓竴涓?鐜板湪緇欎綘鍩庡牎鐨勫湴鍥?璇蜂綘璁$畻鍑篒gnatius鑳藉惁鍦ㄩ瓟鐜嬪洖鏉ュ墠紱誨紑鍩庡牎(鍙璧板埌鍑哄彛灝辯畻紱誨紑鍩庡牎,濡傛灉璧板埌鍑哄彛鐨勬椂鍊欓瓟鐜嬪垰濂藉洖鏉ヤ篃綆楅冧骸鎴愬姛),濡傛灉鍙互璇瘋緭鍑洪渶瑕佸灝戝垎閽熸墠鑳界寮,濡傛灉涓嶈兘鍒欒緭鍑?1.


 

Input
杈撳叆鏁版嵁鐨勭涓琛屾槸涓涓鏁存暟K,琛ㄦ槑嫻嬭瘯鏁版嵁鐨勬暟閲?姣忕粍嫻嬭瘯鏁版嵁鐨勭涓琛屾槸鍥涗釜姝f暣鏁癆,B,C鍜孴(1<=A,B,C<=50,1<=T<=1000),瀹冧滑鍒嗗埆浠h〃鍩庡牎鐨勫ぇ灝忓拰欖旂帇鍥炴潵鐨勬椂闂?鐒跺悗鏄疉鍧楄緭鍏ユ暟鎹?鍏堟槸絎?鍧?鐒跺悗鏄1鍧?絎?鍧?.....),姣忓潡杈撳叆鏁版嵁鏈塀琛?姣忚鏈塁涓鏁存暟,浠h〃榪峰鐨勫竷灞,鍏朵腑0浠h〃璺?1浠h〃澧?(濡傛灉瀵硅緭鍏ユ弿榪頒笉娓呮,鍙互鍙傝僑ample Input涓殑榪峰鎻忚堪,瀹冭〃紺虹殑灝辨槸涓婂浘涓殑榪峰)

鐗瑰埆娉ㄦ剰:鏈鐨勬祴璇曟暟鎹潪甯稿ぇ,璇蜂嬌鐢╯canf杈撳叆,鎴戜笉鑳戒繚璇佷嬌鐢╟in鑳戒笉瓚呮椂.鍦ㄦ湰OJ涓婅浣跨敤Visual C++鎻愪氦.
 

Output
瀵逛簬姣忕粍嫻嬭瘯鏁版嵁,濡傛灉Ignatius鑳藉鍦ㄩ瓟鐜嬪洖鏉ュ墠紱誨紑鍩庡牎,閭d箞璇瘋緭鍑轟粬鏈灝戦渶瑕佸灝戝垎閽?鍚﹀垯杈撳嚭-1.
 

Sample Input
1 3 3 4 20 0 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 0 0 0 0 0 1 1 0 0 1 1 0
 

Sample Output
11
 

 

 棰樼洰鍒嗘瀽:

    棰樼洰鏄緢綆鍗曠殑涓閬揃FS, 浣嗘槸榪欑牬棰樼珶鐒剁籂緇撲簡鎴戜竴鏁村ぉ, 鏅氫笂11鐐圭殑鏃跺欐墠A鎺?YM.  
榪欓鍜?浜岀淮鐭╅樀鐨勪笉鍚岀偣灝辨槸鏈?涓柟鍚? 鍓嶅悗宸﹀彸涓婁笅.  鐒跺悗涓鐩碆FS灝卞彲浠ヤ簡,涓嶉渶瑕佸壀鏋濋兘鑳借繃...........


浠g爜濡備笅:

 /*

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿

          http://www.cnblog.com/MiYu

Author By : MiYu

Test      : 1

Program   : HDU1253

*/


#include <iostream>

#include <queue>

using namespace std;

int TLE[56][56][56];

const int d[6][3] = { { 0,0,1 },{ 0,0,-1 },{ 0,-1,0 },{ 0,1,0 },{ 1,0,0 },{ -1,0,0 } };

int A, B, C, T, m;

typedef struct pos{

       pos(){ x=y=z=n=0; } 

       void setPos ( int a,int b,int c, int count ){ x=a;y=b;z=c;n=count; }

       bool isEnd () { if ( x==1&&y==1&&z==1 )return true;return false; }

       int x,y,z;  

       int n;

}pos;

pos t,p;

#define CMP(A,B) (A.n < B.n)

typedef class Heap {

public:

        pos h[70000 * 2];

        int n, p, c;

        Heap() {

                n = 0;

        }

        void inline push(pos e) {

                for (p = ++n; p > 1 && CMP(e,h[p>>1]); h[p] = h[p>>1], p >>= 1)

                        ;

                h[p] = e;

        }

        int inline pop(pos &e) {

                if (!n)

                        return 0;

                for (e = h[p = 1], c = 2; c < n

                                && CMP(h[c += (CMP(h[c + 1],h[c]) && c < n - 1)], h[n]);

                                h[p] = h[c], p = c, c <<= 1)

                        ;

                h[p] = h[n--];

                return 1;

        }

}Heap;

Heap WA;

int RE ()

{

    if ( A+B+C-2 > T || TLE[A][B][C] == 0 )

         return -1;

    t.setPos ( A,B,C,0 );

    TLE[A][B][C] = 0;

    WA.push ( t );

    while ( WA.pop(t) ){ 

           if ( t.x+t.y+t.z-2 > T-t.n )

                continue;            

           if ( t.isEnd() )

                return t.n;  

           for ( int i = 0; i != 6; ++ i ){

                 int x = t.x+d[i][0], y=t.y+d[i][1], z=t.z+d[i][2];

                 if ( TLE[ x ][ y ][ z ] != 0 ){

                      TLE[ x ][ y ][ z ] = 0;

                      p.setPos ( x, y, z, t.n+1 ); 

                      if ( p.isEnd() && p.n <= T )

                           return p.n;  

                      if ( p.n <= T )    

                           WA.push ( p );

                 }

           }  

    }

    return -1;

}

inline bool scan_d(int &num) 

{

        char in;bool IsN=false;

        in=getchar();

        if(in==EOF) return false;

        while(in!='-'&&(in<'0'||in>'9')) in=getchar();

        if(in=='-'){ IsN=true;num=0;}

        else num=in-'0';

        while(in=getchar(),in>='0'&&in<='9'){

                num*=10,num+=in-'0';

        }

        if(IsN) num=-num;

        return true;

}

int main ()

{

    int K;

    scan_d(K);

    while ( K -- ){

           while ( WA.pop(p) ) ;

           memset ( TLE, 0 , sizeof ( TLE ) );

           scan_d(A); scan_d(B); scan_d(C); scan_d(T);

           for ( int i = 1; i <= A; ++ i ){

                 for ( int j = 1; j <= B; ++ j ){

                       for ( int k = 1; k <= C; ++ k ){

                             scan_d(m);

                             TLE[i][j][k] = m == 1 ? 0 : 1; 

                       } 

                 } 

           } 

           TLE[1][1][1] = 1;

           cout << RE () << endl;

    } 

    //system( "pause" );

    return 0;

}


 

 



MiYu 2010-08-25 11:30 鍙戣〃璇勮
]]>
HDOJ 1181 HDU 1181 鍙樺艦璇?ACM 1181 IN HDUhttp://www.shnenglu.com/MiYu/archive/2010/08/25/124643.htmlMiYuMiYuWed, 25 Aug 2010 03:27:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/25/124643.htmlhttp://www.shnenglu.com/MiYu/comments/124643.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/25/124643.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/124643.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/124643.html

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?nbsp;______________鐧界櫧銇眿    

棰樼洰鍦板潃:

      http://acm.hdu.edu.cn/showproblem.php?pid=1181 

棰樼洰鎻忚堪:

浠g爜
鍙樺艦璇?br>
Time Limit: 
2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)
Total Submission(s): 
2655    Accepted Submission(s): 863


Problem Description
鍛?.....鍙樺艦璇句笂Harry紕板埌浜嗕竴鐐瑰皬楹葷儲(chǔ),鍥犱負(fù)浠栧茍涓嶅儚Hermione閭f牱鑳藉璁頒綇鎵鏈夌殑鍜掕鑰岄殢鎰忕殑灝嗕竴涓鐞冨彉鎴愬埡鐚粈涔堢殑,浣嗘槸浠栧彂鐜頒簡鍙樺艦鍜掕鐨勪竴涓粺涓瑙勫緥:濡傛灉鍜掕鏄互a寮澶碽緇撳熬鐨勪竴涓崟璇?閭d箞瀹冪殑浣滅敤灝辨伆濂芥槸浣緼鐗╀綋鍙樻垚B鐗╀綋. 
Harry宸茬粡灝嗕粬鎵浼?xì)鐨勬墍鏈夊拻璇兘鍒楁垚浜嗕竴涓〃,浠栨兂璁╀綘甯繖璁$畻涓涓嬩粬鏄惁鑳藉畬鎴愯佸笀鐨勪綔涓?灝嗕竴涓狟(ball)鍙樻垚涓涓狹(Mouse),浣犵煡閬?濡傛灉浠栬嚜宸變笉鑳藉畬鎴愮殑璇?浠栧氨鍙ソ鍚慔ermione璇鋒暀,騫朵笖琚揩鍚竴澶у爢濂藉ソ瀛︿範(fàn)鐨勯亾鐞?
 

Input
嫻嬭瘯鏁版嵁鏈夊緇勩傛瘡緇勬湁澶氳錛屾瘡琛屼竴涓崟璇?浠呭寘鎷皬鍐欏瓧姣?鏄疕arry鎵浼?xì)鐨勬墍鏈夊拻璇?鏁板瓧0琛ㄧず涓緇勮緭鍏ョ粨鏉?
 

Output
濡傛灉Harry鍙互瀹屾垚浠栫殑浣滀笟,灝辮緭鍑?/span>"Yes.",鍚﹀垯灝辮緭鍑?/span>"No."(涓嶈蹇界暐浜嗗彞鍙?
 

Sample Input
so
soon
river
goes
them
got
moon
begin
big
0
 

Sample Output
Yes.

 

 

棰樼洰鍒嗘瀽:

姝ら鏄竴涓緢鏍囧噯浜?nbsp;鎼滅儲(chǔ)棰? 鐩存帴鏋氫婦 + 鍥炴函 灝?nbsp;OK浜?nbsp;.

 

浠g爜
/*
MiYu鍘熷垱, 杞笘璇鋒敞鏄?nbsp;: 杞澆鑷?nbsp;______________鐧界櫧銇眿
          
http://www.shnenglu.com/MiYu
Author By : MiYu
Test      :
Program   :
*/

#include
<iostream>
#include
<string>
using namespace std;
struct{
        
char beg;
        
char end;
}M[
101];
bool hash[101],f;
int N;
bool DFS ( char ch )
{
     
if ( f )
        
return true;
     
if( ch == 'm' )
     {
         f 
= true;
         
return true;
     }
     
for ( int i = 0; i < N; ++ i )
         
if ( M[i].beg == ch && !hash[i] )
         {
              hash[i] 
= true;
              DFS ( M[i].end );
              hash[i] 
= false;
         }
     
return false;
}
int main ()
{
    
string str;
    
while ( cin >> str )
    {
            N 
= 0;
            f 
= false;
            memset ( hash, 
0 , sizeof ( hash ) );
            
while ( str != "0" )
            {
                    M[N].beg 
= str[0];
                    M[N].end 
= str[ str.size() - 1 ];
                    N
++;
                    cin 
>> str;
            }
            DFS ( 
'b' );
            puts ( f 
? "Yes." : "No." );
    }
    
return 0;
}

 

 

浠g爜
鍏跺疄榪欓榪樻湁涓縐嶅緢 YD 鐨勮В娉?/span>!!!  鍢垮樋 ................ 
鍏蜂綋鎯呭喌鐪嬩唬鐮?

#include
<iostream>

using namespace std;

char ss[10];

int main(){

    
int flag=1;

    
while(gets(ss)){

        
if (strcmp(ss,"0")==0){

            
if (flag){

                printf(
"Yes.\n");

                flag
=0;

            }

            
else

                printf(
"No.\n");

        }

    }

    
return 0;

}

 

 

MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?a >     ______________鐧界櫧銇眿

 



MiYu 2010-08-25 11:27 鍙戣〃璇勮
]]>
HDOJ 1016 HDU 1016 Prime Ring Problem ACM 1016 IN HDUhttp://www.shnenglu.com/MiYu/archive/2010/08/18/123815.htmlMiYuMiYuWed, 18 Aug 2010 04:32:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/18/123815.htmlhttp://www.shnenglu.com/MiYu/comments/123815.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/18/123815.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/123815.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/123815.html棰樼洰鍦板潃:
http://acm.hdu.edu.cn/showproblem.php?pid=1016
棰樼洰鎻忚堪:

Prime Ring Problem

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 6150    Accepted Submission(s): 2745


Problem Description
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.

Note: the number of first circle should always be 1.


Input
n (0 < n < 20).

Output
The output format is shown as sample below. Each row represents a series of circle numbers in the ring beginning from 1 clockwisely and anticlockwisely. The order of numbers must satisfy the above requirements. Print solutions in lexicographical order.

You are to write a program that completes above process.

Print a blank line after each case.

Sample Input
6 8

Sample Output
Case 1: 1 4 3 2 5 6 1 6 5 2 3 4 Case 2: 1 2 3 8 5 6 7 4 1 2 5 8 3 4 7 6 1 4 7 6 5 8 3 2 1 6 7 4 3 8 5 2
棰樼洰鍒嗘瀽:
鍏稿瀷鐨?DFS 棰樼洰, 涓嶉渶瑕?浠涔堝壀鏋? 鐩存帴 絀蜂婦 + 鍥炴函 灝監(jiān)K浜? 涓嶈繃鍊煎緱涓鎻愮殑鏄?榪欓杈撳嚭寰圔T, 涓鑸殑 鍓嶅悗 杈撳嚭 鍥炶濺 , 絎竴涓洖杞︾敤 if( n == 1 ) 鍥炶濺; 鏉ュ仛PE浜嗗ソ鍑犳, 鏈鍚庣洿鎺ュ湪紼嬪簭鏈鍚?/span> 杈撳嚭2涓洖杞︾绔熺劧灝盇浜? YM鍟?..........
浠g爜濡備笅:
/* MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿 http://www.shnenglu.com/MiYu Author By : MiYu Test : Program : */ #include <iostream> using namespace std; bool prim[25]; int res[25]; bool hash[25]; int N; void setPrim () { memset ( prim, 0, sizeof ( prim ) ); prim[2] = prim[3] = prim[5] = prim[7] = prim[11] = prim[13] = prim[17] = prim[19] = prim[23] = true; } bool DFS ( int num , int n ) { res[n] = num; if ( n > N ) { return false; } if ( n == N - 1 ) { for ( int i = 2; i <= N; ++ i ) { if ( prim[num + i] && prim[ i + 1 ] && !hash[i] ) { res[n+1] = i; for ( int i = 1; i <= N; ++ i ) printf ( i == 1 ? "%d" : " %d",res[i] ); putchar ( '\n' ); } } } for ( int i = 2; i <= N; ++ i ) { if ( prim[ num + i ] && !hash[i] ) { hash[i] = true; DFS ( i, n + 1 ); hash[i] = false; } } return false; } int main () { setPrim (); int ca = 1; while ( cin >> N ) { sizeof ( hash, 0 , sizeof ( hash ) ); printf ( "Case %d:\n",ca++ ); hash[1] = true; DFS ( 1, 1 ); putchar ( '\n' ); } return 0; }



MiYu 2010-08-18 12:32 鍙戣〃璇勮
]]>
HDOJ 1010 HDU 1010 Tempter of the Bone ACM 1010 IN HDUhttp://www.shnenglu.com/MiYu/archive/2010/08/18/123802.htmlMiYuMiYuWed, 18 Aug 2010 02:35:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/18/123802.htmlhttp://www.shnenglu.com/MiYu/comments/123802.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/18/123802.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/123802.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/123802.html闃呰鍏ㄦ枃

MiYu 2010-08-18 10:35 鍙戣〃璇勮
]]>
HDOJ 1969 HDU 1969 Pie ACM 1969 IN HDU http://www.shnenglu.com/MiYu/archive/2010/08/11/123065.htmlMiYuMiYuWed, 11 Aug 2010 06:37:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/11/123065.htmlhttp://www.shnenglu.com/MiYu/comments/123065.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/11/123065.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/123065.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/123065.htmlMiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿

棰樼洰鍦板潃:
         http://acm.hdu.edu.cn/showproblem.php?pid=1969
棰樼洰鎻忚堪:
Pie

Time Limit: 
5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 
229    Accepted Submission(s): 65


Problem Description
My birthday 
is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This should be one piece of one pie, not several small pieces since that looks messy. This piece can be one whole pie though.

My friends are very annoying and 
if one of them gets a bigger piece than the others, they start complaining. Therefore all of them should get equally sized (but not necessarily equally shaped) pieces, even if this leads to some pie getting spoiled (which is better than spoiling the party). Of course, I want a piece of pie for myself too, and that piece should also be of the same size. 

What 
is the largest possible piece size all of us can get? All the pies are cylindrical in shape and they all have the same height 1, but the radii of the pies can be different.
 

Input
One line with a positive integer: the number of test cases. Then 
for each test case:
---One line with two integers N and F with 1 <= N, F <= 10 000: the number of pies and the number of friends.
---One line with N integers ri with 1 <= ri <= 10 000: the radii of the pies.
 

Output
For each test 
case, output one line with the largest possible volume V such that me and my friends can all get a pie piece of size V. The answer should be given as a floating point number with an absolute error of at most 10^(-3).
 

Sample Input
3
3 3
4 3 3
1 24
5
10 5
1 4 2 3 4 5 6 5 4 2
 

Sample Output
25.1327
3.1416
50.2655

棰樼洰鍒嗘瀽:
2鍒嗘眰瑙?

棰樼洰澶ф剰鏄鍔炵敓鏃arty錛屾湁n涓楗鹼紝鏈塮涓湅鍙嬶紝鎺ヤ笅鏉ユ槸n涓楗肩殑鍗婂緞銆傜劧鍚庢槸鍒嗛楗間簡錛?br>娉ㄦ剰鍜嚜宸變篃瑕侊紝澶у閮借涓鏍峰ぇ錛屽艦鐘舵病浠涔堣姹傦紝浣嗛兘瑕佹槸涓鏁村潡鐨勯偅縐嶏紝涔熷氨鏄涓嶈兘浠庝袱涓ゼ涓?br>鍚勫壊涓灝忓潡鏉ュ噾涓鍧楋紝鍍忛潰縐負(fù)10鐨勫拰6鐨勪袱鍧楅ゼ錛堥ゼ鐨勫帤搴︽槸1錛屾墍浠ラ潰縐拰浣撶Н鐩哥瓑錛夛紝
濡傛灉姣忎漢鍒嗗埌闈㈢Н涓?錛屽垯10鍒嗕袱鍧楋紝6鍒囨垚5錛屽鍒?涓漢錛屽鏋滄瘡浜?錛屽垯鍙兘鍒嗕袱涓簡錛?br>棰樼洰瑕佹眰鎴戜滑鍒嗗埌鐨勯ゼ灝藉彲鑳界殑澶э紒

鍙娉ㄦ剰綺懼害闂灝卞彲浠ヤ簡,涓鑸琖A 閮芥槸綺懼害闂.

浠g爜濡備笅:
#include <iostream>
#include 
<cmath>
using namespace std;
double a[10005];
int N,f;
double pi = acos ( -1.0 );
bool test ( double x )
{
    
int count = 0;
    
for ( int i = 1; i <= N; ++ i )
    {
        count 
+= int ( a[i] / x );
    }
    
if ( count >= f + 1 )
    {
         
return true;
    }
    
else
    {
         
return false;
    }
}
int main()
{
    
int T;   
    scanf ( 
"%d"&T );
    
while ( T -- )
    {
           
double sum = 0;
           
double rad; 
           scanf(
"%d%d",&N,&f);
           
for ( int i = 1; i <= N; ++ i )
           {
               scanf ( 
"%lf"&rad );
               a[i] 
= rad * rad * pi;
               sum 
+= a[i];
           }
           
double max = sum / ( f + 1 );
           
double l = 0.0;
           
double r = max;
           
double mid = 0.0;
           
while ( r - l > 1e-6 )
           {
                  mid 
= ( l + r ) / 2;
                  
if ( test ( mid ) )
                  {
                       l 
= mid;
                  }
                  
else
                  {
                       r 
= mid;
                  }
           }
           printf(
"%.4lf\n",mid);
    }
    
return 0;
}



MiYu 2010-08-11 14:37 鍙戣〃璇勮
]]>
HDOJ 2899 HDU 2899 Strange fuction ACM 2899 IN HDU http://www.shnenglu.com/MiYu/archive/2010/08/11/123060.htmlMiYuMiYuWed, 11 Aug 2010 05:51:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/11/123060.htmlhttp://www.shnenglu.com/MiYu/comments/123060.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/11/123060.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/123060.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/123060.htmlMiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿

棰樼洰鍦板潃:
         http://acm.hdu.edu.cn/showproblem.php?pid=2899
棰樼洰鎻忚堪:
Strange fuction

Time Limit: 
2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 
95    Accepted Submission(s): 75


Problem Description
Now, here 
is a fuction:
  F(x) 
= 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)
Can you find the minimum value when x 
is between 0 and 100.
 

Input
The first line of the input contains an integer T(
1<=T<=100) which means the number of test cases. Then T lines follow, each line has only one real numbers Y.(0 < Y <1e10)
 

Output
Just the minimum value (accurate up to 
4 decimal places),when x is between 0 and 100.
 

Sample Input
2
100
200
 

Sample Output
-74.4291
-178.8534

棰樼洰鍒嗘瀽:
綰暟瀛﹂, 闇瑕佸井縐垎鐨勭煡璇嗗垎鏋愰鐩?..........鎴戞壙璁?...鎴戞暟瀛︽病鎬庝箞瀛﹀ソ..........
鍒嗘瀽鍑烘潵浣跨敤2鍒嗘悳绱㈠氨鍙互浜?.........

浠g爜濡備笅:
#include <iostream>
#include 
<cmath>
using namespace std;
#define POW(x) ( (x) * (x) )
#define POW3(x) ( POW(x) * (x) )
MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿


#define
 POW4(x) ( POW(x) * POW(x) )
double y = 0;
double cal ( double n )
{
       
return 8.0 * POW4(n) + 7 * POW3(n) + 2 * POW(n) + 3 * n + 6 ;
}
int main ()
{
    
int T;
    scanf ( 
"%d",&T );
    
while ( T -- )
    {
          scanf ( 
"%lf",&y );
          
if ( cal(0> y || cal(100< y )
          {
               printf ( 
"No solution!\n" );
               
continue;
          }
          
double l = 0.0, r = 100.0,res = 0.0;
          
while ( r - l > 1e-6 )
          {
                
double mid = ( l + r ) / 2.0;
                res 
= cal ( mid );
                
if ( res > y )
                     r 
= mid - 1e-6;    
                
else 
                     l 
= mid + 1e-6;
          }
          printf ( 
"%.4lf\n",( l + r ) / 2.0 ); 
    }
    
return 0
}


MiYu 2010-08-11 13:51 鍙戣〃璇勮
]]>
HDOJ 2199 HDU 2199 Can you solve this equation? ACM 2199 IN HDU http://www.shnenglu.com/MiYu/archive/2010/08/11/123059.htmlMiYuMiYuWed, 11 Aug 2010 05:29:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/11/123059.htmlhttp://www.shnenglu.com/MiYu/comments/123059.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/11/123059.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/123059.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/123059.htmlMiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿

棰樼洰鍦板潃:
         http://acm.hdu.edu.cn/showproblem.php?pid=2199
棰樼洰鎻忚堪:
         
Can you solve this equation?

Time Limit: 
2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 
322    Accepted Submission(s): 148


Problem Description
Now,given the equation 
8*x^4 + 7*x^3 + 2*x^2 + 3*+ 6 == Y,can you find its solution between 0 and 100;
Now please 
try your lucky.
 

Input
The first line of the input contains an integer T(
1<=T<=100) which means the number of test cases. Then T lines follow, each line has a real number Y (fabs(Y) <= 1e10);
 

Output
For each test 
case, you should just output one real number(accurate up to 4 decimal places),which is the solution of the equation,or “No solution!”,if there is no solution for the equation between 0 and 100.
 

Sample Input
2
100
-4
 

Sample Output
1.6152
No solution
!

棰樼洰鍒嗘瀽:
寰堟槑鏄?榪欐槸涓涓?鍒嗘悳绱㈢殑棰樼洰, 浣嗘槸娉ㄦ剰涓嬮鐩殑鏁版嵁!! 1e10 鐨勫疄鏁?! 鑰屼笖綺懼害鏄姹傚湪 0.0001 . 鎵浠ュ氨綆楁槸2鍒嗘暟鎹噺渚濇棫姣旇緝澶?濡傛灉鐢?br>閫氬父鐨勯掑綊鏂規(guī)硶鍚楀緢閬楁喚 , RE浜?............  娌″姙娉? 鍙兘寰幆浜?
涓嬮潰鐨勬槸閫掑綊 RE 鐨勪唬鐮?:
#include <iostream>
#include <cmath>
using namespace std;
#define POW(x) ( (x) * (x) )
#define POW3(x) ( POW(x) * (x) )
#define POW4(x) ( POW(x) * POW(x) )
double y = 0;
bool douEql ( double a,double b )
{
if ( fabs( a - b ) <= 1e-6  )
return  true;
return false;
}
double cal ( double n )
{
return 8.0 * POW4(n) + 7 * POW3(n) + 2 * POW(n) + 3 * n + 6 ;
}
double biSearch ( double l, double r )
{
if ( douEql ( l,r ) )
{
if ( douEql ( y, cal ( l ) ) )
return l;
return -1;
}
double mid = ( l + r ) / 2.0;
if ( douEql ( y, cal ( mid ) ) )
return mid;
else if ( cal ( mid ) > y )
return biSearch ( l,mid - 0.0001 );
else
return biSearch ( mid + 0.0001, r );
}
int main ()
{
int T;
scanf ( "%d",&T );
while ( T -- )
{
scanf ( "%lf",&y );
if ( cal(0) >= y && cal(100) <= y )
{
printf ( "No solution!\n" );
continue;
}
double res = biSearch ( 0.0, 100.0 );
if ( res == -1 )
printf ( "No solution!\n" );
else
printf ( "%.4lf\n",res );
}
return 0;
}

AC浠g爜濡備笅:
MiYu鍘熷垱, 杞笘璇鋒敞鏄?: 杞澆鑷?______________鐧界櫧銇眿

#include 
<iostream>
#include 
<cmath>
using namespace std;
#define POW(x) ( (x) * (x) )
#define POW3(x) ( POW(x) * (x) )
#define POW4(x) ( POW(x) * POW(x) )
double y = 0;
double cal ( double n )
{
       
return 8.0 * POW4(n) + 7 * POW3(n) + 2 * POW(n) + 3 * n + 6 ;
}
int main ()
{
    
int T;
    scanf ( 
"%d",&T );
    
while ( T -- )
    {
          scanf ( 
"%lf",&y );
          
if ( cal(0> y || cal(100< y )
          {
               printf ( 
"No solution!\n" );
               
continue;
          }
          
double l = 0.0, r = 100.0,res = 0.0;
          
while ( r - l > 1e-6 )
          {
                
double mid = ( l + r ) / 2.0;
                res 
= cal ( mid );
                
if ( res > y )
                     r 
= mid - 1e-6;    
                
else 
                     l 
= mid + 1e-6;
          }
          printf ( 
"%.4lf\n",( l + r ) / 2.0 ); 
    }
    
return 0
}


MiYu 2010-08-11 13:29 鍙戣〃璇勮
]]>
久久人妻少妇嫩草AV无码专区| 狠狠久久亚洲欧美专区| 国产情侣久久久久aⅴ免费| 狠狠人妻久久久久久综合蜜桃| 久久亚洲精品无码aⅴ大香| 久久婷婷久久一区二区三区| 久久夜色精品国产噜噜亚洲a| 精品精品国产自在久久高清| 久久人人爽人人爽人人片AV麻烦 | 国产综合免费精品久久久| 亚洲精品乱码久久久久66| 久久久久亚洲精品男人的天堂| 国产亚洲欧美精品久久久| 四虎影视久久久免费| 国产精品成人无码久久久久久 | 久久久久国产| 久久99国产精品二区不卡| 伊人久久大香线蕉av一区| 亚洲欧洲久久久精品| 国内精品久久久久久久久| 青青热久久综合网伊人| 国产成人无码久久久精品一| 久久影院综合精品| 亚洲va中文字幕无码久久| 国产精品久久久久久五月尺| 色综合久久中文字幕综合网| 久久久久99精品成人片三人毛片 | 亚洲精品无码久久久久AV麻豆| 26uuu久久五月天| 久久婷婷久久一区二区三区| 俺来也俺去啦久久综合网| 精品熟女少妇av免费久久| 无码精品久久久天天影视| 无码人妻久久一区二区三区| 亚洲AV无码一区东京热久久| 精品久久久久久国产| 免费精品久久天干天干| 99久久精品免费看国产一区二区三区 | 久久精品视频91| 青青草原综合久久大伊人导航| 久久人人爽人人爽AV片|