ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1357. Teakettle 1.0 for Dummies

Please give some test. I get WA 7-8.
Posted by Lifanov 20 Mar 2005 10:12
Time is different?
    for(i=0;i<400000;i++){ //for each sec
        if(m!=0.0 && i!=0){
            dt=((100.0-T)*C*m)/P;
            if(dt>1.0)
                dt=0.0;
            T+=P*1.0/(C*m);
        //    dt=0.0;
        }
        if(fabs(T-100.0)<0.0000001 || T>100.0){
            //zakipel
            j=(int)(m/200.0);
            out(i,j);
            if(MWait<=1000.0){
                if(MWait==0.0){
                    m=0.0;
                    T=20.0;
                }
                else{
                    m=MWait;
                    MWait=0.0;
                    T=20.0;
                    T+=P*dt/(C*m);
                }
            }
            else{
                m=1000.0;
                MWait-=1000.0;
                T=20.0;
                T+=(P*dt)/(C*m);
            }

        }
        if(time[i]==1){//add new people
            if(m==1000.0){
                MWait+=200.0;
            }else{
        //        printf("Dolili ");
        //        out(i,1);
                T=(m*T+4000.0)/(m+200.0);
                m+=200.0;
            }
        }
Sorry for my English.