Codeforces 605A sorting Railway Cars thinking

Source: Internet
Author: User

Get up early and have a water ...

Test instructions looked at and Blue Bridge Cup B group of big question second way looks like a meaning ...

However, there is a very short code with bright blind eyes ...

The General meaning ...

Is the longest growing sub-sequence and the growth gap is 1 ...

Then n-Max length ...

What do you think of this?

I hope today's provincial election can be a bright light at first sight ~ ~

1#include <stdio.h>2#include <iostream>3#include <string.h>4#include <algorithm>5#include <math.h>6 using namespacestd;7 inta[100005];8 intb[100005];9 intMain () {Ten     intN; One      while(~SCANF ("%d",&N)) { Aa[0]=0; -          for(intI=1; i<=n;i++){ -scanf"%d",&a[i]); theb[a[i]]=b[a[i]-1]+1; -         } -Sort (b +1, b+n+1); -printf"%d\n", N-b[n]); +     } -     return 0; +}

Codeforces 605A sorting Railway Cars thinking

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.