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"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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator