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. 숫자를 무작위로 5개 입력 받기 -> array로 관리 (list x) | |
// 2. 그 숫자들이 홀수인지, 짝수인지 출력하기 | |
// 3. 짝수인 경우에는 그 숫자의 절반까지 카운트 하기 | |
// | |
// array, when 사용하기 | |
fun kotlin7() { | |
println("게임을 시작합니다. 정수를 5번 입력하세요") | |
var gameArray = Array<Int>(size = 5, init = { it + 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
fun main() { | |
println("11. 연산자의 개요 및 단항, 산술 연산자 사용하기") | |
// 산술연산자 +-*/ | |
// 이미 다 아는 것들이죠? | |
var value: Int = 0 | |
value = 8 | |
println(value) |
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
# 2653 : 규칙에 맞는 이진수 만들기 | |
N = int(input()) | |
max = 0 | |
for i in range(1, N+1): | |
max += 2**(N-i) | |
count = 0 | |
for n in range(max + 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
# codeup 2650 | |
# 디지털 도어 락 | |
# 자물쇠는 1000이하 자연수 | |
# 키는 자물쇠의 약수이면 열림 | |
# 세가지 자물쇠의 만능키를 구하라 | |
# 단, 키의 값이 클수록 비용이 작으므로 가장 저렵한 키를 만들어 줘야 함. | |
locks = list(map(int, input().split())) |
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
# codeup 2641 | |
# 숏다리의 계단 오르기 | |
N = int(input()) | |
count = 0 | |
def climb(remains, penalty): |
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
# 4564 계단 오르기 | |
# 룰1 : 계단은 1칸이나 2칸 올라갈 수 있음 | |
# 룰2 : 계단 1칸을 연속 3번 올라갈 수 없음 | |
# 룰3 : 마지막 계단은 무조건 밟아야 함. | |
import sys | |
sys.setrecursionlimit(1000) |
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
import sys | |
sys.setrecursionlimit(60000) | |
n = int(input()) | |
count = 0 | |
memo = [0 for _ in range(100001)] | |
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
array = list() | |
array.append([1]) | |
def pascal_triangle(): | |
length = len(array) | |
if length != 100: | |
temp_array = [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
PRINT_VALUES = ['not cross', 'cross'] | |
a, b = map(int, input().split()) | |
c, d = map(int, input().split()) | |
a -= 1 | |
b -= 1 | |
c -= 1 | |
d -= 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 = int(input()) | |
result = 0 | |
array = list() | |
def calculateOdd(n): | |
if n != 1: | |
result = 3 * n + 1 | |
else: | |
result = 1 |
NewerOlder