11153 Kill boss
Time limit: 1000MS memory limit: 65535K
Number of submissions: 1090 Hits: 340
Question types: programming language: g++; Gcc
Description
Acmer recently like to play a game, the fighting style of the game is to block, Parry, attack-based, Acmer recently hit a boss dozen times, or did not win, but after several failures, Acmer probably found the boss of the law, so she made the corresponding out of the moves, Acmer by boss cut off n drops of blood will hang off, corresponding as long as the acmer before hanging off the boss m drops of blood, Acmer can win. Now give your boss the final strike table and Acmer, ask you who can win, if you can not win then output impossible. Note that this game can be offensive, given the coefficient k, we use a positive number to denote the attack factor, negative number to indicate the defensive coefficient, if both sides are attacks, the attack coefficient can break through the attack of others (that is, the opponent attack is invalid), and to the corresponding k points of damage, equal time do not hurt. When the two sides an attack, a defensive, the attack factor is greater than the defensive factor, you can break the defensive (that is, the opponent's defense is invalid), and give the opponent the corresponding K-point damage. When the defensive factor is not less than the attack factor, the attack can be defended. If both sides are defensive, nothing happens. (The person Xym)
Input format
The first line has three numbers n (1<=n<=1000), M (1<=m<=1000), D (1<=d<=10000), N for Acmer Blood, M for boss Blood, and D for the number of moves. Next there are two lines, the first line represents the boss's moves table, all the absolute value is not greater than 10000 the second line represents the Acmer of the move table. The absolute value of all numbers is not greater than 10000
Output format
Output one line to show who wins, Acmer said Acmer win, boss said boss win, Impossible said do not know who win.
Input sample
10 10 101 2 3-5 3-6 7 10 15 20-1-3-2 5 5-5 11 1 2 3
Output sample
Acmer
Author
Scau_acm
Very simple a simulation problem, water problem, do not explain, directly on the code:
1Include <stdio.h>2#include <math.h>3 4 intMain ()5 {6 intn,m,d,i;7scanf"%d%d%d",&n,&m,&d);8 intAcmer[d],boss[d];9 for(i=0; i<d;i++)Tenscanf"%d",&boss[i]); One for(i=0; i<d;i++) Ascanf"%d",&acmer[i]); - for(i=0; i<d;i++) - { the if(acmer[i]==Boss[i]) - Continue; - Else if(acmer[i]+boss[i]>0) - { + if(Fabs (Acmer[i]) >fabs (Boss[i])) -m-=Acmer[i]; + Else An-=Boss[i]; at } - if(n<=0) {printf ("boss"); Break;} - Else if(m<=0) {printf ("Acmer"); Break;} - } - if(n>0&&m>0) -printf"Impossible"); in return 0; -}
11153 Kill boss