본문 바로가기

전체 글115

[BOJ/C++]10799_쇠막대기 https://www.acmicpc.net/problem/10799 ##문제 풀기 전 내가 알고 있었어야 할 개념:1_ "Stack_SIZE" 와 "막대기 개수"와 관련이 있다는 것을 눈치 채기 어려웠다.=> 앞으로, Stack_SIZE를 상황에 매칭하는 습관을 가져보자 2_ Pop()할 때, 연산 값이 변할텐데, 그 때 많이 상황을 분석하면서, Case분류하는 것이 매우매우 시발 어려웠다.   2_1) 레이저의 Pop() => Stack_size()를 막대기 개수에 합한다.    2_2) 레이저가 아닐때, Pop() => 막대기 개수++   2_3) 최종 막대기의 끝지점 Pop() (Stack이 Empty()일 때)## 예제입력 1 분석 노트 정리##코드 12345678910111213141516171.. 2024. 7. 13.
[BOJ/C++]17414번_단어뒤집기 2 https://www.acmicpc.net/problem/17413★학교 시험때도 냈던 문제 (C언어로 했을 때보다 C++로 하는게 더 어려운 이상한 문)   ##문제 풀기 전 내가 알고 있었어야 할 개념: 결과 문자열을 저장할 자료구조를 char 문자열이 아닌 Vector로 함(c언어와 다르게)나의 답이 Chat gpt의 답과 다를게 없는 논리 구조 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283#include iostream>#include deque>#include v.. 2024. 7. 13.
(8)[Chapter5]정렬_퀵정렬(이론 + 코드), 작성중 #내가 전까지 써왔던 Partition()의 퀵소트 코드1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283#includestdio.h>#includestdlib.h>#includemath.h>#includetime.h>#pragma warning (disable : 4996) int Partition(int* arr,int start, int end) {     //1_ random으로 pivot 선정하기     int ridx = start + rand() % (end - s.. 2024. 7. 11.
[BOJ/C++]9093번_단어뒤집기 https://www.acmicpc.net/problem/9093#스택에 대표적인 문제..1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#include iostream>#include string>#include stack> using namespace std; void init() {    ios::sync_with_stdio(false);    cin.tie(0);    cout.tie(0);} int main() {     init();     int N;     cin >> N;    cin.ignore();     for (int i = .. 2024. 7. 11.