POJ 1887 Testing the CATCHER.

Source: Internet
Author: User

POJ 1887 Testing the CATCHER.

~~~~

Find the longest ascending subsequence, and reverse the array. Isn't it the longest ascending subsequence? QAQ ..

 

~~~~

 

# Include

 
  
# Include

  
   
# Include

   
    
# Define N 10000 using namespace std; int f [N], a [N]; int main () {int t, c, T = 0; while (~ Scanf (% d, & t), t! =-1) {c = 0; a [c ++] = t; while (~ Scanf (% d, & t), t! =-1) a [c ++] = t; int I, j; for (I = 0, j = C-1; I

    
     
F [cnt]) f [++ cnt] = a [k]; else {int pos = lower_bound (f + 1, f + cnt, a [k])-f; f [pos] = a [k] ;}} printf (Test # % d:, ++ T); printf (maximum possible interceptions: % d, cnt );} return 0 ;}

    

   

  

 


 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.