본문 바로가기

C++197

[Programmers] Lv 2. 행렬의 곱셈 https://school.programmers.co.kr/learn/courses/30/lessons/12949 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include using namespace std; vector solution(vector arr1, vector arr2) { vector answer; for (int i = 0; i < arr1.size(); i++) //arr1 { vector tmp; for (int j = 0; j < arr2[0].size(); j++) //arr2 { int value = 0; f.. 2023. 6. 14.
[Programmers] (월간 코드 챌린지 시즌3) Lv 2. n^2 배열 자르기 https://school.programmers.co.kr/learn/courses/30/lessons/87390 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include using namespace std; vector solution(int n, long long left, long long right) { vector answer; // 굳이 2차원 배열을 만들어서 모든 값을 초기화할 필요는 없다. // left와 right 까지의 필요한 공간만을 n으로 행열을 계산해서 도출할 수 있다. for (long i = left; i .. 2023. 6. 13.
[Programmers] Lv 2. 연속 부분 수열 합의 개수 https://school.programmers.co.kr/learn/courses/30/lessons/131701 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; int solution(vector elements) { vector v = elements; set s(elements.begin(), elements.end()); for (int i = 1; i < v.size(); ++i) // 위에서 선언할 때, 길이가 1인 연속부분수열은 계산했으니 1부터 시작 { f.. 2023. 6. 12.
[Programmers] (정렬) Lv 2. H-Index https://school.programmers.co.kr/learn/courses/30/lessons/42747 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; int solution(vector citations) { sort(citations.begin(), citations.end(), greater()); // 내림차순 정렬 // 인덱스가 값보다 크다면, 그 전 인덱스를 리턴 for (int i = 0; i < citations.size(); ++i) { if (.. 2023. 6. 11.
[Programmers] (월간 코드 챌린지 시즌2) Lv 2. 괄호 회전하기 https://school.programmers.co.kr/learn/courses/30/lessons/76502# 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; int solution(string s) { int answer = 0; for (auto iter = s.begin(); iter != s.end(); ++iter) { string temp = s; stack st; // 후입선출로 괄호가 올바른지 체크 int start = iter - s.begin(); .. 2023. 6. 10.
[Programmers] Lv 2. 귤 고르기 https://school.programmers.co.kr/learn/courses/30/lessons/138476?language=cpp 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include using namespace std; int solution(int k, vector tangerine) { int answer = 0; map m; // map에 개수만큼 저장 for_each(tangerine.begin(), tangerine.end(), [&](const auto& el) { m[el]+.. 2023. 6. 7.
[DirectX12 - Component] Chapter 04. Scene GitHub : https://github.com/developeSHG/DX12-Component/commits/04.Scene GitHub - developeSHG/DX12-Component: DirectX12 - Component DirectX12 - Component. Contribute to developeSHG/DX12-Component development by creating an account on GitHub. github.com 2023. 6. 5.
[DirectX12 - Component] Chapter 03. Component GitHub : https://github.com/developeSHG/DX12-Component/commits/03.Component GitHub - developeSHG/DX12-Component: DirectX12 - Component DirectX12 - Component. Contribute to developeSHG/DX12-Component development by creating an account on GitHub. github.com 유니티는 Component 방식. 조립하는 방식. MonoBehavior를 다 상속받는다 언리얼은 상속 방식. Actor -> Pawn -> ... -> ... 2023. 6. 5.
[DirectX12 - Component] Chapter 02. Material GitHub : https://github.com/developeSHG/DX12-Component/commits/02.Material GitHub - developeSHG/DX12-Component: DirectX12 - Component DirectX12 - Component. Contribute to developeSHG/DX12-Component development by creating an account on GitHub. github.com 2023. 6. 5.
[DirectX12 - Component] Chapter 01. Input과 Timer GitHub : https://github.com/developeSHG/DX12-Component/commits/01.Input%EA%B3%BC_Timer GitHub - developeSHG/DX12-Component: DirectX12 - Component DirectX12 - Component. Contribute to developeSHG/DX12-Component development by creating an account on GitHub. github.com 2023. 6. 5.