분류 전체보기246 erase https://cho001.tistory.com/164 C++ 벡터 특정 원소 지우는 방법 vector.erase(),remove() 등 Tips 1. Erase를 활용하는 방법 벡터 v에서 i번째 원소를 삭제하고 싶다면 erase 함수를 사용하면 된다. erase 함수의 인자는 iterator 즉, 지우고 싶은 원소의 주소이다. http://www.cplusplus.com/reference/vector/v.. cho001.tistory.com https://modoocode.com/240 C++ 레퍼런스 - string 의 erase 함수 modoocode.com iterator erase(const_iterator position); iterator erase(const_iterator first, .. 2021. 11. 6. 최소 비용 신장 트리 , 섬연결하기 https://mjmjmj98.tistory.com/75 [알고리즘] MST(Minimum Spanning Tree, 최소 신장 트리) - Prim(프림), Kruskal(크루스칼) 알고리즘 목차 Spanning Tree 개념 MST(최소 신장 트리) 개념 Prim's Algorithm Kruskal's Algorithm Spanning Tree (신장 트리) 그래프 내의 모든 정점들을 포함하는 그래프의 부분집합(subgraph) Tree 최소한의 간선들로.. mjmjmj98.tistory.com https://mjmjmj98.tistory.com/76 [프로그래머스 / C++] 섬 연결하기 문제 링크: programmers.co.kr/learn/courses/30/lessons/42861 코딩테스트 연.. 2021. 11. 5. 탐욕법 탐욕법 - 각 순간에 최선의 경우를 택하는 방식 단 순간의 최선이 결국 최대의 최선이 만족될때에만 실행 https://programmers.co.kr/learn/courses/30/lessons/42862 코딩테스트 연습 - 체육복 점심시간에 도둑이 들어, 일부 학생이 체육복을 도난당했습니다. 다행히 여벌 체육복이 있는 학생이 이들에게 체육복을 빌려주려 합니다. 학생들의 번호는 체격 순으로 매겨져 있어, 바로 앞번 programmers.co.kr #include #include //#include #include #include using namespace std; int solution(int n, vector lost, vector reserve) { int answer = 0; int count =.. 2021. 11. 4. 용어 정리 hal : Hardware Abstraction Layer -> periperal API 라고 생각함 CMSIS란? CMSIS란 Cortex Microcontroller Software Interface Standard의 약자로, 소프트웨어 제품들 간 호환성을 고도화 시키고 소프트웨어 이식성을 증대 시키기 위해 ARM 사에서 개발한 소프트웨어 프레임워크 이다. 출처: https://www.basic4mcu.com/bbs/board.php?bo_table=d1&wr_id=20 FPU (floating point unit) ; 부동소수점 처리장치 2021. 10. 26. stm32cubeide 설치 블로그 , IDE tip https://m.blog.naver.com/chandong83/221751170518 STM32CubeIDE 설치 및 간단 사용 리뷰 - STM32 무료 개발 환경(컴파일러) 이전에는 TrueStudio를 사용하였다. 그런데 TrueStudio는 더 이상 지원하지 않는다는 소식을 듣고 좀 ... blog.naver.com 프로젝트 자동저장위치 C:\Users\pmj\STM32CubeIDE\workspace_1.7.0 IDE tip 단축키 : Alt+Shift+A : Block selection mode ,visual studio 의 알트 버튼 Editor zoom in and zoom out • Ctrl++ : zoom in text • Ctrl+- : zoom out text // 프로젝트 생성법 [.. 2021. 10. 26. 전화번호 목록 https://programmers.co.kr/learn/courses/30/lessons/42577 코딩테스트 연습 - 전화번호 목록 전화번호부에 적힌 전화번호 중, 한 번호가 다른 번호의 접두어인 경우가 있는지 확인하려 합니다. 전화번호가 다음과 같을 경우, 구조대 전화번호는 영석이의 전화번호의 접두사입니다. 구조 programmers.co.kr #include #include #include #include #include using namespace std; bool solution(vector phone_book) { bool answer = true; int Max_size = 0; map mp; for ( auto it = phone_book.begin(); it != phone_book.e.. 2021. 10. 24. map map 은 dictonary 같은 자료형으로 key value 쌍을 이룬다. c++ 에서 map 은 항상 key 기준으로 오름차순을 정령된다. p.s) 내림차순 정렬을 위해서는 map mp ; 와 같이 정의해 주면 되다. 1. map 선언 데이터 추가 방법 // insert mx1.insert({ "abp",1 }); mx1.insert({ "bbb",2 }); mx1["ccc"] = 3; for (auto it = mx1.begin(); it != mx1.end(); it++) { cout first 2021. 10. 24. tow sum https://leetcode.com/problems/two-sum/submissions/ Two Sum - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com #include #include #include #include using namespace std; class Solution { public: vector twoSum(vector& nums, int target) { vector Tnums(nums); sort(nums.begin(), nums.end().. 2021. 10. 24. 연산자 오버 로딩 (리턴 타입) operator(연산자) (연산자가 받는 인자) ex) bool operator==(MyString& str); ex) 복소수 클래스 생성 #include using namespace std; class Complex { private: double real, img; public: Complex(double real, double img) : real(real), img(img) {} Complex(const Complex& com) { real = com.real; img = com.img; } Complex operator+(const Complex& com) const; Complex operator-(const Complex& com) const; Complex& operator=.. 2021. 10. 18. 이전 1 2 3 4 5 6 ··· 28 다음