일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 깡돼후
- preemption #
- JanusGateway
- 코루틴 컨텍스트
- VARCHAR (1)
- python
- PersistenceContext
- JanusWebRTCGateway
- kotlin
- taint
- tolerated
- PytestPluginManager
- Value too long for column
- pytest
- 헥사고날아키텍처 #육각형아키텍처 #유스케이스
- 개성국밥
- 달인막창
- terminal
- table not found
- Spring Batch
- JanusWebRTC
- JanusWebRTCServer
- 코루틴 빌더
- 겨울 부산
- 자원부족
- vfr video
- k8s #kubernetes #쿠버네티스
- 오블완
- mp4fpsmod
- 티스토리챌린지
목록Algorithm (192)
너와 나의 스토리
문제: https://programmers.co.kr/learn/courses/30/lessons/64061 문제 풀이: stack을 이용하여 쌓아 올리면 됨. 소스 코드: #include #include #include using namespace std; int cur[32]; stack st; int solution(vector board, vector moves) { int answer = 0; int row = board.size(); int col = board[0].size(); //init for (int i = 0; i < col; i++) { for (int j = 0; j =row) continue; if (st.empty()) { st.push(board[cur[curP]][curP..
문제: https://www.acmicpc.net/problem/2225 문제 풀이: 예제를 통해 규칙성을 찾아보자 위 예제를 통해 점화식이 다음과 같이 세울 수 있다 * dp[k][n]: 정수 k개를 사용해서 n을 만든 경우 수 점화식 → dp[k][n]= dp[k-1][0]+dp[k-1][1]+ ... +dp[k-1][n] = $\sum_{i=0}^{n}dp[k-1][i]$ #include #include #include using namespace std; typedef long long ll; ll n, k, dp[202][202]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n >> k; for ..
문제: https://www.acmicpc.net/problem/1654 문제 풀이: binary search 알고리즘을 이용하여 가능한 최대 길이를 찾는다. 소스 코드: 더보기 #include #include #include using namespace std; typedef long long ll; ll k, n,arr[10002]; ll sum; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> k >> n; for (int i = 0; i >arr[i]; ll l = 1, r = pow(2,31)-1; ll res = 0; while (l > 1; sum = 0; for (int ..
소스 코드: #include #define QSIZE 200002 using namespace std; int arr[100]; void swap(int a, int b) { int tmp = arr[a]; arr[a] = arr[b]; arr[b] = tmp; } void func(int l, int r) { if (l >= r) return; int pivot = arr[l]; int i = l; int j = r; while (i pivot) j--; if (i > arr[i]; } func(0, 9); for (int i = 0; i < 10; i++) { cout
문제: https://www.acmicpc.net/problem/5525 문제 풀이: 변수 설명: io: 현재 위치까지 "IO"가 연속해서 나온 횟수 res: 지금껏 나온 $P_N$의 개수 문자열을 처음부터 끝까지 한 번만 보면서 다음 연산을 한다. 직전 문자가 'I'였고, 지금 '0'라면 io++; 직전 문자가 '0'였고, 지금 'I'라면 연속된 IO개수가 n보다 크다면 $P_N$을 만족한 것이므로 res++; 둘 다 아니라면, IO 모양이 제대로 형성되지 못했으므로 io=0; 소스 코드: 더보기 #include #include #include using namespace std; int n, m,res; int main() { ios::sync_with_stdio(false); cin.tie(NULL..
문제: https://www.acmicpc.net/problem/14889 문제 풀이 1: - 재귀 ateam[20], bteam[20] 1~N 번 중 위 두 팀에 속할 선수들을 재귀로 선택 두 팀 모두 인원수가 n/2일 때, 능력치 계산 시간: 20ms 소스 코드: 더보기 #include #include #include #include #include #include #include #define INF 987654321 using namespace std; int n,arr[21][21],ateam[21],bteam[21],res; void func(int at,int bt,int cur) { if (at== n / 2 && bt==n/2) { int asum = 0, bsum = 0; for (in..
문제: https://www.acmicpc.net/problem/2468 문제 풀이 1 - BFS: 입력 중 가장 높은 지역의 높이를 maxH라고 하자. 모든 높이에 대해 다음 연산을 수행한다. 현재 높이를 h라고 할 때, h보다 큰 값들을 bfs를 통해 덩어리의 개수를 구한다. 이때 visit 변수를 사용하게 되는데 높이마다 새롭게 visit 변수를 표시해야 한다. 이를 memset을 이용하여 초기화해도 되지만, 이렇게 하면 시간을 더 소비하게 된다. 그래서 나는 visit을 true, false로 표시하는 것 대신, 현재 높이로 방문한 사실을 기록하여 visit 변수 초기화하지 않아도 되도록 하였다. 시간: 668ms 소스 코드: 더보기 #include #include #include #include..
문제: https://www.acmicpc.net/problem/1541 문제 풀이: +, - 기호만 사용 - 가 나오면 그 뒤는 전부 -|값|으로 연산해주면 된다. -> 괄호로 묶을 수 있기 때문에 소스 코드: 더보기 #include #include #include #include using namespace std; string s, num; int res; int main() { ios::sync_with_stdio(false); cin.tie(NULL), cout.tie(NULL); string s; cin >> s; bool flag = true; for (int i = 0; i < s.size(); i++) { if (s[i] == '+' || s[i]=='-') { if(flag) res +..