inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

176만명의 커뮤니티!! 함께 토론해봐요.

셀레니움 실습 중에 뜨는 로그 질문

해결됨

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

DevTools listening on ws://127.0.0.1:3303/devtools/browser/005418e0-65b8-48b9-8b7d-eb9e884ab79b [2552:20700:1021/035027.954:ERROR:device_event_log_ impl.cc (225)] [03:50:27.955] USB: usb_service_ win.cc:415 Could not read device interface GUIDs: 지정된 파일을 찾을 수 없습니다. (0x2) 안녕하세요. 셀레니움은 잘 작동을 하는데 이런 오류가 뜹니다. 어떻게 해결할 수 있는 건가요?

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
우주사막 댓글 1 좋아요 0 조회수 439

설치 오류 해결책을 모르겠습니다. (설치관련)undici-types

미해결

한 입 크기로 잘라먹는 타입스크립트(TypeScript)

전부다 설치완료 후 tsc를 입력 할 경우 이런 에러가 나옵니다. npm i @types/node 설치후의 이미지 올리는데(이전 과 다르게 설치됨) 이전에는 설치 잘 됐었는데 이번에 재설치를 해도 문제가 계속 발생하고 있습니다.

  • undici-types
  • 설치
Roy13 댓글 5 좋아요 1 조회수 2713

쿠팡 크롤링에서 쿠키로 해결하는 방법 질문

해결됨

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

안녕하세요. 쿠팡 크롤링에서 cookie로 실행 안되는(?) 문제 해결하는 영상 보고 있는데요. status code가 403이 나오는데 괜찮은 건가요? 아래에 작성한 코드도 같이 올렸습니다. 쿠팡에서 header에 user-agent를 넣어주는 것만으로 해결이 되지 않는 이유가 이것만으로는 쿠팡이 브라우저로 접근했다고 인식하지 않아서 인건가요? import requests from bs4 import BeautifulSoup headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36" } base_url = "https://www.coupang.com/np/search?component=&q=" keyword = input("검색할 상품명을 입력해주세요: ") search_url = base_url + keyword cookie = {"a": "b"} req = requests.get( search_url, timeout=5, headers=headers, cookies=cookie ) print(req.status_code)

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
우주사막 댓글 1 좋아요 0 조회수 1461

가위바위보 게임 오류가 발생했습니다

해결됨

앨런 iOS 앱 개발 (15개의 앱을 만들면서 근본원리부터 배우는 UIKit) - MVVM까지

안녕하세요 강의를 보며 따라하는 중 사진과 같은 오류가 발생했습니다. 구글에 검색하여 해결방법을 찾아보니 command + q 를 누르고 다시 실행하는 방법을 찾았습니다. 하지만 이것으로도 해결되지 않았습니다..

  • ios
  • swift
현이 댓글 2 좋아요 0 조회수 481

실습용 스키마 다운로드 및 설치

미해결

데이터 분석 SQL Fundamentals

