1. 문제https://www.acmicpc.net/problem/4779 2. 풀이def change_cantor(list): cube_root = len(list)**(1/3) breakpoint = int(len(list) / 3) if(cube_root == 1): print(list[0], end='') return else: list1, list2, list3 = list[0:breakpoint], list[breakpoint:breakpoint*2], list[breakpoint*2:] list2 = [' ' for _ in range(len(list2))] change_cantor(list1) ..
1. 문제https://www.acmicpc.net/problem/2108 2. 풀이import sysfrom collections import Counterinput = sys.stdin.readlinen = int(input())digits = []total_sum = 0for i in range(n): x = int(input()) digits.append(x) total_sum += x# 산술평균print(round(total_sum / n))# 중앙값digits.sort()print(digits[n//2])# 두 번째로 작은 최빈값num_counts = Counter(digits)freq_list = sorted(num_counts.items(), key=lambda x: (..
1. 문제https://www.acmicpc.net/problem/26069 2. 풀이import sysinput = sys.stdin.readlineN = int(input())chong = ["ChongChong"]for _ in range(0, N): x, y = map(str, input().strip().split()) if x in chong: chong.append(y) elif y in chong: chong.append(x) else: continueresult = list(set(chong))print(len(result))
1. 문제https://www.acmicpc.net/problem/10811 2. 풀이import sysn, m = map(int, input().split())baskets_list = [int(x+1) for x in range(n)]for k in range(m): i, j = map(int, sys.stdin.readline().split()) num = j-i+1 # 바꿔야 하는 개수 # 슬라이싱을 통해 목표 부분을 새로운 리스트로 뽑아낸 후, # 해당 목표 리스트를 역순으로 정렬한다. reverse_range_list = baskets_list[i-1:j] reverse_range_list.reverse() # 역순으로 정렬해둔 리스트의 요소들을 순서대로..
1. 문제https://www.acmicpc.net/problem/4949 2. 풀이import sysfrom collections import dequewhile True: test_sentence = sys.stdin.readline().strip() if(test_sentence == '.'): break stack = deque() flag = True for char in test_sentence: # print(char) if(char == '(' or char == '['): stack.append(char) elif(char == ')'): if(len(st..
- Total
- Today
- Yesterday
- 베라의 패션
- 데이터추상화
- 직사각형
- 파이썬
- 약수
- 개발계발
- 26069
- 25304
- 배수와약수
- 붙임성 좋은 총총이
- 피보나치수5
- C99
- 삼각형과세변
- SWLIfeCycle
- 브라우저
- SW생명주기
- 브라우저뜻
- 27323
- 약수들의합
- 과제안내신분
- python
- C언어
- 4779
- 배수
- 다음소수
- 칸토어 집합
- 점근적표기
- 알고리즘
- 25314
- 백준
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |