GithubHelp home page GithubHelp logo

boj 2473 세 용액 about fastcampus HOT 3 CLOSED

rhs0266 avatar rhs0266 commented on September 7, 2024
boj 2473 세 용액

from fastcampus.

Comments (3)

java-saeng avatar java-saeng commented on September 7, 2024 1

이번 문제에서는 "두 개의 용액을 더해서 -A[i]에 가깝게 만들어라"로 만든거죠.

으어.. 이것이었습니다 ㅠㅠㅠ 호석님..
감사합니다 바로 AC 받으러 가겠습니다

from fastcampus.

java-saeng avatar java-saeng commented on September 7, 2024

무엇을 모르는지 알 것 같습니다.
좋다 라는 문제에서는
A[L] + A[R] 이 target보다 작으면
최소 입장에선 최대를 더했는데 target보다 작기 때문에 s를 늘려야한다
라는 명확한 로직이 이해가 됐는데
세 용액에서는 왜 target을 - 로 하며 ,

더했을 때 양수가 나오면 R을 줄여야하는지 모르겠습니다. 단지 양수가 나오면 0에 가까워지기 위해 R을 줄이는 것인가요?

from fastcampus.

rhs0266 avatar rhs0266 commented on September 7, 2024

i번 용액을 확실히 고른 상태에서 L과 R을 선택하고 싶은 거잖아요? 그럼 이 순간 L과 R을 구하는 건 두 용액 문제와 동일해졌다는 의미로 말한 거에요.

두 용액 문제에서 "두 개의 용액을 더해서0에 가깝게 만들어라" 를 이번 문제에서는 "두 개의 용액을 더해서 -A[i]에 가깝게 만들어라"로 만든거죠. -A[i]에 가까워야 A[i]랑 더했을 때 0에 가까워지니까요. 같은 이유로, 두 용액에서 합이 목표(0)보다 크냐 작냐로 L과 R을 이동시켰잖아요? 그래서 이번에도 동일하게 수행한 겁니다.

from fastcampus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.