ZOJ - 3880 Demacia of the Ancients

原创 2018年04月15日 22:18:53

Demacia of the Ancients

Problem Description

There is a popular multiplayer online battle arena game called Demacia of the Ancients. There are lots of professional teams playing this game. A team will be approved as Level K if there are exact K team members whose match making ranking (MMR) is strictly greater than 6000.

You are given a list of teams. Please calculate the level of each team.

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

The first line contains an integer N (1 <= N <= 10) indicating the number of team members.

The second line contains N integers representing the MMR of each team member. All MMRs are non-negative integers less than or equal to 9999.

Output

For each test case, output the level of the given team.

Sample Input

3
5
7986 6984 6645 6200 6150
5
7401 7377 6900 6000 4300
3
800 600 200

Sample Output

5
3
0

题解代码

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    int n;
    cin >> n;
    while(n--){
        int m;
        cin >> m;
        int a[m];
        for(int i = 0; i < m; i ++){
            cin >> a[i];
        }
        sort(a, a + m);
        int ans = 0;
        for(int i = m-1; i >= 0; i--){
            if(a[i] > 6000){
                ans ++;
            }
            else{
                break;
            }
        }
        cout << ans << endl;
    }
    return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/AcmAres/article/details/79954297

zoj 3880 Demacia of the Ancients

Demacia of the Ancients Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a popula...
  • chenzhenyu123456
  • chenzhenyu123456
  • 2015-04-25 22:20:49
  • 366

ZOJ 3880 Demacia of the Ancients

题意:给出n个数,求出严格大于6000数的个数 链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5528 思路:模拟 ...
  • luminous11
  • luminous11
  • 2015-05-11 22:19:43
  • 272

ZOJ - 3880 Demacia of the Ancients (水)

ZOJ - 3880 Demacia of the Ancients Time Limit:                                            ...
  • yanghui07216
  • yanghui07216
  • 2016-05-01 16:30:38
  • 277

ZOJ3880:Demacia of the Ancients(浙江省赛2015)

There is a popular multiplayer online battle arena game called Demacia of the Ancients. There are lo...
  • libin56842
  • libin56842
  • 2015-04-25 19:20:19
  • 1392

12th浙江省省赛 Demacia of the Ancients(水)

Demacia of the Ancients Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a popula...
  • u012349696
  • u012349696
  • 2015-04-25 19:40:25
  • 654

ZOJ Problem Set - 3880||Demacia of the Ancients

Demacia of the Ancients Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a popular m...
  • Andrew_Ho
  • Andrew_Ho
  • 2015-04-26 21:25:36
  • 208

L - Demacia of the Ancients——ZOJ

L - Demacia of the Ancients Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld &...
  • chudongfang2015
  • chudongfang2015
  • 2016-05-10 20:16:34
  • 284

Demacia of the Ancients

Demacia of the Ancients Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a popula...
  • zuguodexiaoguoabc
  • zuguodexiaoguoabc
  • 2015-04-25 20:49:40
  • 317

ZOJ 3880-Demacia of the Ancients【模拟】

Demacia of the Ancients Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a popular...
  • qq_29600137
  • qq_29600137
  • 2016-05-09 17:56:40
  • 235

ACM-水题 Demacia of the Ancients

题目 Description There is a popular multiplayer online battle arena game called Demacia of the ...
  • ljd939952281
  • ljd939952281
  • 2016-04-03 14:30:44
  • 242
收藏助手
不良信息举报
您举报文章:ZOJ - 3880 Demacia of the Ancients
举报原因:
原因补充:

(最多只允许输入30个字)