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

Re:第六题

Posted by tedious at 2008-09-20 12:30:51
In Reply To:第六题 Posted by:346248129 at 2008-09-20 09:07:10
> TimeLimit : 1 Second   Memorylimit : 32 Megabyte   
> 
> Totalsubmit : 0   Accepted : 0
> 
>   Anti-terrorism is becomming more and more serious nowadays. The country now has n soldiers,and every solider has a score.
>   We want to choose some soldiers to fulfill an urgent task. The soldiers chosen must be adjacent to each other in order to make sure that they can cooperate well. And all the soldiers choosen must have an average score greater than a.
>   Now, please calculate how many ways can the chief of staff choose the soldiers. 
> 
> Input 
> 
>   The first line consists of a single integer t, indicating number of test cases.
>   For each test case, the first line gives n, the number of soldiers, and a, the minimum possible average score(n<=100000,a<=10000). The second line gives n integers, corresponding to the soldiers' scores in order. All the scores are no greater than 10000. 
> 
> Output 
> 
>   An integer n, number of ways to choose the soldiers. 
> 
> Sample Input 
> 
> 2
> 5 3
> 1 3 7 2 4
> 1 1000
> 9999 
> 
> Sample Output 
> 
> 10
> 1 
> 

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