K

@kimjuha19

위험한 지역 몇개인지 알려주기

Python
6 months ago
height = [[3, 6, 2, 8], [7, 3, 4, 2], [8, 6, 7, 3], [5, 3, 2, 9]] tu = [(0,-1),(0,1),(-1,0),(1,0)] temp = [] count = 0 for y in range(4): for x in range(4): temp.clear() current = height[y][x] temp.append(current)

n일장이 열리는날은 언제인가요

Python
6 months ago
a = 4 b = 6 answer = 0 for i in range(1, b): if (a * i) % b == 0: answer = a * i break print(answer)

벌금구하기

Python
6 months ago
cars = [110, 98, 125, 148, 120, 112, 89] speed = 100 answer = 0 for x in cars: if x >= speed * 11 / 10 and x < speed * 12 / 10: answer += 3 elif x >= speed * 12 / 10 and x < speed * 13 / 10: answer += 5 elif x >= speed *

열심히 모은 point 돌려드립니다

Python
6 months ago
point = 2323 if point < 1000: point = 0 point = point // 100 * 100 print(point)

시험합격자는 몇명이지?

Python
6 months ago
scores = [[90, 88, 70], [85, 90, 90], [100, 100, 70], [30, 90, 80], [40, 10, 20], [83, 88, 80]] dap = 0 for student in scores: answer = 0 if student[0] >= 80: answer += 1 if student[1] >= 88: answer += 1 if student[2

엘레베이터의 총 이동거리 구하기

Python
6 months ago
floors = [1, 2, 5, 4, 2] result = 0 for i in range(len(floors)-1): distance = abs(floors[i] - floors[i+1]) result += distance print(result)

내 절반이 여기에 있는가?

Python
6 months ago
arr = [4, 8, 3, 6, 7] answer = 0 for i in arr: if i/2 in arr: answer += 1 print(answer)

주차장에 몇대가 들어올수 있는 거야?

Python
6 months ago
numbers = [3285, 1724, 4438, 2988, 3131, 2998] day = 17 n = 0 count = 0; if day % 10 % 2 == 1: n += 1 else: n += 2

남은 재료로 주스만들기

Python
6 months ago
num_apple = 5 num_carrot = 1 k = 2 answer = 0 if num_apple < (3 * num_carrot): answer = num_apple // 3 else: answer = num_carrot

타일 색칠 방법 구하기

Python
6 months ago
tile_length = 11 answer = '' com = 'RRRGGB' if tile_length % 6 == 1 or tile_length % 6 == 2 or tile_length % 6 == 4: answer = '-1' else: for i in range(tile_length): answer += com[i % 6] print(answer)

학생의 등수구하기

Python
6 months ago
score = [20,60,98,59] n = 1 score.sort(reverse=True) for x in score: if x == 59: print(n) else: n += 1

투표에 대한 후보 찾기

Python
6 months ago
counter = [0 for _ in range(0,6)] votes = [2, 5, 3, 4, 1, 5, 1, 5, 5, 3] for x in votes: counter[x] += 1 cnt = 0 for c in counter: if c == 2: cnt += 1 print(cnt)

상품권 총 지급액 구하기

Python
6 months ago
purchase = [150000, 210000, 399990, 990000, 1000000] total = 0 for p in purchase: if p >= 1000000: total += 50000 elif p >= 600000: total += 30000 elif p >= 400000: total += 20000

섭씨 화씨 온도 바꾸기

Python
6 months ago
value = 527 unit = "C" if unit == "C": converted = value * 1.8 + 32 elif unit == "F": converted = (value - 32) / 1.8 print(converted)

몬스터 공격하기

Python
6 months ago
attack = 30 recovery = 10 hp = 60 count = 0 while True: hp -= attack count += 1 if hp <= 0:

짝수들의 제곱 구하기

Python
6 months ago
N = 4 M = 7 answer = 0 for x in range(N, M+1): if x % 2 == 0: answer += x ** 2 print(answer)

연속 중복 문자 제거 코드

Python
7 months ago
def solution(characters): result = characters[0] for ch in characters[1:]: if ch != result[-1]: result += ch return result print(solution("senteeeencccccceeee"))

문자열 내 ‘소수’ 개수 찾기

Python
7 months ago
text = "ab23cd5ef17gh" numbers = [int(ch) for ch in text if ch.isdigit()] def is_prime(n): if n < 2: return False for i in range(2, int(n**0.5)+1): if n % i == 0: return False

숫자 배열에서 연속 증가 구간 길이

Python
7 months ago
arr = [1,2,3,2,3,4,5,1] cnt = 1 maxCnt = 0 for i in range(1,len(arr)): if arr[i] == arr[i-1]+1: cnt+=1 else: if maxCnt < cnt:

가장 많이 등장한 문자 찾기

Python
7 months ago
word = input() result = {} for ch in word: if ch in result: result[ch] += 1 else: result[ch] = 1