본문 바로가기

전체 글

B_1934 #include using namespace std; int gcd(int a, int b) { int r = a % b; if (r == 0) return b; return gcd(b, r); } int main(void) { int T, A, B, temp, answer; cin >> T; for (int i = 0; i > A >> B; if (A >= B) temp = gcd(A, B); else temp = gcd(B, A); answer = A * B / temp; cout 더보기
B_11478 #include #include using namespace std; int main(void) { string S; set answer; cin >> S; for (int i = 0; i < S.length(); ++i) { string temp = ""; for (int j = i; j < S.length(); ++j) { temp += S[j]; answer.insert(temp); } } cout 더보기
B_1620 #include #include #include #include #include using namespace std; map dictionary; static bool comp(pair &a, pair &b) { return a.second second; } int main(void) { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int N, M; cin >> N >> M; for (int i = 1; i > temp; dictionary.insert({temp, i}); } vector dicVec(dictionary.begi.. 더보기
B_7785 set/hash/map set은 연관 컨테이너로, key-value의 구조를 가지는 자료구조이다. 연관 컨테이너는 주로, - 특정 키가 연관 컨테이너에 존재하는지 유무를 알려주는 기능 - 만일 존재한다면, 이에 대응되는 값을 알려주는 기능 이 대표적인데, C++의 경우 위 두 가지 작업을 모두 처리할 수 있는 '연관 컨테이너'를 제공한다. 전자인 존재유무는 Set/Multiset이 이를 담당하며, 후자인 대응 값 탐색은 Map/Multimap이 담당한다. set의 특징은 원소의 추가-삭제 작업의 시간 복잡도가 O(logN)으로 굉장히 빠르다는 점이다. 또한, set은 중복된 원소를 허용하지 않으며, 정렬된 상태를 유지한다는 점이 장점이다. 이러한 특성과 더불어, 자체적으로 'find' 메소드를 제공, 컨.. 더보기
Game Engine Developing #7 #7 생성된 엔티티의 이름 변경 및 로그 출력 더보기
Game Engine Developing #6 #6 Scene의 Entity생성 및 생성된 Entity 제어 더보기
Game Engine Developing #5 #5 생성된 프로젝트 열기, 기본적인 프로젝트 레이아웃 구성, Scene 생성 더보기
Game Engine Developing #4 #4 생성된 프로젝트 파일을 Open Porject에 목록으로 생성, 생성된 목록을 더블클릭/Open 버튼으로 열기, 만일 프로젝트가 존재하지 않는다면 버튼 비활성화 더보기