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 |
为什么Output Limit Exceed呢?#include<iostream.h> int main() { int i,j,k,a[50],b[50],n,r,p,c; while(1){ cin>>n>>r; if((n==0)&&(r==0))break; for(i=0;i<n;i++) a[i]=n-i; for( i=1;i<=r;i++) { cin>>p>>c; for(j=p-1,k=0;j<p+c;j++,k++) b[k]=a[j]; for(j=p-2;j>=0;j--) a[j+c]=a[j]; for(j=0;j<c;j++) a[j]=b[j]; } cout<<a[0]<<endl; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator