Algorithm89 [백준] 7568번 덩치 쉬운 문제 import sys N = int(sys.stdin.readline()) dataList = [] for i in range(N): dataList.append(list(map(int, sys.stdin.readline().split()))) for i in range(N): count = 1 for j in range(N): if dataList[i][0] < dataList[j][0] and dataList[i][1] < dataList[j][1]: count += 1 print(count, end=" ") 2020. 11. 25. [백준] 2941번 크로아티아 알파벳 쉬운 문제.. def converter(str): dataList = ["c=", "c-", "dz=", "d-", "lj", "nj", "s=", "z="] for i in range(8): str = str.replace(dataList[i], "0") return len(str) print(converter(input())) 2020. 11. 25. [백준] 9012번 괄호 어이 없게... 개행문자 처리를 안해줘서 오래 걸렸다.. 뭔가 어려운 문제가 아닌데 라는 생각을 하다가... 디버거로 보니까... 개행문자가 껴있... import sys def correctCheck(str): tempList = [] for i in range(len(str)): if str[i] == "(": tempList.append("(") else: if len(tempList) > 0: if tempList.pop() != "(": return "NO" else: return "NO" if len(tempList) > 0: return "NO" return "YES" N = int(sys.stdin.readline()) for i in range(N): print(correctCheck(s.. 2020. 11. 25. [백준] 5622번 다이얼 처음엔 그래프로 구현하려다가 뭔가... 생각보다 비효율적인 구조일꺼 같다는 생각에 그냥 하드하게 때려박은 리스트에 in 연산을 해서 구현했다.. 음.. 더 좋은 방법 없으려나.. 가장 좋은 코드는 가독성 좋고 성능 나쁘지 않은 코드이긴한데.. Str = input() numList = ["ABC", "DEF", "GHI", "JKL", "MNO", "PQRS", "TUV", "WXYZ"] ans = 0 for i in range(len(Str)): for j in range(len(numList)): if Str[i] in numList[j]: ans += j + 3 break print(ans) 2020. 11. 24. 이전 1 ··· 6 7 8 9 10 11 12 ··· 23 다음