add to gothib
This commit is contained in:
commit
523f45b46a
28 changed files with 419 additions and 0 deletions
36
doubleo7.py
Normal file
36
doubleo7.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
num_actions = int(input(""))
|
||||
|
||||
my_ammo = 0
|
||||
my_score = 0
|
||||
|
||||
their_ammo = 0
|
||||
|
||||
for their_action in input(""):
|
||||
|
||||
if their_action == "R":
|
||||
their_ammo += 1
|
||||
|
||||
if their_action == "R" and my_ammo == 0:
|
||||
# print("R", end="")
|
||||
my_ammo += 1
|
||||
elif their_action == "R" and my_ammo > 0:
|
||||
# print("F", end="")
|
||||
my_ammo -= 1
|
||||
my_score += 1
|
||||
elif their_action == "B":
|
||||
# print("R", end="")
|
||||
my_ammo += 1
|
||||
elif their_action == "F" and their_ammo > 0:
|
||||
# print("B", end="")
|
||||
their_ammo -= 1
|
||||
pass
|
||||
elif their_action == "F" and their_ammo == 0:
|
||||
if my_ammo > 0:
|
||||
# print("F", end="")
|
||||
my_ammo -= 1
|
||||
my_score += 1
|
||||
else:
|
||||
# print("R", end="")
|
||||
my_ammo += 1
|
||||
|
||||
print(my_score)
|
Loading…
Add table
Add a link
Reference in a new issue