Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

菜鸟水平有限,代码供参考交流。

Posted by WayneZhou at 2016-04-25 17:18:26 on Problem 1631
#include<cstdio>
#include<algorithm>

using namespace std;

int main(){
    int t,n,m,dp[40010];
    scanf("%d",&t);
    while(t--){
        scanf("%d",&n);
        fill(dp,dp+n,40010);
        for(int i=0;i<n;i++){
            scanf("%d",&m);
            *lower_bound(dp,dp+n,m)=m;
        }
        printf("%d\n",lower_bound(dp,dp+n,40010)-dp);
    }
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator