profile
Gracelog

[12865] 평범한 배낭

Python Code

2022년 3월 21일
·
0개의 댓글
·

[10870] 피보나치 수 5

Python Code def fibonacci(num): result = 0 if num == 0: result = 0 elif num == 1: result = 1 elif num >= 2: result = fibonacci(num-1) + fibonacci(num-2) ret...

2021년 12월 16일
·
0개의 댓글
·

[백준] 10872 팩토리얼

Python Code def factorial(num): result = 1 while num > 1: result = num * result num = num-1 return result n = int(input()) print(factorial(n))

2021년 12월 16일
·
0개의 댓글
·

[백준] 3009 네번째 점

Python Code T = int(input()) for tc in range(1, T+1): x_list = [] y_list = [] resultx = resulty = 0 for _ in range(3): x, y = map(int, input().split()) x_list.append(x)...

2021년 12월 15일
·
0개의 댓글
·

[백준] 2581 소수

Python Code M = int(input()) N = int(input()) result = [] for i in range(M, N+1): flag = 0 if i > 1: for j in range(2, i): if i % j == 0: flag = 1 ...

2021년 12월 13일
·
0개의 댓글
·

[백준] 1978 소수찾기

Python Code N = int(input()) numbers = list(map(int, input().split())) cnt = 0 for i in range(N): flag = 0 if numbers[i] > 1: for j in range(2, numbers[i]): if numbers[i] %...

2021년 12월 13일
·
0개의 댓글
·

[백준] 1712 손익분기점

Python Code import sys sys.stdin = open('input.txt') T = int(input()) for tc in range(1, T+1): A, B, C = map(int, input().split()) if B>=C: print(-1) else: print(int(A/(C-B...

2021년 12월 9일
·
0개의 댓글
·

[백준] 15596 정수 N개의 합

Python Code def solve(a): sum = 0 for i in range(len(a)): sum += a[i] return sum

2021년 12월 8일
·
0개의 댓글
·

[백준] 5622 다이얼

Python Code T = int(input()) for tc in range(1, T+1): numbers = { 'A': 2, 'B': 2, 'C': 2, 'D': 3, 'E': 3, 'F': 3, 'G': 4, 'H': 4, ...

2021년 12월 8일
·
0개의 댓글
·

[백준] 4344 평균은 넘겠지

Python Code T = int(input()) for tc in range(1, T+1): score = list(map(int, input().split())) num = score.pop(0) sum = 0 for i in range(len(score)): sum += score[i] avg = s...

2021년 12월 8일
·
0개의 댓글
·

[백준] 2941 크로아티아 알파벳

Python Code T = int(input()) for tc in range(1, T+1): alphabet = ['c=', 'c-', 'dz=', 'd-', 'lj', 'nj', 's=', 'z='] word = input() cnt = 0 for i in range(len(alphabet)): if alph...

2021년 12월 8일
·
0개의 댓글
·

[백준] 1316 그룹 단어 체커

Python code T = int(input()) for tc in range(1, T+1): N = int(input()) cnt = 0 for i in range(N): word = input() use = [] flag = 1 for i in range(len(word))...

2021년 12월 8일
·
0개의 댓글
·

[SWEA] 10912 외로운 문자

Python Code T = int(input()) for tc in range(1, T+1): string = list(input()) result = [] for i in range(len(string)): if string.count(string[i]) % 2: if string[i] not i...

2021년 10월 19일
·
0개의 댓글
·

[백준] 1620 나는야 포켓몬 마스터 이다솜

Python Code import sys N, M = map(int, input().split()) name_dict = {} num_dict = {} num = 1 for _ in range(N): name = str(sys.stdin.readline()).strip() name_dict[num] = name num_dict[name...

2021년 10월 6일
·
0개의 댓글
·

[백준] 11723 집합

Python Code import sys M = int(sys.stdin.readline()) S = set() for _ in range(M): command = sys.stdin.readline().strip().split() if len(comma

2021년 10월 6일
·
0개의 댓글
·

[SWEA] 5203 베이비진 게임

Python Code T = int(input()) for tc in range(1, T+1): N = int(input()) time = [] checked = [0 for _ in range(25)] total = 0 for _ in range(N): s, e = map(int, input().split...

2021년 10월 6일
·
0개의 댓글
·

[SWEA] 5202 화물도크

Python Code T = int(input()) for tc in range(1, T+1): N = int(input()) time = [] checked = [0 for _ in range(25)] total = 0 for _ in range(N): s, e = map(int, input().split...

2021년 10월 6일
·
0개의 댓글
·

[SWEA] 5201 컨테이너 운반

Python Code T = int(input()) for tc in range(1, T+1): N, M = map(int, input().split()) box = list(map(int, input().split())) truck = list(map(int, input().split())) box.sort() box....

2021년 10월 6일
·
0개의 댓글
·

[SWEA] 1240 단순 2진 암호코드

Python Code password = { '0001101': 0, '0011001': 1, '0010011': 2, '0111101': 3, '0100011': 4, '0110001': 5, '0101111': 6, '0111011': 7, '0110111': 8, '0001011'...

2021년 9월 30일
·
0개의 댓글
·

[SWEA] 11387 몬스터 사냥

Python code T = int(input()) for tc in range(1, T+1): D, L, N = map(int, input().split()) n = 0 damage = 0 for i in range(N): damage += D * (1 + i * L * 1/100) print('#{} {...

2021년 9월 30일
·
0개의 댓글
·