본문 바로가기

C++197

[Programmers] (2021 KAKAO BLIND RECRUITMENT) Lv 2. 메뉴 리뉴얼 https://school.programmers.co.kr/learn/courses/30/lessons/72411 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include using namespace std; void combination(set& set, const string& str, string res, int r, int next) { if (res.length() == r) { set.insert(res); return; } for (int i = next; i < str.length(); .. 2023. 8. 3.
[Programmers] (2022 KAKAO TECH INTERNSHIP) Lv 2. 두 큐 합 같게 만들기 https://school.programmers.co.kr/learn/courses/30/lessons/118667 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include #include using namespace std; int solution(vector queue1, vector queue2) { int answer = 0; long sum1 = ::accumulate(queue1.begin(), queue1.end(), 0), sum2 = ::accumulate(queue2.begin(), .. 2023. 8. 1.
[Programmers] [투포인터] Lv 2. 연속된 부분 수열의 합 https://school.programmers.co.kr/learn/courses/30/lessons/178870 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include using namespace std; #include #include using namespace std; vector solution(vector sequence, int k) { int s = 0, e = 0; int sum = sequence[0]; // 부분 수열의 합 int subLen = sequence.size() + 1; // 부분 수열의 길이 pa.. 2023. 7. 31.
[C++20 - Concurrency] Chapter 02. jthread GitHub :https://github.com/developeSHG/CPP20-Concurrency/commit/1fa6cf85079def1f9bab259ed5d87a2a34ce0fce jthread · developeSHG/CPP20-Concurrency@1fa6cf8 developeSHG committed Jul 31, 2023 github.com #include using namespace std; #include #include #include #include #include #include #include #include #include #include // 오늘의 주제 : jthread mutex mut; void ThreadMain() { mut.lock(); while (true) { /.. 2023. 7. 29.
[C++20 - Concurrency] Chapter 01. semaphore GitHub :https://github.com/developeSHG/CPP20-Concurrency/commit/bee2dd6954b6e98d7d49eea69ef7a396e80b3c50 semaphore · developeSHG/CPP20-Concurrency@bee2dd6 developeSHG committed Jul 31, 2023 github.com #include using namespace std; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #incl.. 2023. 7. 29.
[C++20 - STL] Chapter 10. 기타 함수 (source_location, bind_front, is_constant_evaluated) GitHub :https://github.com/developeSHG/CPP20-STL/commit/510c81469eab6b2c27ef46c766e52530522ea00e #include using namespace std; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // 오늘의 주제 : 기타 함수 void PrintLog(const char* filename, int line) { cout 2023. 7. 29.
[C++20 - STL] Chapter 09. Format GitHub :https://github.com/developeSHG/CPP20-STL/commit/cb123d6135d3a84da367eef150526f32e1c29e18 Format · developeSHG/CPP20-STL@cb123d6 developeSHG committed Jul 31, 2023 github.com #include using namespace std; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // 오늘의 주제 : Format int main() { // C에서의 Format Stri.. 2023. 7. 29.
[C++20 - STL] Chapter 08. TimeZone GitHub : https://github.com/developeSHG/CPP20-STL/commit/0d2f77f5a451c7d627adeff8b5a3e66bd45d0fef TimeZone · developeSHG/CPP20-STL@0d2f77f developeSHG committed Jul 29, 2023 github.com 온라인 게임 (한국/북미/유럽) 프랑스/독일/러시아/영국/... - 각 나라마다 시차가 존재한다. ex) 와우 - 오전 6시에 던전/일일퀘 리셋 등 나라별로 기준이 다름. 그래서 DB 시간 저장할 때? 로컬 시간? UTC 시간? UTC (Coordinated Universal Time 협정 세계시) Local Time (실행 환경) UTC와 Local Time은 서로 반대의 개념.. 2023. 7. 29.
[C++20 - STL] Chapter 07. Calendar GitHub : https://github.com/developeSHG/CPP20-STL/commit/4ebf046aaaaa6ab79bd3c9ae22865e620b797569 Calendar · developeSHG/CPP20-STL@4ebf046 developeSHG committed Jul 29, 2023 github.com 시간이 왜 그렇게 중요할까? // 예를 들어보자면, 서버쪽에서 매일 7시마다 던전이 초기화된다고 가정해보자. // 매일 7시니 시간을 판별할 수 있는 수단이 필요할 것이다. // 근데 아침 7시 자체가 국가마다 시간이 다 다르다. // 한국 서버를 할 떄랑 유럽 서버를 할 떄랑 현지 몇 시에 있는 시간을 따라갈 것 인지 // 아니면 글로벌하게 영국시간 기준으로 할 것인지 등 여러.. 2023. 7. 29.
[C++20 - STL] Chapter 06. 비트 연산 GitHub : https://github.com/developeSHG/CPP20-STL/commit/912ccfda4bff865920630e1a05e9e2c101bde57c 비트 연산 · developeSHG/CPP20-STL@912ccfd developeSHG committed Jul 28, 2023 github.com 비트 연산이 자주 사용하느냐? // - 암호학 // - 게임서버 ID (uint64) - 숫자가 거대하니 다 쓰지 않다보니 // - 기타 알고리즘 문제 // 피자집 : 피자 주문하는데, 0~19번 스무가지의 토핑이 존재 bool toppings[20]; // 위처럼 배열로 그냥 20개를 만들어 줄 수 있지만, // 피자가 아니라 mmorpg의 플레이어가 만든 커스터마이징 데이터였다고 .. 2023. 7. 29.