| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
在本机上能正常通过,提交通不过?为啥喃/#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator