lqdoj
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Owners
          • Signed-in users
          • Everyone
          Owners Signed-in users Everyone
        • Write
          • Owners
          • Signed-in users
          • Everyone
          Owners Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Write
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Chuyên đề: Tham lam **Nó là gì?** Các thuật ngữ liên quan? - Bài tóan tối ưu: Bài toán bao gồm nhiều bước, tại mỗi bước ta có một số lựa chọn khác nhau. Mỗi lựa chọn có thể đem lại lợi ích, hay mất mát, được biểu diễn dưới dạng các con số. Chiến thuật lựa chọn sao cho đạt *tổng lợi nhuận* **lớn nhất** chính là mục tiêu của *bài toán tối ưu* - Tuy nhiên, điểm quan trọng nhất trong các bài toán trên là một lựa chọn sẽ ảnh hưởng tới toàn bộ những lựa chọn có thể có trong tương lai. Chọn cách nào thì bị giới hạn trong những khả năng mở ra được từ cách đó. - Ví dụ: [chèn sau] Nói chung, trong một bài toán tham lam, ta sẽ giải quyết vấn đề bằng cách chọn ra lựa chọn *tốt nhất* **ngay trước mắt**, tức không cần quan tâm lựa chọn này sẽ tác động như thế nào trong tương lai? Đánh giá tốt/ xấu như thế nào? Định nghĩa một cách toán hơn? ... (bổ sung sau) ## Gàu nước Đem gàu đựng dư cũng được, chỉ cần chứa được nước thôi mà? Chỉ dùng gàu $5$. Số gàu cần dùng: $\lceil \frac{L}{5} \rceil$ (chia $5$ làm tròn lên) ## Mua xăng Tính theo đơn giá: - Loại $I$ dùng $a$ đồng mua được $1l$ - Loại $II$ dùng $b/2$ đồng mua được $1l$ (suy ra từ đề) So sánh $a$ và $b/2$, loại nào rẻ hơn thì mua. **Lưu ý:** Chỉ trong bài này mới đúng được vì hai loại lần lượt là $1l$ và $2l$. Nếu là $3l$ và $5l$, $5l$ và $11l$ thì câu chuyện sẽ khác ... **Lưu ý 2:** Dù bảo là tính theo đơn giá rồi mua loại rẻ hơn, trong thực tế nếu mua loại II thì phải mua $2l$, chứ không có kiểu: "Tôi đưa nửa tiền, tôi lấy $1l$ thôi được không?" Nên để thuận tiện, ta coi như đơn vị bằng $2l$ luôn: - Loại $I$ dùng $2a$ đồng mua được $2l$ - Loại $II$ dùng $b$ đồng mua được $2l$ Nếu $n$ lẻ, ta mới cộng thêm $a$ sau. ## Câu hỏi số 99 Chọn toàn $9$. Dư ra bao nhiêu thì chọn thêm một chữ số nữa. Ví dụ: - $n = 27 \rightarrow 3$ số $9$ - $n = 12 \rightarrow 1$ số $9$ và một số $3$ - $n = 7 \rightarrow 1$ số $7$ thôi ### Vì sao đúng? - Số tạo được có số lượng chữ số nhỏ nhất - Trong những số có cùng số lượng chữ số nhỏ nhất, số này có chữ số đầu bé hơn hẳn. **Ví dụ:** $n = 12$, tối ưu nhất là hai chữ số. Có các số: $66, 75, 57, 48, 84, 39, 93$ Chọn $39$ là tốt nhất. ## Sửa điểm? Chọn môn điểm thấp nhất, sửa thành $10$ ## Mua sách **Ý tưởng:** Cứ chọn ba quyển đắt nhất chưa mua, mua chúng, thì tiền miễn phí cũng cao nhất có thể (quyển đắt thứ ba còn lại). **Triển khai:** Sắp xếp giảm dần. Sau đó lấy tổng $a_3, a_6, a_9, \dots$ Các bài còn lại liên quan tới sort: [Training VKU](https://docs.google.com/document/d/1peW0BLbRYt9ZREec3wWb2qqFsAJjayrBn3BGca1X22M/edit?usp=sharing)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully