목록Algorithm/Python (4)
cgy12306
# https://www.acmicpc.net/problem/16918 # 봄버맨 import copy def print_map(): for i in range(n): for j in range(m): if TimeMap[i][j] == 0: print('.', end='') else: print('O', end='') print() def set_bomb(): for i in range(n): for j in range(m): if Map[i][j] == '.': TimeMap[i][j] = 0 else: TimeMap[i][j] = 2 def flow_time(): for i in range(n): for j in range(m): if TimeMap[i][j] == 0: TimeMap[i][j] =..
# https://www.acmicpc.net/problem/1094 # 막대기 data = int(input()) cnt = 0 while data > 0: if data % 2 != 0: cnt += 1 data = data//2 print(cnt)
#https://www.acmicpc.net/problem/9935 #문자열폭발 import sys s = sys.stdin.readline()[:-1] bomb = sys.stdin.readline()[:-1] stack = [] for ch in s: stack.append(ch) if stack[-1] == bomb[-1] and "".join(stack[-len(bomb):]) == bomb: del stack[-len(bomb):] answer = "".join(stack) if answer == "": print("FRULA") else: print(answer)