Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

ATTIC problem

$
0
0

Can u tell me whats wrong with the code below , the code is accepted but giving an execution time of 2.53 sec ! How can i optimize it ? Provide some tips !

int main(){

 int t ;

 cin>>t;
getchar();
 while(t--){ int days=0,max=0,len=0; char ch; 
            while((ch = getchar()) != '\n') {



            if(ch=='.' ) 
            { 
                       len++;   }

            else 
                { if(len>max){days++; max=len;}  len=0;}




                 }

            cout<<days<<endl;

            }    //system("PAUSE");

}


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>