*16956-늑대와 양 (python, 파이썬)
R, C = map(int, input().split()) M = [list(input()) for i in range(R)] dx, dy = [0, 1, 0, -1], [1, 0, -1, 0] is_sheep = False for i in range(R): for j in range(C): if M[i][j] == 'W': for k in range(4): nx, ny = i + dx[k], j + dy[k] if nx < 0 or nx == R or ny < 0 or ny == C: continue if M[nx][ny] == 'S': is_sheep = True if is_sheep: print(0) else: print(1) for i in range(R): for j in range(C): if..
2020. 10. 17.
**16675-두 개의 손 (python, 파이썬)
""" S, R, P: 가위, 바위, 보 """ ML, MR, TL, TR = ('SRP'.index(i) for i in input().split()) if ML == MR and (ML+1) % 3 in [TL, TR]: print("TK") elif TL == TR and (TL+1) % 3 in [ML, MR]: print("MS") else: print("?")
2020. 10. 17.