코딩테스트

    1335. Minimum Difficulty of a Job Schedule 풀이 python

    https://leetcode.com/problems/minimum-difficulty-of-a-job-schedule/ Minimum Difficulty of a Job Schedule - LeetCode Can you solve this real interview question? Minimum Difficulty of a Job Schedule - You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the ith job, you have to finish all the jobs j where 0 int: N = len(jobDifficulty) if d > N: return -1 dp = [[-1] * (..

    codility의 PrettyTiling 문제를 보며 느낀점

    https://app.codility.com/programmers/challenges/carol_of_the_code2022/ Carol of the Code challenge Take part in our Carol of the Code challenge. app.codility.com # you can write to stdout for debugging purposes, e.g. # print("this is a debug message") import sys sys.setrecursionlimit(10 ** 9) answer = 987654321 def solution(A): # Implement your solution here answer = 987654321 N = len(A) for i i..

    파이썬 시간이 줄어드는 요소들 정리한거

    1. 테두리검사는 def로 안하는게 좋은듯. (다른사람꺼 코드) # 나이트의 이동 # https://www.acmicpc.net/problem/7562 # pypy3 -> 통과 # python3 -> 시간초과 import sys from collections import deque input = sys.stdin.readline adjacent_indices = ((-2, -1), (-1, -2), (1, -2), (2, -1), (-2, 1), (-1, 2), (1, 2), (2, 1)) def is_valid_index(board, r, c): if r < 0 or c < 0: return False if len(board)

    백준 input = sys.stdin.readline 차이

    https://www.acmicpc.net/problem/1260 문제 풀다가 발견했다. input = sys.stdin.readline 를 적용 한것과 안한것과 차이가 꽤 난다. 재귀 제한도 푸는것도 포함해서 밑에 적겠다. 왠만하면 써야겠다. import sys sys.setrecursionlimit(10 ** 9) input = sys.stdin.readline