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

为什么Output Limit Exceed呢?

Posted by 00330001 at 2005-10-23 16:23:19 on Problem 1978
#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:
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