안녕하세요. 실습용 스키마 다운로드 및 설치를 하려고 하는데, 스키마가 설치가 되지 않아 문의드립니다. 운영체제는 mac os 를 사용하고 있으며 기본 세팅이 원래 영어로 되어 있습니다. 이전에 이미 DBeaver 가 설치 되어 있는 상태 였고 , 이전에 SQL 를 공부하고 있던 터라 다른 스키마 데이터가 다운로드 되어 있는 상태였습니다. 아래 이미지는 [ postgres2 ] 가 기존에 있었던 저장되어 있던 파일들에 대한 스크린 샷 입니다. 기존의 [ postgres2] 를 [ 복사 - 붙여넣기 ] 하여 새로운 [ postgres2 1 ] 를 만들었고, [ postgres2 1 ] 영상을 따라서 dump_postgres_analytics_funda.backup 파일을 다운 받고 다시 restore 로 설치를 했는데, 여전히 기존에 있던 스키마(기존에 있던 테이블들)만 나타납니다. [ 실습용 스키마 설치 이슈 시 적용 하세요 ] 영상을 따라 git hub 에서 파일을 다운받고 create schema nw; 를 실행했는데 오류가 나타났습니다. 구글에 오류를 검색해보니 (*참고 URL: https://velog.io/@shj5508/PostgreSQL-%ED%85%8C%EC%9D%B4%EB%B8%94-%EA%B6%8C%ED%95%9C-%EA%B4%80%EB%A6%AC%ED%95%98%EA%B8%B0) ( GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO username; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT USAGE, SELECT ON SEQUENCES TO username;) 라는 글이 있어 실행해 보았습니다. 아래 스크린샷이 실행 결과 입니다. (제 user name 은 grace 입니다.) 그리고 다시 create schema nw; 를 실행하니 아래의 스크린 샷과 같은 오류가 나타납니다. 다른 방식으로 실습용 스키마를 설치하거나 저장할 수 없을까요? 도와주세요 ㅜㅜ

  • sql
  • postgresql
  • dbms/rdbms
J20 댓글 1 좋아요 0 조회수 370

firebase 오류

미해결

[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)

안드로이드 스튜디오 dolphin 버전입니다

  • android
  • kotlin
  • firebase
Sjdjdiw 댓글 2 좋아요 0 조회수 518

OrderRepositoryTest에서 발생한 에러

미해결

Practical Testing: 실용적인 테스트 가이드

package sample.cafekiosk.spring.domain.order; @ActiveProfiles("test") @DataJpaTest class OrderRepositoryTest { @Autowired private OrderRepository orderRepository; @Autowired private ProductRepository productRepository; @DisplayName("특정 주문 상태에 따라 주문을 조회한다") @Test void findOrdersBy() { //given Product product1 = createProduct("아메리카노", 3000, HANDMADE, SELLING); Product product2 = createProduct("카페라떼", 4000, HANDMADE, SELLING); Product product3 = createProduct("카푸치노", 5000, HANDMADE, SELLING); List<Product> products = List.of(product1, product2, product3); LocalDateTime startTime = LocalDateTime.of(2023, 10, 19, 0, 0); LocalDateTime orderTime = LocalDateTime.of(2023, 10, 19, 10, 0); LocalDateTime endTime = LocalDateTime.of(2023, 10, 20, 0, 0); Order completedOrder = createOrder(orderTime, PAYMENT_COMPLETED, products); Order canceledOrder = createOrder(orderTime, CANCELED, products); // when List<Order> orders = orderRepository.findOrdersBy(startTime, endTime, PAYMENT_COMPLETED); // then assertThat(orders).hasSize(1) .extracting("id", "orderStatus", "totalPrice", "registeredDateTime") .containsExactlyInAnyOrder( tuple(1L, PAYMENT_COMPLETED, 12000, orderTime) ); } private Product createProduct(String name, int price, ProductType productType, ProductSellingStatus productSellingStatus) { Product product = Product.builder() .name(name) .price(price) .type(productType) .sellingStatus(productSellingStatus) .build(); return productRepository.save(product); } private Order createOrder(LocalDateTime now, OrderStatus orderStatus, List<Product> products) { Order order = Order.builder() .products(products) .orderStatus(orderStatus) .registeredDateTime(now) .build(); return orderRepository.save(order); } @DisplayName("찾고자 하는 시간 안에 있는 주문을 조회한다") @Test void findOrdersBy2() { //given Product product1 = createProduct("아메리카노", 3000, HANDMADE, SELLING); Product product2 = createProduct("카페라떼", 4000, HANDMADE, SELLING); Product product3 = createProduct("카푸치노", 5000, HANDMADE, SELLING); List<Product> products = List.of(product1, product2, product3); LocalDateTime startTime = LocalDateTime.of(2023, 10, 19, 0, 0); LocalDateTime orderTime = LocalDateTime.of(2023, 10, 19, 10, 0); LocalDateTime endTime = LocalDateTime.of(2023, 10, 20, 0, 0); LocalDateTime overTime = LocalDateTime.of(2023, 10, 20, 10, 0); Order completedOrder = createOrder(orderTime, PAYMENT_COMPLETED, products); Order overTimeOrder = createOrder(overTime, PAYMENT_COMPLETED, products); // when List<Order> orders = orderRepository.findOrdersBy(startTime, endTime, PAYMENT_COMPLETED); // then assertThat(orders).hasSize(1) .extracting("id", "orderStatus", "totalPrice", "registeredDateTime") .containsExactlyInAnyOrder( tuple(1L, PAYMENT_COMPLETED, 12000, orderTime) ); } } 각각 Test 수행할 땐 정상적으로 잘 동작했습니다. 하지만, 같이 Test을 수행하는 경우 findOrdersBy()에서 아래와 같은 에러가 발생하고 있습니다 2023-10-20 23:12:40.519 INFO 8704 --- [ main] o.s.t.c.transaction.TransactionContext : Began transaction (1) for test context [DefaultTestContext@1a6c1270 testClass = OrderRepositoryTest, testInstance = sample.cafekiosk.spring.domain.order.OrderRepositoryTest@2d114d27, testMethod = findOrdersBy@OrderRepositoryTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@18a136ac testClass = OrderRepositoryTest, locations = '{}', classes = '{class sample.cafekiosk.spring.CafeKioskApplication}', contextInitializerClasses = '[]', activeProfiles = '{test}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.OverrideAutoConfigurationContextCustomizerFactory$DisableAutoConfigurationContextCustomizer@560348e6, org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@6f1c29b7, org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizer@351584c0, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@fb58afcf, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@7b7fdc8, [ImportsContextCustomizer@77d67cf3 key = [org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration, eJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@27d5a580, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@0], contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.event.ApplicationEventsTestExecutionListener.recordApplicationEvents' -> false]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@40d10264]; rollback [true] Hibernate: insert into product (id, created_date_time, modified_date_time, name, price, product_number, selling_status, type) values (default, ?, ?, ?, ?, ?, ?, ?) Hibernate: insert into product (id, created_date_time, modified_date_time, name, price, product_number, selling_status, type) values (default, ?, ?, ?, ?, ?, ?, ?) Hibernate: insert into product (id, created_date_time, modified_date_time, name, price, product_number, selling_status, type) values (default, ?, ?, ?, ?, ?, ?, ?) Hibernate: insert into orders (id, created_date_time, modified_date_time, order_status, registered_date_time, total_price) values (default, ?, ?, ?, ?, ?) Hibernate: insert into order_product (id, created_date_time, modified_date_time, order_id, product_id) values (default, ?, ?, ?, ?) Hibernate: insert into order_product (id, created_date_time, modified_date_time, order_id, product_id) values (default, ?, ?, ?, ?) Hibernate: insert into order_product (id, created_date_time, modified_date_time, order_id, product_id) values (default, ?, ?, ?, ?) Hibernate: insert into orders (id, created_date_time, modified_date_time, order_status, registered_date_time, total_price) values (default, ?, ?, ?, ?, ?) Hibernate: insert into order_product (id, created_date_time, modified_date_time, order_id, product_id) values (default, ?, ?, ?, ?) Hibernate: insert into order_product (id, created_date_time, modified_date_time, order_id, product_id) values (default, ?, ?, ?, ?) Hibernate: insert into order_product (id, created_date_time, modified_date_time, order_id, product_id) values (default, ?, ?, ?, ?) Hibernate: select order0_.id as id1_2_, order0_.created_date_time as created_2_2_, order0_.modified_date_time as modified3_2_, order0_.order_status as order_st4_2_, order0_.registered_date_time as register5_2_, order0_.total_price as total_pr6_2_ from orders order0_ where order0_.registered_date_time>=? and order0_.registered_date_time<? and order0_.order_status=? 2023-10-20 23:12:40.621 INFO 8704 --- [ main] o.s.t.c.transaction.TransactionContext : Rolled back transaction for test: [DefaultTestContext@1a6c1270 testClass = OrderRepositoryTest, testInstance = sample.cafekiosk.spring.domain.order.OrderRepositoryTest@2d114d27, testMethod = findOrdersBy@OrderRepositoryTest, testException = java.lang.AssertionError: [Extracted: id, orderStatus, totalPrice, registeredDateTime] Expecting actual: [(3L, PAYMENT_COMPLETED, 12000, 2023-10-19T10:00 (java.time.LocalDateTime))] to contain exactly in any order: [(1L, PAYMENT_COMPLETED, 12000, 2023-10-19T10:00 (java.time.LocalDateTime))] elements not found: [(1L, PAYMENT_COMPLETED, 12000, 2023-10-19T10:00 (java.time.LocalDateTime))] and elements not expected: [(3L, PAYMENT_COMPLETED, 12000, 2023-10-19T10:00 (java.time.LocalDateTime))] , mergedContextConfiguration = [MergedContextConfiguration@18a136ac testClass = OrderRepositoryTest, locations = '{}', classes = '{class sample.cafekiosk.spring.CafeKioskApplication}', contextInitializerClasses = '[]', activeProfiles = '{test}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper=true}', contextCustomizers = 왜 id가 3인가요?? 저는 DataJpaTest을 수행하면 각각의 Test 마다 rollBack이 수행되어 id가 당연히 1이라고 생각했었습니다. 왜 3이 되는지 이해가 되지 않습니다

  • spring
  • tdd
  • jpa
  • mockito
  • 소프트웨어-테스트
  • junit5
goforit 댓글 2 좋아요 0 조회수 593

MemberRepository의 주소값이 똑같은이유가 싱글톤 때문인가요?

미해결

스프링 핵심 원리 - 기본편

안녕하세요 강의 잘 듣고있습니다 다름이아니라 memberRepository1(), memberRepository2() 둘의 메서드의 value값의 주소가 사진처럼 똑같은데요 이게 싱글톤이라서 주소를 공유하기때문에 주소값이 똑같은건가요?

  • spring
  • 객체지향
자바마스터하자 댓글 2 좋아요 0 조회수 599

Spring boot에서 일반 예외처리와 api예외처리 한번에 하는 좋은 방법 없을까요?

미해결

@Slf4j @ControllerAdvice @RequiredArgsConstructor public class ExceptionControllerAdvisor { private final HttpServletRequest httpServletRequest; private final HttpServletResponse httpServletResponse; @ExceptionHandler(RollbackTriggeredException.class) public ResponseEntity<ErrorResponse> rollBackException(RollbackTriggeredException e) throws IOException { if (httpServletRequest.getRequestURI().startsWith("/api")) { int statusCode = e.getStatusCode(); ErrorResponse body = ErrorResponse.builder() .code(String.valueOf(statusCode)) .message(e.getMessage()) .validation(e.getValidation()) .build(); return ResponseEntity.status(statusCode) .body(body); } else { httpServletResponse.sendError(e.getStatusCode()); return null; } } } spring boot와 thymeleaf를 사용해서 이런식으로 api 요청일 경우 해당 요청 uri의 앞에 api를 넣어서 api가 앞에있으면 ResponseEntity객체를 이용해서 RuntimeException을 상속받은 커스텀 예외(RollbackTriggeredException)을 처리하고, api 가 없다면 HttpServletResponse객체의 sendError 메서드를 사용해서 에러를 발생시킨다음 Spring boot의 예외처리 매커니즘을 통해 에러페이지로 이동하도록 코드를 짜보았습니다. 하지만 else부분에 else를 작성해줘야한다는 점이 좀 좋지 않은 코드는 아닐까 하는 생각이들게 되더라고요?? 일반예외(페이지 이동하다 예외가 발생했을경우)와 api예외(ajax요청하다 예외가 발생했을 때)를 동시에 처리하는 좋은 방법있으면 알려주신다면 감사하겠습니다.

  • springboot
  • exception
백엔드 주니어 개발자 댓글 1 좋아요 0 조회수 497

@GeneratedValue(strategy = GenerationType.IDENTITY) 변경후 실행오류

해결됨

자바 ORM 표준 JPA 프로그래밍 - 기본편

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] @GeneratedValue어노테이션을 설명에 맞게 바꾸다가 IDENTIFY로 변경후에 아래와 같이 메시지가 발생합니다. ERROR: NULL not allowed for column "ID"; SQL statement: 소스는 아래와 같습니다. // Member.java @Entity public class Member { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; //.. } Persistence.xml <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"> <persistence-unit name="hello"> <properties> <!-- 필수 속성 --> <!--생략...--> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> <!-- 옵션 --> <!--생략...--> <property name="hibernate.hbm2ddl.auto" value="create" /> </properties> </persistence-unit> </persistence> //Main메서드 내용입니다 public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("hello"); //위에 메니저팩토리를 불러오는순간 웬만한 작업 가능. EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); tx.begin(); try{ Member member = new Member(); member.setName("CCCC"); System.out.println("============start=========="); em.persist(member) ; System.out.println ("member.getId() = " + member.getId()); tx.commit(); //...생략 h2콘솔에서 테이블은 정상적으로 생성되어있는 상태입니다.

  • java
  • jpa
awdsza 댓글 1 좋아요 0 조회수 1254

전체화면 전환에 대해서

미해결

[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part2: 게임 수학과 DirectX12

alt+enter 또는 BOOL fullscreen; _swapChain->GetSwapChain()->GetFullscreenState(&fullscreen, nullptr); _swapChain->GetSwapChain()->SetFullscreenState(!fullscreen, nullptr); 과같이 전체화면 전환시 프로그램이 멈추는데 이것저것 다해봐도 해결이 안되네여..

  • directx
  • 전체화면
댓글 1 좋아요 0 조회수 403

전 강의에서 들었던 내용인데 기억이 안나네요

미해결

스프링 MVC 2편 - 백엔드 웹 개발 활용 기술

로그인 페이지에서 아이디 혹은 비밀번호가 오류면 아이디,비밀번호를 입력하는 페이지를 다시연결해주는데 ID값은 남아있고 비밀번호폼데이터는 없어지는걸 볼수있어요 전 강의에서 이 부분을 공부했었는데 어떻게 하는지 기억이 안나네요 비밀번호도 유지할려면 어떻게 해야되나요 ?

  • spring
  • mvc
댓글 1 좋아요 0 조회수 472

Post model

미해결

Vue.js - Django 연동 웹 프로그래밍 (실전편)

modify_dt 가 아니라 아래처럼 create_dt 를 기준으로 이전 이후 나누게 코드 짜도 되나요? def get_prev(self): return self.get_previous_by_create_dt() def get_next(self): return self.get_next_by_create_dt()

  • vue.js
  • django
  • vuetify
kwonjiwoo 댓글 1 좋아요 0 조회수 283

예제 파일이 어디에 있는지 모르겠다고 문의드렸는데 아직도 정확한 답변을 받지 못했습니다.

미해결

[핵집] 2025 빅데이터 분석기사(실기)_작업형 1·2·3유형

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. ㅇ작업유형3의 예제파일"cellphone2"가 안보인다고 문의를 드렸습니다. 파일이 올려져 있다고 캡쳐 화면을 주셨길래 제 화면을 캡쳐해서 제 화면에는 없다고 보내드렸는데 아직까지 회신이 없어 다시 문의드립니다. 제가 가이드해주신 코드로 연결했을 때 보이는 파일 아래에 캡쳐해서 드립니다. 그리고 문의사항에 대해서 해결이 안되었는데 "해결됨"으로 나와있는데.. 이건 왜 그런건지요? 제가 파일의 못찾아서 그럴 수도 있으니 정확한 파일 경로 알려주시기 바랍니다.

  • 빅데이터
jaeukcha 댓글 4 좋아요 0 조회수 406

figma에 폰트 추가

해결됨

UX/UI 시작하기 : Figma 입문 (Inflearn Original)

figma에 폰트를 추가하려고 figma fonts install 그것도 깔고 다른 곳에서 폰트 파일 TTF 다운로드하고 window -> fonts 파일에 잘 들어갔는데 figma에서는 폰트가 안 뜨네요.. 고령딸기체라는 폰트인데 폰트에 문제가 있는 건가요? 새로고침 같은 걸 해봐도 안되고.. 도와주세요

  • 프로토타이핑
  • figma
  • fonts
  • 폰트
  • 도움
진건희 댓글 1 좋아요 0 조회수 16259

float를 이용한 문법 질문드립니다.

미해결

프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)

print("art: %5d, price: %08.2f" % (453, 59.058)) 위와 같은 코드를 작성했을때의 출력물과, float를 이용해서 작성했을때의 출력물과 같게 만들기 위해 print('{art: 5d}{price: 08.2d}'.format(453, 59.058)) 위와 같은 코드를 작성해보았는데요, 출력이 안됩니다. 어떤 잘못을 한걸까요?

  • python
최진명 댓글 1 좋아요 0 조회수 346

완전탐색 숫자야구 2503

미해결

2주만에 통과하는 알고리즘 코딩테스트 (2024년)

c++로 수강중인 학생입니다.. 백준 숫자야구 문제 c++로 풀어주실 수는 없을까요..? 몇번 구현해보다가 멘탈이 터져버렸습니다.. 우선은 #include <iostream> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; int numbers[1000]; int strikes[1000]; int balls[1000]; for (int i = 0; i < n; i++) { cin >> numbers[i] >> strikes[i] >> balls[i]; } int answer = 0; for (int a = 1; a < 10; a++) { for (int b = 1; b < 10; b++) { for (int c = 1; c < 10; c++) { int counter = 0; if (a == b || b == c || c == a) { continue; } for (int i = 0; i < n; i++) { int check = numbers[i]; int strike = strikes[i]; int ball = balls[i]; int strike_count = 0; int ball_count = 0; int check1 = check / 100; int check2 = (check / 10) % 10; int check3 = check % 10; // 스트라이크 계산 if (a == check1) { strike_count++; } if (b == check2) { strike_count++; } if (c == check3) { strike_count++; } // 볼 계산 if (a == check2 || a == check3) { ball_count++; } if (b == check1 || b == check3) { ball_count++; } if (c == check1 || c == check2) { ball_count++; } // 매칭 여부 확인 if (strike != strike_count || ball != ball_count) { break; } counter++; } if (counter == n) { answer++; } } } } cout << answer << '\n'; return 0; } 이렇게 풀기는 했는데 선생님이 가르쳐주신 방향하고는 살짝 다른 거 같습니다.

  • 코딩-테스트
  • 알고리즘
  • c++
soso1461 댓글 5 좋아요 2 조회수 883

5강 재귀(경우의 수) 4번 문제 질문드립니다.

해결됨

2주만에 통과하는 알고리즘 코딩테스트 (2024년)

안녕하세요, 선생님의 강의를 잘 듣고 있는 1인 입니다. 1) 강의를 듣고 4번 문제를 아래와 같이 풀었는데요, 정답이 왜 0이 나오는건지, 어느 부분이 잘못된 건지 모르겠어서 질문드립니다. (5강에서 적으실때 line 18의 idx에 1을 더해주지 않으셨는데 이 부분은 +1을 빠트린게 맞으신거죠?) 2)또한, 어떤 경우에 global answer를 써주는지도 한번 다루어주셨으면 좋겠습니다. 3) line 8의 weight > B가 아닌 weight >= B가 되는게 더 맞는게 아닌지 질문드립니다. weight == B인 경우에 한 번 더 반복문을 돌면 이미 초과된 가방에 새로운 물건의 value를 추가해서 더하게 되는 것처럼 보이는데요, 혹시 제가 잘못 생각하고 있을까요?

  • python
  • 코딩-테스트
  • 알고리즘
