Code Monkey home page Code Monkey logo

Comments (1)

zeikar avatar zeikar commented on July 17, 2024

간단한 문제 풀이

a,b: 간단
c: 범위가 작으므로 a, b[c] 를 전부 카운트 해준 후 나중에 둘 다 곱해주면 된다.
d: 조합 (이항계수)로 풀린다. n = a+b 로 두면 nCa 가 전체 가능한 개수가 되고, n-1Ca-1 이 a를 넣은 후 나머지의 개수가 된다.
즉, k 가 n-1Ca-1보다 크면 b 로 시작하고 아니면 a로 시작하도록 재귀로 돌리면 된다.

대회 중에는 j준수의 https://www.geeksforgeeks.org/find-n-th-lexicographically-permutation-string-set-2/ 사용. 좀 더 범용적인데 C++로는 불가 (60! 이 long long 넘어감) 파이썬으로 제출.

결과

image

약간 올랐다

from atcoder.

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.