전체 글(101)
-
백준 10773 파이썬
https://www.acmicpc.net/problem/10773 10773번: 제로 첫 번째 줄에 정수 K가 주어진다. (1 ≤ K ≤ 100,000) 이후 K개의 줄에 정수가 1개씩 주어진다. 정수는 0에서 1,000,000 사이의 값을 가지며, 정수가 "0" 일 경우에는 가장 최근에 쓴 수를 지우고, 아닐 경 www.acmicpc.net input_data = int(input()) stack = [] for _ in range(input_data): i = int(input()) if i != 0: stack.append(i) else: stack.pop() print(sum(stack))
2023.02.20 -
백준 14425 파이썬
https://www.acmicpc.net/problem/14425 14425번: 문자열 집합 첫째 줄에 문자열의 개수 N과 M (1 ≤ N ≤ 10,000, 1 ≤ M ≤ 10,000)이 주어진다. 다음 N개의 줄에는 집합 S에 포함되어 있는 문자열들이 주어진다. 다음 M개의 줄에는 검사해야 하는 문자열들이 주어 www.acmicpc.net import sys input = sys.stdin.readline N, M = map(int,input().split()) nums_data = set([input() for _ in range(N)]) count = 0 for _ in range(M): words = input() if words in nums_data: count += 1 print(count..
2023.02.20 -
[AP News] Study: Don’t blame climate change for South American drought
https://apnews.com/article/science-weather-climate-and-environment-water-shortages-argentina-de1354320432a0a61dfd617df6eaba68 Study: Don't blame climate change for South American drought Climate change isn’t causing the multi-year drought that is devastating parts of Argentina, Uruguay, Brazil and Bolivia, but warming is worsening some of the dry spell’s impacts, a new study says. apnews.com Cli..
2023.02.20 -
백준 15596 파이썬
def solve(num_list): result = 0 for num in num_list: result += num return result
2023.02.19 -
백준 2941 파이썬
https://www.acmicpc.net/problem/2941 2941번: 크로아티아 알파벳 예전에는 운영체제에서 크로아티아 알파벳을 입력할 수가 없었다. 따라서, 다음과 같이 크로아티아 알파벳을 변경해서 입력했다. 크로아티아 알파벳 변경 č c= ć c- dž dz= đ d- lj lj nj nj š s= ž z= www.acmicpc.net words_list = ['c=','c-','dz=','d-','lj','nj','s=','z='] input_data = input() for j in words_list: input_data = input_data.replace(j, '$') print(len(input_data))
2023.02.19 -
백준 11654 파이썬
https://www.acmicpc.net/problem/11654 11654번: 아스키 코드 알파벳 소문자, 대문자, 숫자 0-9중 하나가 주어졌을 때, 주어진 글자의 아스키 코드값을 출력하는 프로그램을 작성하시오. www.acmicpc.net print(ord(input()))
2023.02.19