분류 전체보기94 [반례모음] 백준 2839번: 설탕 배달 python 파이썬 1. 문제 https://www.acmicpc.net/problem/2839 2839번: 설탕 배달 상근이는 요즘 설탕공장에서 설탕을 배달하고 있다. 상근이는 지금 사탕가게에 설탕을 정확하게 N킬로그램을 배달해야 한다. 설탕공장에서 만드는 설탕은 봉지에 담겨져 있다. 봉지는 3킬로그 www.acmicpc.net 2. 풀이 DP 3. 구현 import sys # sys.stdin = open('input.txt') import math target = int(sys.stdin.readline().strip()) lis = [math.inf]*5002 lis[3] = 1 lis[5] = 1 for i in range(6, target+1): lis[i] = min(lis[i-3]+1, lis[i-5]+1) .. 2021. 8. 6. 백준 1620번: 나는야 포켓몬 마스터 이다솜 python 파이썬 1. 문제 https://www.acmicpc.net/problem/1620 1620번: 나는야 포켓몬 마스터 이다솜 첫째 줄에는 도감에 수록되어 있는 포켓몬의 개수 N이랑 내가 맞춰야 하는 문제의 개수 M이 주어져. N과 M은 1보다 크거나 같고, 100,000보다 작거나 같은 자연수인데, 자연수가 뭔지는 알지? 모르면 www.acmicpc.net 2. 풀이 3. 구현 import sys # sys.stdin=open('input.txt') sys.setrecursionlimit(10**8) # @profile def main(): n,m = map(int, sys.stdin.readline().strip().split()) # lis=[0]*(n+2) lis=[] lis_digit=[0]*(n+2) .. 2021. 8. 6. [테스트케이스 추가] 백준 1719번: 택배 파이썬, python 1. 문제 https://www.acmicpc.net/problem/1719 1719번: 택배 명우기업은 2008년부터 택배 사업을 새로이 시작하기로 하였다. 우선 택배 화물을 모아서 처리하는 집하장을 몇 개 마련했지만, 택배 화물이 각 집하장들 사이를 오갈 때 어떤 경로를 거쳐야 하 www.acmicpc.net 2. 풀이 다익스트라 3. 구현 import sys # sys.stdin = open('input.txt') import math import heapq n,m = map(int, sys.stdin.readline().strip().split()) gph=[[] for _ in range(n+2)] for i in range(m): s,e,w = map(int, sys.stdin.readline.. 2021. 8. 6. [테스트케이스추가] 백준 1269번: 대칭 차집합 python 파이썬 1. 문제 https://www.acmicpc.net/problem/1269 1269번: 대칭 차집합 첫째 줄에 집합 A의 원소의 개수와 집합 B의 원소의 개수가 빈 칸을 사이에 두고 주어진다. 둘째 줄에는 집합 A의 모든 원소가, 셋째 줄에는 집합 B의 모든 원소가 빈 칸을 사이에 두고 각각 주어 www.acmicpc.net 2. 풀이 3. 구현 # https://simsimjae.tistory.com/214 import sys sys.stdin =open('input.txt') # @profile def main(): a,b=map(int, sys.stdin.readline().strip().split()) a_lis = list(map(int, sys.stdin.readline().strip().s.. 2021. 8. 6. 이전 1 2 3 4 5 6 7 ··· 24 다음 반응형