남남이루의 고군분투 🌳

  • 태그
  • 방명록
  • GIT Hub

굳 1

[이분탐색] 백준 10815. 숫자카드

문제 https://www.acmicpc.net/problem/10815 숫자가 카드안에 있는지 탐색하는 문제다. 문제조건에 두 숫자 배열의 크기가 50만이 넘기 때문에 find나 filter나 완전탐색으로 하면 시간초과가 뜨기 때문에 업다운 게임처럼 이분탐색으로 힌트를 줌으로써 탐색범위를 효과적으로 줄여야 한다. 코드 n = int(input()) card = list(map(int, input().split())) m = int(input()) nums = list(map(int, input().split())) def binary(mid): return card[mid] card.sort() ans = [] for i in nums: l = 0 r = n-1 j = 0 while l i: r = m..

⚡️algorithm 2022.05.18
1
더보기
프로필사진

구구절절 개발블로그

  • Category (179)
    • Project (5)
    • Programming (36)
      • 💥 뽀개기 (1)
      • ☕ JavaScript (5)
      • 🧞‍♂️ React, TypeScript (6)
      • 🐍 Python (6)
      • 📚 Book Study (6)
      • 🌐 Web (3)
      • Tips (5)
    • ⚡️algorithm (98)
      • step-up ++ (6)
      • accepted (14)
      • master (1)
    • News (5)
      • Frontend (5)
      • Backend (0)
    • log ✎⁾⁾⁾ (30)
      • comming soon (0)
      • career (7)

Tag

더오래하면돼, 알고리즘, DFS, ADHD, 클린코드, DP, 그래프, combinations, 파이썬, 프로그래머스, typescript, Git, 이분탐색, clean code, Dictionary, 부스트캠프, 그리디, BFS, Set, 책스터디,

Archives

«   2025/06   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30

최근댓글

방문자수Total

  • Today :
  • Yesterday :
글쓰기 관리자 GitHub

Copyright © Kakao Corp. All rights reserved.

  • Github

티스토리툴바