1. 코딩 문제 풀기
import sys
input = sys.stdin.readline
def fight(Jun_locate,JunATK, JunHP, monster):
for m in monster:
if Jun_locate == m[0]-1:
while True:
m[2] -= JunATK
if m[2] <= 0:
break
JunHP -= m[1]
return JunHP
def escape(world_length, strength, world, j_atk, j_hp, monster, rl):
j_locate = world.index("@")
if rl == 'left':
while True:
j_locate-=1
if j_locate < 0 :
return False
if world[j_locate] == '#':
strength -= 1
if strength < 0 :
return False
elif world[j_locate] == '&':
j_hp = fight(j_locate,j_atk,j_hp,monster)
if j_hp <= 0:
return False
elif world[j_locate] == 'O':
return True
else:
while True:
j_locate+=1
if j_locate > world_length-1:
return False
if world[j_locate] == '#':
strength -=1
if strength < 0 :
return False
elif world[j_locate] == '&':
j_hp = fight(j_locate,j_atk,j_hp,monster)
if j_hp <= 0:
return False
elif world[j_locate] == 'O':
return True
def main():
testcase = int(input())
for _ in range(testcase):
# 입력받는 곳
mapLength, strength, monsters = map(int, input().split())
world = input()
JunATK, JunHP = map(int, input().split())
Jatk = JunATK
Jhp = JunHP
monster=[list(map(int, input().split())) for mon in range(monsters) ]
input()
if escape(mapLength, strength, world, Jatk, Jhp, monster,'right') or escape(mapLength, strength, world, Jatk, Jhp, monster,'left'):
print("YES")
else:
print("NO")
if __name__ == "__main__":
main()
2. 인프런 수업 듣기
3. 스픽 15분
영어 말하기 공부를 하고, 코딩문제를 풀었다.
'2023여름방학_모각코' 카테고리의 다른 글
진저비어 팀: 모각코 5주차 모임 활동결과(23.08.02 / 수요일 / 20:00~23:00) (0) | 2023.08.02 |
---|---|
진저비어 팀: 모각코 5주차 모임 목표(23.08.02 / 수요일 / 20:00~23:00) (0) | 2023.08.02 |
진저비어 팀: 모각코 4주차 모임 목표(23.07.26 / 수요일 / 20:00~23:00) (0) | 2023.07.26 |
진저비어 팀: 모각코 3주차 모임 활동결과(23.07.19 / 수요일 / 20:00~23:00) (0) | 2023.07.19 |
진저비어 팀: 모각코 3주차 모임 목표(23.07.19 / 수요일 / 20:00~23:00) (0) | 2023.07.19 |