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

//1968 不难的题怎么一直错啊...哪们GG帮帮我..

Posted by dearboy at 2004-11-15 22:16:38 on Problem 1968
//1968 不难的题怎么一直错啊...哪们GG帮帮我..

int main()
{
   int n_book,n_sch,s_sch;
   int page[3000];
   while(cin>>n_sch>>s_sch>>n_book)
   {
       for(int i=0;i<n_book;i++)
       cin>>page[i];
       sort(page,page+n_book);
       int temp=n_book%n_sch;
       int LIP=n_book/n_sch;
       int UIP;
       if(temp==0)
       UIP=LIP;
       else
       UIP=LIP+1;
       
       int count=0;
       for(int i=0;i<s_sch;i++)
       if(i<temp)
       count+=UIP;
       else
       count+=LIP;
       
       cout<<page[count]<<endl;
   }  
 
   return 0;
}


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