Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8018983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:15:31+00:00 2026-06-04T21:15:31+00:00

The question I am going to ask here has already been asked before in

  • 0

The question I am going to ask here has already been asked before in stack overflow.
But I am not able to understand properly the solutions posted by Skiminok.

Here is the Link .

I tried the solution posted on the above link with the given two sample test-cases ,but i am not able to get the correct answer.

For the test case 1::

N=3 and K=2

5 4 7

The DAG will be::

The directed acyclic graph for sample test case 1

Note :I have constructed the above DAG Considering:

Let pi and pj be two different problems. Then we will draw a directed edge from pi to pj if and only if pj can be solved directly after pi on the same day, consecutively. Namely, the following conditions have to be satisfied:

i < j, because you should solve the less difficult problem earlier.

|vi – vj| >= K (the rating requirement).

Then I constructed the Bipartite graph considering::

For each directed edge (u, v) of the original DAG one should add an undirected edge (au, bv) to the bipartite graph, where {ai} and {bi} are two parts of size n.

enter image description here

The answer =maximum cardinality matching in above bipartite graph .

maximum cardinality matching in above bipartite graph =1 (Green colored egde)

But the answer is 2.

Similarly Sample Test Case 2:

5 1

5 3 4 5 6

enter image description here

enter image description here

The MAx cardinality in above graph is MORE THAN ONE ,but the Correct answer is 1.

I think i am not implementing it correctly,please can you tell where i am making mistake Or is there any other Method

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:15:33+00:00Added an answer on June 4, 2026 at 9:15 pm

    I found the answer myself ,
    the next day i posted this question.

    And my-solution passed all test cases .

    I was making mistake in the last step.
    Actually the Answer/solution is the total Number of vertices in SET B that does not contain the edge of Maximal Bipartite Matching.

    For Example on sample test case 1::

    Maximal Matching M={(1A,3B)}.

    No edge of maximal matching is incident upon two vertices (Vertex 1 and Vertex 2).So answer is equal to number of such vertex=2

    For test case 2::

    Maximal Matching M={(1A,2B),(2A,3B),(3A,4B),(4A,5B)}.

    No edge of maximal matching is incident upon one vertex (Vertex 1).So answer is equal to 1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know the question I'm going to ask is already asked for by other
I hope that this one is not going to be ask-and-answer question... here goes:
I think I already know the answer, but I'm going to ask the question
Preamble So, this question has already been answered, but as it was my first
I was going to ask a question here about whether or not my design
I have a question that I'm ashamed to ask, but I'm going to have
I'm going to ask a newbie question here. I need to use a control
I think I am going to ask very stupid Question here. In my current
This question was asked a few years ago, so I'm going to ask it
I'm sorry if this is not really an appropriate question to ask on here,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.