π
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BOJ 1712 μμ΅λΆκΈ°μ | |
def solve(a, b, c): | |
n = c - b | |
if n <= 0: | |
return -1 | |
else: | |
return a // n + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ### 체μ€ν μ‘°κ° λ¬Έμ | |
# ```plantuml | |
# @startuml | |
# autonumber | |
# μκ·Όμ΄ --> λνμ΄: 체μ€νμ ν±μΌλ‘ μλ₯΄λ €κ³ νλ€. | |
# μκ·Όμ΄ --> λνμ΄: | |
# note left | |
# 1. 체μ€νμ μ΅λ Nλ² μλ₯Ό μ μκ³ , | |
# 2. λ³μ νννκ²λ§ μλ₯Ό μ μλ€. | |
# 3. λ μλ₯Ό λλ 체μ€νμ κ·Έ λ³μ νμͺ½ λμμ λ€λ₯Έμͺ½ λκΉμ§ μλΌμΌ νλ€. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solve(a, b): | |
return abs(a - b) | |
if __name__ == '__main__': | |
a, b = map(int, input().split()) | |
print(solve(a, b)) | |
def test_input_1(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solve(numbers: list): | |
tot = sum(numbers) | |
if tot == 0: | |
return 0 | |
elif tot > 0: | |
return '+' | |
elif tot < 0: | |
return '-' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
######################################################## | |
# Essential packages for remote debugging and login in | |
######################################################## | |
RUN apt-get update && apt-get upgrade -y && apt-get install -y \ | |
apt-utils gcc g++ openssh-server cmake build-essential gdb gdbserver rsync vim | |
RUN mkdir /var/run/sshd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
gdbserver: | |
build: | |
context: ./ | |
dockerfile: ./Dockerfile | |
image: clion_dev | |
security_opt: | |
- seccomp:unconfined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:7 | |
RUN useradd dev | |
RUN echo 'dev:mypass' | chpasswd | |
RUN yum install -y openssh-server rsync | |
RUN ssh-keygen -N '' -t rsa -f /etc/ssh/ssh_host_rsa_key && \ | |
ssh-keygen -N '' -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key && \ | |
ssh-keygen -N '' -t ed25519 -f /etc/ssh/ssh_host_ed25519_key | |
RUN echo /usr/sbin/sshd >> /root/.bashrc && source /root/.bashrc | |
RUN sed -i 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/' /etc/ssh/sshd_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solve(real_list, dream_list): | |
real_cnt = len(real_list) | |
dream_cnt = len(dream_list) | |
max_level_cnt = (dream_cnt - real_cnt) // (real_cnt - 1) | |
# 첫λ²μ§Έ μμλ₯Ό ꡬνλ€. | |
first_elem = real_list[0] | |
first_elem_idx_list = [] | |
min_max = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
# λ¬Έμ : νμ€μΉΌμ μΌκ°ν | |
* νμ€μΉΌμ μΌκ°νμ μνμ μ΄ν κ³μλ₯Ό μΌκ°νμ ννλ‘ μ«μλ₯Ό λ°°μ΄ν ꡬμ±μ λ§νλ€. | |
* νμ€μΉΌμ μΌκ°νμ μ²μ λ μ€μ μ μΈνκ³ μλ‘ λ§λ€μ΄μ§λ μ€μ μλ‘μ΄ μ«μλ μμ€μ μΌμͺ½ μμ μ€λ₯Έμͺ½ μλ₯Ό λν΄μ λ§λ€μ΄μ§λ€. | |
* λν μ μΌ λ§¨ 첫μ€μ νλμ μ«μλ 1μ΄λ€. | |
1 | |
1 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
## λ¬Έμ : λ°°μ΄μμ λ€μμ μμ μ°ΎκΈ° | |
- μ μν λ°°μ΄μ΄ μ£Όμ΄μ‘μ λ, λ€μμ μμλ₯Ό μ°Ύμ보μ. | |
- λ€μμ μμλ λ°°μ΄ λ΄μμ [n / 2] λ² (floor(n / 2))λ₯Ό μ΄κ³Όνμ¬ λνλλ μμλ₯Ό λ§νλ€. | |
- μλ₯Ό λ€μ΄μ, λ°°μ΄ μμμ μ΄ κ°μκ° 9κ°λΌλ©΄, n / 2λ 4.5μ΄λ€. κ²°κ΅μ 5λ² μ΄μ λνλλ μμλ₯Ό μ°ΎμΌλ©΄ λλ€. | |
- λ°°μ΄μ νμ 1κ° μ΄μμ μμλ₯Ό κ°μ§κ³ μμΌλ©°, λ€μμ μκ° λ¬΄μ‘°κ±΄ νλ μ‘΄μ¬ νλ€κ³ κ°μ νμ. | |
## μ νμ¬ν : | |
- μ μν λ°°μ΄μ΄ μ£Όμ΄μ§λ€. |
OlderNewer