한혜경 댓글 2 좋아요 1 조회수 463

1-A 결과는 정확히 나오는데 왜 틀렸다고 하는건지 모르겠습니다

해결됨

10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트

http://boj.kr/59d6674b61764f13b14b7608522239a5 9개 중에 틀린 2개를 뽑고 인덱스에 해당하는 vector요소를 erase로 지우고자 했는데 프로그램을 돌리면 값을 정확하게 나오는데 왜 틀렸다고 하는지 모르겠습니다

  • c++
  • 코딩-테스트
정세희 댓글 1 좋아요 0 조회수 447

유니티 한 씬에 여러 스테이지 표현

미해결

안녕하세요 유니티 독학을 한 후 제대로된 개발을 처음 해보는 사람입니다ㅠㅠ 다름이 아니라, 총 20스테이지에 각 스테이지마다 15개의 부가 스테이지를 만들고 싶은데요,, 스테이지마다 씬을 다르게 하려다보니 씬 갯수가 300개가 나올 것 같아서 질문 드립니다. 각 스테이지마다 배경 이미지가 변경이 되어 한 스테이지에 나오는 15개의 부가 스테이지는 뒷 배경 변경이 없이 오브젝트만 변경이 될 것 같은데요 이럴 경우에 한 씬에 15개의 부가스테이지를 다 몰아서 표현할 수 있을까요? 배경만 같고, 부가 스테이지마다 클리어 조건은 다릅니다ㅠㅠ 만약 가능하다면 혹시 어떻게 표현을 할 수 있을지 방법까지 여쭤봐도 될까요?ㅠㅠ 유니티 책 두권으로 독학을 했는데, 두 권 다 기초 책이라 새로운 씬을 만드는 방법만 알려주네요

  • 유니티
  • C#
  • unity
민영 댓글 1 좋아요 0 조회수 1085

인기 태그

인프런 TOP Writers

주간 인기글