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 wojiushi at 2009-05-18 21:44:36 on Problem 2104
#include"iostream"
#include"algorithm"
using namespace std;
int main()
{
    int m,n;
    scanf("%d%d",&m,&n);
    int a[100001]={0},i;
    for(i=0;i<m;i++)
    {
        scanf("%d",&a[i]);
    }
    while(n)
    {
            int l,p,q,b[100001]={0},k=0;
            scanf("%d%d%d",&l,&p,&q);
            for(i=l-1;i<p;i++)
            {
                b[k]=a[i];
                ++k;
            }
            sort(b,b+(p-l+1));
            printf("%d\n",b[q-1]);
            --n;
    }   
            
            
    return 0;
}
    
    

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