Github & Portfolio
๐ Problem Solving(119)
-
[ํ๋ก๊ทธ๋๋จธ์ค-Lv1] ๋ด์ / Python
์ฝ๋ฉํ ์คํธ ์ฐ์ต - ๋ด์ ๊ธธ์ด๊ฐ ๊ฐ์ ๋ 1์ฐจ์ ์ ์ ๋ฐฐ์ด a, b๊ฐ ๋งค๊ฐ๋ณ์๋ก ์ฃผ์ด์ง๋๋ค. a์ b์ ๋ด์ ์ return ํ๋๋ก solution ํจ์๋ฅผ ์์ฑํด์ฃผ์ธ์. ์ด๋, a์ b์ ๋ด์ ์ a[0]*b[0] + a[1]*b[1] + ... + a[n-1]*b[n-1] ์ ๋๋ค. (n์ a, b์ programmers.co.kr import sys input = sys.stdin.readline a = list(map(int, input().split())) b = list(map(int, input().split())) def solution(a, b): answer = 0 for i in range(len(a)): answer += a[i] * b[i] return answer print(soluti..
-
[ํ๋ก๊ทธ๋๋จธ์ค-Lv1] ํฌ๋ ์ธ ์ธํ๋ฝ๊ธฐ / Python
https://programmers.co.kr/learn/courses/30/lessons/64061 ์ฝ๋ฉํ ์คํธ ์ฐ์ต - ํฌ๋ ์ธ ์ธํ๋ฝ๊ธฐ ๊ฒ์ [[0,0,0,0,0],[0,0,1,0,3],[0,2,5,0,1],[4,2,4,4,2],[3,5,1,3,1]] [1,5,3,5,1,2,1,4] 4 programmers.co.kr import sys input = sys.stdin.readline n = int(input()) board = [list(map(int, input().split())) for _ in range(n)] moves = list(map(int, input().split())) def solution(board, moves): basket = [] answer = 0 for i in ran..
-
[ํ๋ก๊ทธ๋๋จธ์ค-Lv1] K๋ฒ์งธ์ / Python
์ฝ๋ฉํ ์คํธ ์ฐ์ต - K๋ฒ์งธ์ [1, 5, 2, 6, 3, 7, 4] [[2, 5, 3], [4, 4, 1], [1, 7, 3]] [5, 6, 3] programmers.co.kr import sys input = sys.stdin.readline n = int(input()) array = list(map(int, input().split())) commands = [list(map(int, input().split())) for _ in range(n)] def solution(array, commands): answer = [] for i in commands: temp = array[i[0] - 1 : i[1]] temp.sort() answer.append(temp[i[2] - 1]) return..
-
[ํ๋ก๊ทธ๋๋จธ์ค-Lv1] ๋ชจ์๊ณ ์ฌ / Python
์ฝ๋ฉํ ์คํธ ์ฐ์ต - ๋ชจ์๊ณ ์ฌ ์ํฌ์๋ ์ํ์ ํฌ๊ธฐํ ์ฌ๋์ ์ค๋ง์ ๋๋ค. ์ํฌ์ ์ผ์ธ๋ฐฉ์ ๋ชจ์๊ณ ์ฌ์ ์ํ ๋ฌธ์ ๋ฅผ ์ ๋ถ ์ฐ์ผ๋ ค ํฉ๋๋ค. ์ํฌ์๋ 1๋ฒ ๋ฌธ์ ๋ถํฐ ๋ง์ง๋ง ๋ฌธ์ ๊น์ง ๋ค์๊ณผ ๊ฐ์ด ์ฐ์ต๋๋ค. 1๋ฒ ์ํฌ์๊ฐ ์ฐ๋ programmers.co.kr import sys input = sys.stdin.readline answers = list(map(int, input().split())) def solution(answers): first = [1, 2, 3, 4, 5] second = [2, 1, 2, 3, 2, 4, 2, 5] third = [3, 3, 1, 1, 2, 2, 4, 4, 5, 5] score = [0, 0, 0] for i in range(len(answers)): if answers[i..
-
[ํ๋ก๊ทธ๋๋จธ์ค-Lv1] ์์ฃผํ์ง ๋ชปํ ์ ์ / Python
์ฝ๋ฉํ ์คํธ ์ฐ์ต - ์์ฃผํ์ง ๋ชปํ ์ ์ ์๋ง์ ๋ง๋ผํค ์ ์๋ค์ด ๋ง๋ผํค์ ์ฐธ์ฌํ์์ต๋๋ค. ๋จ ํ ๋ช ์ ์ ์๋ฅผ ์ ์ธํ๊ณ ๋ ๋ชจ๋ ์ ์๊ฐ ๋ง๋ผํค์ ์์ฃผํ์์ต๋๋ค. ๋ง๋ผํค์ ์ฐธ์ฌํ ์ ์๋ค์ ์ด๋ฆ์ด ๋ด๊ธด ๋ฐฐ์ด participant์ ์์ฃผํ ์ ์ programmers.co.kr import sys input = sys.stdin.readline participant = list(map(str, input().split())) completion = list(map(str, input().split())) def solution(participant, completion): participant.sort() completion.sort() for i in range(len(completion)): if completi..
-
[ํ๋ก๊ทธ๋๋จธ์ค-Lv1] ์ฒด์ก๋ณต / Python
์ฝ๋ฉํ ์คํธ ์ฐ์ต - ์ฒด์ก๋ณต ์ ์ฌ์๊ฐ์ ๋๋์ด ๋ค์ด, ์ผ๋ถ ํ์์ด ์ฒด์ก๋ณต์ ๋๋๋นํ์ต๋๋ค. ๋คํํ ์ฌ๋ฒ ์ฒด์ก๋ณต์ด ์๋ ํ์์ด ์ด๋ค์๊ฒ ์ฒด์ก๋ณต์ ๋น๋ ค์ฃผ๋ ค ํฉ๋๋ค. ํ์๋ค์ ๋ฒํธ๋ ์ฒด๊ฒฉ ์์ผ๋ก ๋งค๊ฒจ์ ธ ์์ด, ๋ฐ๋ก ์๋ฒ programmers.co.kr import sys input = sys.stdin.readline n = int(input()) lost = list(map(int, input().split())) reserve = list(map(int, input().split())) def solution(n, lost, reserve): setLost = set(lost) - set(reserve) setReserve = set(reserve) - set(lost) for i in setReserve:..