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 happyhq at 2010-07-24 11:16:30 on Problem 2104
#include<stdio.h>
int main()
{
   int m,n,i,j,k,a,b,c,d,P[100000];
    while(scanf("%d %d",&m,&n)!=EOF)
    {int P[100000];
                    for(i=0;i<m;i++)//输入一串数 
                    scanf("%d",&P[i]);
                    i=0;
                    for(j=0;j<n;j++)//输入问题
                   
                    {
                    scanf("%d %d %d",&a,&b,&c);
                    
                    for(i=a-1;i<b-1;i++)//进行排序 
                    {j=i+1; 
                                    for(;j<b;j++)
                                    {
                                    if(P[i]>P[j])
                                    {
                                        d=P[i];
                                        P[i]=P[j];
                                        P[j]=d;
                                    }
                                    }
                    }
    
                            printf("%d\n",P[a+c-2]);//输出结果 
                      }                  
    }
}

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