[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문
제가 유니티, c# 자료구조 수업 듣다가 벨만포드 알고리즘까지 넘어가서 c++코드를 보고있는데요 vector 기능이 이해가 잘 안가서 질문 드립니다 ㅠㅠ 저는 adj 벡터를 페어를 502개 담을 수 있는 일차원 벡터라고 이해했는데요 21번째 줄은 u번째 인덱스로 접근해서 거기 있는 vector에 페어 { v, w } 를 집어넣어라 라는 뜻이잖아요? 그러데 이게 작동하려면 adj[u] 가 벡터여야 하는데 그렇게 되면 adj는 vector< vector < pair<int, int> > > 이런 형식으로, 벡터를 품고있는 2차원 벡터가 되어야 하는것 아닌가요? 근데 이렇게 코드를 쓰면 오류가 발생하네요 제가 어디를 잘못 이해하고 있는건지 잘 모르겠습니다.
MyConstant.cpp 가 Main.cpp 나 Test.cpp 처럼 헤더를 include 하지 않고도 값을 선언할 수 있었던 이유가 궁금합니다. 그리고 MyConstant.cpp 의 namespace 가 MyConstant.h 의 namespace와 같은 공간인지 궁금합니다.
강의와 관련있는 질문 을 남겨주세요. • 강의와 관련이 없는 질문은 지식공유자가 답변하지 않을 수 있습니다. (사적 상담, 컨설팅, 과제 풀이 등) • 질문을 남기기 전, 비슷한 내용을 질문한 수강생이 있는지 먼저 검색 을 해주세요. (중복 질문을 자제해주세요.) • 서비스 운영 관련 질문은 인프런 우측 하단 ‘문의하기’ 를 이용해주세요. (영상 재생 문제, 사이트 버그, 강의 환불 등) 질문 전달 에도 요령이 필요합니다. • 지식공유자가 질문을 좀 더 쉽게 확인할 수 있게 도와주세요. • 강의실 페이지 (/lecture) 에서 '질문하기'를 이용해주시면 질문과 연관된 수업 영상 제목이 함께 등록됩니다. • 강의 대시보드에서 질문을 남길 경우, 관련 섹션 및 수업 제목을 기재 해주세요. • 수업 특정 구간에 대한 질문은 꼭 영상 타임코드 를 남겨주세요! 구체적인 질문 일수록 명확한 답을 받을 수 있어요. • 질문 제목은 핵심 키워드를 포함해 간결하게 적어주세요. • 질문 내용은 자세하게 적어주시되, 지식공유자가 답변할 수 있도록 구체적으로 남겨주세요 . • 정확한 질문 내용과 함께 코드 를 적어주시거나, 캡쳐 이미지 를 첨부하면 더욱 좋습니다. 기본적인 예의 를 지켜주세요. • 정중한 의견 및 문의 제시, 감사 인사 등의 커뮤니케이션은 더 나은 강의를 위한 기틀이 됩니다. • 질문이 있을 때에는 강의를 만든 지식공유자에 대한 기본적인 예의를 꼭 지켜주세요. • 반말, 욕설, 과격한 표현 등 지식공유자를 불쾌하게 할 수 있는 내용 은 스팸 처리 등 제재를 가할 수 있습니다.
n = int(input()) arr = list(map(int, input().split())) res = [0] * n res[0] = 1 ans = 0 for i in range(1, n): maxVal = 0 for j in range(i): # 이 부분에서 선생님은 주로 내림차순으로 쓰셔서요! if arr[i] > arr[j] and res[j] > maxVal: maxVal = res[j] res[i] = maxVal + 1 ans = max(ans, res[i]) print(ans) 주석 부분처럼 선생님은 주로 내림차순으로 검사하시는데 오름차순으로 해도 상관 없는 것이 맞나요? 혹시 문제가 생기는 경우가 있다면 말씀해주시면 감사하겠습니다 :) +) 좋은 강의 만들어주셔서 감사합니다 많이 배우고 있어요 ㅎㅎ
이 문제의 지도 제한이 10만에 해당합니다. 그래서 처음에 코딩할 때 가로 세로를 10만으로 설정하게 되면 배열이 너무 크다고 에러가 나게 되네요... 그래서 가로 세로를 동적할당으로 한다고 쳐도 만약 10만이 들어오게 되면 에러가 나지 않나요??? 아니면 배열 크기에 대한 고려없이도 문제를 풀 수 있을까요?
전에는 npm install로 모듈 설치가 잘 되었는데, 강의 진행 도중에 install 하다 보니 계속 다음과 같은 오류가 발생합니다. $ npm i passport-kakao npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it! npm WARN nodebird-api@1.0.0 No description npm WARN nodebird-api@1.0.0 No repository field. npm ERR! code EINVAL npm ERR! EINVAL: invalid argument, read npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Hyunseok\AppData\Roaming\npm-cache\_logs\2021-03-22T10_29_31_887Z-debug.log 프로젝트를 새로 생성해도 다음과 같은 오류가 발생하고, 인터넷에서 npm i npm@latest나 npm install --save-dev eslint --verbose, npm clean cache 후 다시 npm install이라는 방법을 사용해 보았는데도 계속 설치가 안됩니다. 어떻게 해결해야 하나요? 구체적인 질문 일수록 명확한 답을 받을 수 있어요. • 질문 제목은 핵심 키워드를 포함해 간결하게 적어주세요. • 질문 내용은 자세하게 적어주시되, 지식공유자가 답변할 수 있도록 구체적으로 남겨주세요 . • 정확한 질문 내용과 함께 코드 를 적어주시거나, 캡쳐 이미지 를 첨부하면 더욱 좋습니다. 기본적인 예의 를 지켜주세요. • 정중한 의견 및 문의 제시, 감사 인사 등의 커뮤니케이션은 더 나은 강의를 위한 기틀이 됩니다. • 질문이 있을 때에는 강의를 만든 지식공유자에 대한 기본적인 예의를 꼭 지켜주세요. • 반말, 욕설, 과격한 표현 등 지식공유자를 불쾌하게 할 수 있는 내용 은 스팸 처리 등 제재를 가할 수 있습니다.
강의 잘 들었습니다. git에 대한 궁금증 모두 해결 된것 같습니다. PPT 자료 받을 메일 주소는 vega2k@naver.com 입니다. 수강평 어디서 작성하는지 몰라서 질문&답변 란에 올립니다. 수강평 작성할 수 있는 링크를 못 찾겠어요 답변 부탁드립니다. 감사합니다.
선생님 답변을 보고 이미지 최적화를 진행해봤는데 그래도 로딩이 오래걸리더라구요 선생님 말씀처럼 첫번째 씬 이미지만 로드하도록 하고 그 후 이미지를 처리하게 하는게 방법인 것 같은데 구글링을 해봤는데 어떻게 첫번째 씬 이미지만 로드시킬 수 있는지 잘 모르겠습니다..ㅠ 힌트나 방법을 좀 알 수 있을까요.. https://github.com/feelslikemmmm/Airmug-Pro/blob/master/js/main.js 소스코드 깃허브입니다 제 생각에는 setcanvasImage 함수를 분기별로 나눠서 어떻게 해야할 것 같긴한데 ㅠㅠ 잘 모르겠습니다..
안녕하세요. 강사님. 이번 강의에서 XmlAppContext.java는 package hello.beanfind ; import hello.core.member.MemberRepository ; import hello.core.member.MemberService ; import org.assertj.core.api.Assertions ; import org.junit.jupiter.api. DisplayName ; import org.junit.jupiter.api. Test ; import org.springframework.context.ApplicationContext ; import org.springframework.context.support.GenericApplicationContext ; import org.springframework.context.support.GenericXmlApplicationContext ; import org.springframework.test.context.web.GenericXmlWebContextLoader ; public class XmlAppContext { @Test @DisplayName ( "xml config 테스트해보기 " ) void xmlAppContext (){ ApplicationContext ac = new GenericXmlApplicationContext( "appConfig.xml" ) ; MemberService ms = ac.getBean( "memberService" , MemberService. class ) ; Assertions. assertThat (ac).isInstanceOf(MemberService. class ) ; } } appConfig.xml은 <? xml version ="1.0" encoding ="UTF-8" ?> <beans xmlns ="http://www.springframework.org/schema/beans" xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance" xsi :schemaLocation ="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd" > <bean id ="memberService" class ="hello.core.member.MemberServiceImpl" > <constructor-arg name ="memberRepository" ref ="memberRepository" /> </bean> <bean id ="memberRepository" class ="hello.core.member.MemoryMemberRepository" /> <bean id ="orderService" class ="hello.core.order.OrderServiceImpl" > <constructor-arg name ="memberRepository" ref ="memberRepository" /> <constructor-arg name ="discountPolicy" ref = "discountPolicy" /> </bean> <bean id ="discountPolicy" class ="hello.core.discount.RateDiscountPolicy" /> </beans> 이렇게 작성하였는데 아래와 같은 에러가 나는데요. 18:22:00.364 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'memberService' 18:22:00.397 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'memberRepository' 18:22:00.420 [main] WARN org.springframework.context.support.GenericXmlApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memberService' defined in class path resource [appConfig.xml]: Unsatisfied dependency expressed through constructor parameter 0: Ambiguous argument values for parameter of type [hello.core.member.MemberRepository] - did you specify the correct bean references as arguments? org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memberService' defined in class path resource [appConfig.xml]: Unsatisfied dependency expressed through constructor parameter 0: Ambiguous argument values for parameter of type [hello.core.member.MemberRepository] - did you specify the correct bean references as arguments? 구글링을 해도 원인을 모르겠어서요..ㅜ.ㅜ