본문 바로가기

C++197

[C++20 - 4th Emperor] Chapter 02. Module GitHub : https://github.com/developeSHG/CPP20-4th_Emperor/commit/7845069f15683d59fe2db806c997dfd7743fe475 Module · developeSHG/CPP20-4th_Emperor@7845069 developeSHG committed Jul 25, 2023 github.com C++20에 들어간 모든 기능을 통틀어서, 가장 중요하다 생각. C++20은 다른 언어들에 비해서 속도가 빠른 것이 장점 중 하나. 반면, 큰 단점은 문법이 복잡한편이다. 빌드 속도도 오래걸리는 편이다. 실행속도는 빠르다고 했지만, 실행하려면 우선 빌드가 통과해야 되고, 결과물을 추출한 다음 실행하게 되는데 그렇다면, 빌드 속도가 느려진다고 하면 큰 문제.. 2023. 7. 25.
[Programmers] (월간 코드 챌린지 시즌1) Lv 2. 쿼드압축 후 개수 세기 https://school.programmers.co.kr/learn/courses/30/lessons/68936 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include using namespace std; typedef struct _POS { size_t x; size_t y; } POS; class QurdTree { public: QurdTree(POS pos, size_t cnt) : _pos(pos), _cnt(cnt) { } void operator()(const vector& arr, vector& answer, co.. 2023. 7. 25.
[Programmers] (완전탐색) Lv 2. 소수 찾기 https://school.programmers.co.kr/learn/courses/30/lessons/42839# 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include #include #include using namespace std; // 순열 void permutation(string& numbers, set& s, string str, int r) { if (!str.empty()) s.emplace(stoi(str)); if (r == numbers.length()) return; for.. 2023. 7. 24.
[C++20 - 4th Emperor] Chapter 01. Concept GitHub : https://github.com/developeSHG/CPP20-4th_Emperor/commit/978ee4946379c5c446ef2d1fb9e7f8354ec1e671 Concept · developeSHG/CPP20-4th_Emperor@978ee49 developeSHG committed Jul 24, 2023 github.com // static void TestObject(T obj) where T : GameObject C#에는 제네릭 문법(C++의 템플릿과 유사)을 통해 타입을 동적으로 생성하면서 where를 통해 타입에 대해 부가적인 조건을 걸어 (어떤 클래스에 파생된다든지) 원하는 타입을 생성할 수 있었다. using System; namespace CSharp { c.. 2023. 7. 24.
[Programmers] (정렬) Lv 2. 가장 큰 수 https://school.programmers.co.kr/learn/courses/30/lessons/42746 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include #include #include using namespace std; string solution(vector numbers) { ::sort(numbers.begin(), numbers.end(), [](auto a, auto b) { string strA = to_string(a); string strB = to_string(b).. 2023. 7. 24.
[Programmers] (스택/큐) Lv 2. 다리를 지나는 트럭 https://school.programmers.co.kr/learn/courses/30/lessons/42583 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include using namespace std; int solution(int bridge_length, int weight, vector truck_weights) { int answer = 0; int idx=0; //차량 지목용 idx int sum=0; //현재 다리에 올라와있는 차량 무게 총합 queue q; //현재 다리를 건너는 트럭 체크용 큐 while(1){ .. 2023. 7. 23.
[Programmers] Lv 2. 롤케이크 자르기 https://school.programmers.co.kr/learn/courses/30/lessons/132265 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include #include using namespace std; int solution(vector topping) { map a, b; std::for_each(topping.begin(), topping.end(), [&](const auto& t) { ++b[t]; }); return std::accumulate(topping.begin.. 2023. 7. 21.
[Programmers] (월간 코드 챌린지 시즌2) Lv 2. 2개 이하로 다른 비트 https://school.programmers.co.kr/learn/courses/30/le\ssons/77885 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include #include using namespace std; vector solution(vector numbers) { return ::accumulate(numbers.begin(), numbers.end(), vector(), [&](auto acc, const auto& number) { // 공식 (짝수도 동일) // 3 = 01.. 2023. 7. 21.
[Programmers] Lv 2. 숫자 변환하기 https://school.programmers.co.kr/learn/courses/30/lessons/154538 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; void search(int x, int y, int n, int count, vector& v) { if (v[x] && count >= v[x]) return; v[x] = count; if (x + n 2023. 7. 20.
[DirectX12 - Mesh & Animation] Chapter 02. Animation(Skinning) GitHub : https://github.com/developeSHG/DirectX12-Mesh_Animation/commits/02.Animation(Skinning) GitHub - developeSHG/DirectX12-Mesh_Animation: DirectX12 - Mesh & Animation DirectX12 - Mesh & Animation. Contribute to developeSHG/DirectX12-Mesh_Animation development by creating an account on GitHub. github.com 애니메이션은 그림을 프레임 단위로 여러 개를 준비해뒀다가 빠르게 재생해서 마치 생동감있게 움직이는 것처럼 보이는 것이 기본적으로 애니메이션의 원리다. 2D 게.. 2023. 7. 20.