Kicker(分析模拟)

C. Kicker
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Kicker (table football) is a board game based on football, in which players control the footballers' figures mounted on rods by using bars to get the ball into the opponent's goal. When playing two on two, one player of each team controls the goalkeeper and the full-backs (plays defence), the other player controls the half-backs and forwards (plays attack).

Two teams of company Q decided to battle each other. Let's enumerate players from both teams by integers from 1 to 4. The first and second player play in the first team, the third and the fourth one play in the second team. For each of the four players we know their game skills in defence and attack. The defence skill of the i-th player is ai, the attack skill is bi.

Before the game, the teams determine how they will play. First the players of the first team decide who will play in the attack, and who will play in the defence. Then the second team players do the same, based on the choice of their opponents.

We will define a team's defence as the defence skill of player of the team who plays defence. Similarly, a team's attack is the attack skill of the player of the team who plays attack. We assume that one team is guaranteed to beat the other one, if its defence is strictly greater than the opponent's attack and its attack is strictly greater than the opponent's defence.

The teams of company Q know each other's strengths and therefore arrange their teams optimally. Identify the team that is guaranteed to win (if both teams act optimally) or tell that there is no such team.

Input

The input contain the players' description in four lines. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 100)— the defence and the attack skill of the i-th player, correspondingly.

Output

If the first team can win, print phrase "Team 1" (without the quotes), if the second team can win, print phrase "Team 2" (without the quotes). If no of the teams can definitely win, print "Draw" (without the quotes).

Sample test(s)
input
1 100
100 1
99 99
99 99
output
Team 1
input
1 1
2 2
3 3
2 2
output
Team 2
input
3 3
2 2
1 1
2 2
output
Draw
Note

Let consider the first test sample. The first team can definitely win if it will choose the following arrangement: the first player plays attack, the second player plays defence.

Consider the second sample. The order of the choosing roles for players makes sense in this sample. As the members of the first team choose first, the members of the second team can beat them (because they know the exact defence value and attack value of the first team).

 

      题意:

      给出4组信息,代表1,2,3,4号人物的 defence 和 attack ,1,2号是一队的,3,4号是一队的。每组都要选一个人作为 defence 和 attack,两个必须是不同的人,求出胜利的队伍。某队的 defence > attack 且 attack > defence 为获胜。1队先出阵容,2队可以根据1队再出阵容。

 

      思路:

      一队要赢的话,那么需要选出1个队伍无论二队选择什么都必须能赢的。当1队出完后,2队要赢,则至少有一队要打赢。除此之外都是打平。

 

      AC:

#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int main () {
        int a1, b1, a2, b2, ta1, tb1;
        int a3, b3, a4, b4, ta2, tb2;
        scanf("%d%d%d%d", &a1, &b1, &a2, &b2);
        scanf("%d%d%d%d", &a3, &b3, &a4, &b4);

        if (((a1 > b3 && b2 > a4) && (a1 > b4 && b2 > a3)) ||
            ((a2 > b3 && b1 > a4) && (a2 > b4 && b1 > a3))) puts("Team 1");

        else if (((b1 < a3 && a2 < b4) || (b1 < a4 && a2 < b3)) &&
                 ((b2 < a3 && a1 < b4) || (b2 < a4 && a1 < b3))) puts("Team 2");

        else puts("Draw");

        return 0;
}

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
local Receiver2Balldir = function() return function() return CRple2BallDir("Receiver") end end local Kicker2Balldir = function () return function() return CRole2BallDir("Kicker") end end local RobotPosX = function(role) return function() return COurRole_x(role) end end local RobotPosY = function (role) return function() return COurRole_y(role) end end local BallPosX = function() return function() return CGetBallX()+40 end end local BallPosY = function() return function () return CGetBallY()+70 end end gPlayTable.Createplay{ firstState = "start1", ["start1"] = { switch = function () if CBall2RoleDist("kicker")<25 and CRole2TargetDist("Receiver")<3 then return "passball" end end, kicker = task.kickerTask("getBall2"), Receiver = task.ReceiverTask("GoToP"), }, ["passball"] = { switch = function () if CBall2RoleDist("kicker")>30 then return "receive" end end, kicker = task.kickerTask("passball"), Receiver = task.GotoPos("Receiver",RobotPosX("Receiver"),RobotPosY("Receiver"),Receiver2Balldir()) }, ["receive"] = { switch = function () if Cbuf_cnt(CBall2RoleDist("Receiver")<20,30) then return "shoot" end end, Kicker = Task.kickerTask("shoot"),--Gotopos("Kicker",RobotPosX("Kicker"),RobotPosY("Kicker"),Receiver2Balldir()), Receiver = task.ReceiverTask("Receiver2"),--接球后退 }, ["shoot"] = { switch = function () --if Cbuf_cnt(CBall2RoleDist("Receiver")<12,20) then return "shoot" --end end, Kicker = task.kickerTask("shoot"), Receiver = task.GotoPos("Receiver",230,100,Receiver2Balldir()), }, name = "Y" }
最新发布
07-12

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值