ZOJ - 3880 Demacia of the Ancients

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/AcmAres/article/details/79954297

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;
}

Defense of the Ancients

06-05

Problem DescriptionnDefense of the Ancients (commonly known as DotA) is a custom scenario for the real-time strategy video game Warcraft III: Reign of Chaos and its expansion, Warcraft III: The Frozen Throne, based on the "Aeon of Strife" map for StarCraft. The objective of the scenario is for each team to destroy the opponents' Ancients, heavily guarded structures at opposing corners of the map. Players use powerful units known as heroes, and are assisted by allied heroes and AI-controlled fighters called "creeps". As in role-playing games, players level up their heroes and use gold to buy equipment during the mission. nnDefense of the Ancients pits two teams of players against each other: the Sentinel and the Scourge. Players on the Sentinel team are based at the southwest corner of the map, and those on the Scourge team are based at the northeast corner. Each base is defended by towers and waves of units which guard the main paths leading to their base. In the center of each base is the "Ancient", a building that must be destroyed to win the game. nnEach human player controls one Hero, a powerful unit with unique abilities. In DotA, players on each side choose one of 101 heroes, each with different abilities and tactical advantages over other heroes. The scenario is highly team-oriented; it is difficult for one player to carry the team to victory alone. Defense of the Ancients allows up to ten players in a five-versus-five format and an additional two slots for referees or observers, often with an equal number of players on each side. nnIn DotA, each hero has three basic attributes: strength, agility and intellect. One point of strength can give the hero 19 points of life and 0.03 life regen per second; One point of agility increases the hero's attack speed by 1% and every 7 points of agility increases the hero's Armor by 1; One point of intellect gives the hero 13 points of mana and 0.03 mana regen per second. nnTo simplify the problem, we make the following conventions: one points of strength gives a hero S points of fighting ability; one points of agility gives a hero A points of fighting ability; one points of intellect gives a hero I points of fighting ability. S, A and I are fixed but unknown real numbers. A hero with 0 points of the three attributes has 0 points of fighting ability. When two heroes fight with each other, the one has higher fighting ability always win. When two heroes that have equal fighting ability meet, one of them randomly wins. nnBurning and AngleLover are both excellent DotA player. Burning is good at using the hero "Shadow Fiend" while AngleLover is famours for his "Rattletrap". They have fight with each other for n times. We knows the result and the attribute value of the two hero in each fight, but we don't know the exact value of S, A and I. Now given the attribute value of the two hero in other m fights, can you determine who will be the winer? nnIt is guaranteed that none of S A, and I is more than 100 times as high as another, and none of them are 0. nn nnInputnIn the first line of input file there is a single integer T, means the number of test cases. (1 ≤ T ≤ 10) nnFor each test case, in the first line there are two integers: n and m as mentioned above (0 ≤ n ≤ 300, 1 ≤ m ≤ 2000). Then there are n+m lines following. From line 2 to line n+1, each line describes a battle in the format: nnwinner S1 A1 I1 S2 A2 I2nnnThe string winner is either "Burning" or "AngleLover", S1, A1, I1 is the strength value, agility value and intellect value of Burning's hero respectively. And S2, A2, I2 is the strenght value, agility value and intellect value of AngleLover's hero respectively. nnFrom line n+2 to line n+m+1, each line describes battles whose result is to be determined in the format: nnS1 A1 I1 S2 A2 I2nnnEach variable's meaning is the same as the mentioned above. nnThe value of the attributes are all integers between 0 and 1000 inclusively. n nnOutputnFor each battle to be determined, output a string in a line: nnIf Burning will win the battle, output "Burning"; if AngleLover will win, output "AngleLover". If it is not sure, output "I don't know". nn nnSample Inputn1n3 3nBurning 6 5 4 5 4 7nAngleLover 5 4 2 3 5 5nBurning 9 0 10 8 2 7n6 6 4 5 4 7n9 0 10 8 2 6n3 4 8 4 4 6n nnSample OutputnBurningnBurningnI don't know

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试

关闭