Need Help With Coding Round Questions Upsolving

Revision en2, by Daenerys_Targaryen_1, 2021-07-31 21:57:33

Hello everyone, I want to learn from my mistakes and so since I have no one to help me out so am writing this blog.

Qn1

Given coordinates of points on a 2d plane. [At max 100 points (0<=x,y<=100)].
You need to find the minimum cost rectangle such that it has atleast k points.(1<=k<=100)
Cost is decided by 2*(length + breadth) of the rectangle.

My Approach

If anyone has a better approach then please write it in comments section :)

Qn2

Given two numbers A and B. Find if it is possible to transform A to B using the following operations any number of times.
1) If A is odd then you can subtract 1 from it
2) If A is even then you can add 1 to it
3) If A is even you can divide it by 2
4) If A is even/odd you can multiply it by 2
If its possible to transform A to B then print the minimum number of operations required else print -1.
Constraints: 1<=A,B<=10^18

Qn3

Given a rooted tree with N nodes. Each node has some value Ci assigned to it. For each node in the tree, print the MEX(the smallest number not present in a pool of values]) of the values present in its subtree. Constraints: 1<=N<=10^5, 1<=Ci<=N-1, All Ci values are distinct and unique.

Qn4

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en6 English Daenerys_Targaryen_1 2021-08-01 11:10:45 32 Tiny change: 'ubmatrix.`<br>\nCons' -> 'ubmatrix.` where K = side of the submatrix<br>\nCons'
en5 English Daenerys_Targaryen_1 2021-08-01 10:55:48 8
en4 English Daenerys_Targaryen_1 2021-07-31 23:46:33 3 (published)
en3 English Daenerys_Targaryen_1 2021-07-31 23:39:37 8302 Tiny change: 'Hello everyone,\nI want t' -> '### Hello everyone,<br>\nI want t'
en2 English Daenerys_Targaryen_1 2021-07-31 21:57:33 675 Tiny change: '</spoiler>So, if anyone h' -> '</spoiler>\nIf anyone h'
en1 English Daenerys_Targaryen_1 2021-07-31 21:45:58 1165 Initial revision (saved to drafts)