[백준 바킹독] 0x09 - BFS 토마토(7576)
Introduction
https://www.acmicpc.net/problem/1085
import sys
input = sys.stdin.readline
x, y, w, h = map(int,input().split())
print(min(min(x,w-x),min(y,h-y)))
https://www.acmicpc.net/problem/15829
50점
import sys
input = sys.stdin.readline
L = int(input())
string = input().rstrip("\n")
r = 31
m = 1234567891
H = 0
for i in range(len(string)):
H = H + (ord(string[i])-96)*r**i
print(H)
import sys
input = sys.stdin.readline
lists = []
string = input().rstrip("\n")
lists.append(string)
while string != '0':
string = input().rstrip("\n")
lists.append(string)
lists = lists[:-1]
result = ['']*len(lists)
for i in range(len(lists)):
result[i] = "yes"
for j in range(0,len(lists[i])//2):
if lists[i][j] != lists[i][-j-1]:
result[i] = "no"
break
for r in result:
print(r)
https://www.acmicpc.net/problem/10814
나이를 입력받고 intager로 변환하지 않으면 잘못 정렬 될 수 있다.
import sys
input = sys.stdin.readline
N = int(input())
member = {}
age_list = []
for _ in range(N):
age, name = input().split()
if age not in member.keys():
member[age] = [name]
age_list.append(int(age))
else:
member[age].append(name)
age_list.sort()
for a in age_list:
for m in member[str(a)]:
print("{} {}".format(a,m))
https://www.acmicpc.net/problem/2805
시간초과
import sys
input = sys.stdin.readline
N, M = map(int,input().split())
lists = list(map(int,input().split()))
maximum = max(lists)
result = 0
for m in range(maximum-1,-1,-1):
cut = []
for l in lists:
cut.append(max(l-m,0))
S = sum(cut)
if S >= M:
result = m
break
print(result)
import sys
input = sys.stdin.readline
K = int(input())
money = []
for _ in range(K):
number = int(input())
if number != 0:
money.append(number)
else:
money.pop()
if len(money) == 0:
print(0)
else:
print(sum(money))
https://www.acmicpc.net/problem/2108
from collections import Counter
import sys
input = sys.stdin.readline
N = int(input())
s = 0
numbers = []
catch = {}
for _ in range(N):
num = int(input())
s += num
numbers.append(num)
numbers.sort()
print(round(s/N))
print(numbers[N//2])
nums = Counter(numbers).most_common()
if N > 1:
if nums[0][1] == nums[1][1]:
print(nums[1][0])
else:
print(nums[0][0])
else:
print(nums[0][0])
print(numbers[-1]-numbers[0])
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
1167 트리의 지름
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Git 명령어를 사용한 하위 디렉토리 다운로드 Clone 할 로컬 저장소 생성
Introduction
# Fetch the submodule commits into the main repository git remote add submodule_origin git://url/to/submodule/origin git fetch submodule_origin
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Graph
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Introduction
Spring Project
the page for java
가벼운 Base image를 사용
version: 3.0.0a10
WIDTH
version: 3.0.0a10
#include <iostream> #include <thread> #include <chrono> #include <mutex> #include <atomic> #include <string.h>
version: 3.0.0a10
https://cplusplus.com/reference/future/
Multithreading support was introduced in C++11.
how to costom github blog using jekyll
You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different wa...