Skip to content

Instantly share code, notes, and snippets.

View inspirit941's full-sized avatar

Donggeon Lee inspirit941

View GitHub Profile
# -*- coding: utf-8 -*-
# UTF-8 encoding when using korean
from collections import deque
M, N = map(int, input().split())
maps = []
start = []
for y in range(N):
temp = list(map(int, input().split()))
for x in range(M):
# -*- coding: utf-8 -*-
# UTF-8 encoding when using korean
import sys
import heapq
from collections import defaultdict
n = int(sys.stdin.readline())
work_list = [list(map(int,sys.stdin.readline().replace("\n","").split())) for _ in range(n)]
# 날짜 순 오름차순 정렬
# ex) 현재가 7일이면, 마감일이 6일 이전인 일들을 작업할 수 없다.
# -*- coding: utf-8 -*-
# UTF-8 encoding when using korean
import sys
N = int(sys.stdin.readline())
M = int(sys.stdin.readline())
arr = [0 for _ in range(N+1)]
for _ in range(M):
idx = int(sys.stdin.readline())
arr[idx] = 1
import sys
import heapq
from collections import defaultdict
def solve(precede_list, build_next, time, target):
# 조건 없이 바로 만들 수 있는 건물들 찾기
queue = [(time[idx], idx) for idx in range(1, len(precede_list)) if precede_list[idx] == 0]
# 시간순서로 정렬. 가장 시간 짧은 것부터 뽑아내는 min heap 사용
heapq.heapify(queue)
import heapq
import sys
# 중앙값 기준으로 작은 값 = left, 큰 값 = right
left, right = [], []
n = int(sys.stdin.readline())
for _ in range(n):
num = int(sys.stdin.readline())
if len(left) == len(right):
# max_heap.
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the climbingLeaderboard function below.
def climbingLeaderboard(scores, alice):
#!/bin/python3
import math
import os
import random
import re
import sys
from collections import Counter
# Complete the isValid function below.
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the bigSorting function below.
def bigSorting(unsorted):
#!/bin/python3
import math
import os
import random
import re
import sys
from collections import deque, defaultdict
# Complete the findShortest function below.
from itertools import chain
# 2d Array에서 네 개의 문자열이 사각형 모양으로 일치할 경우를 파악하기
def find_square(maps):
table = [[0 for _ in range(len(maps))] for _ in range(len(maps))]
for y in range(1, len(maps)):
for x in range(1, len(maps)):
if maps[y-1][x-1] == maps[y-1][x] == maps[y][x-1] == maps[y][x] and maps[y][x] != "#":
table[y-1][x-1] += 1
table[y-1][x] += 1
table[y][x-1] += 1