GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Friday, 8 July 2022

[Solution] Largest Square in the garden CodeChef Solution 2022


Chef has a garden of size N×N. The garden is divided into N2 squares of size 1×1 each.

Chef has plants in some unit squares of the garden, because of which, that part looks green.
Formally, for the ith row (0i<N), Chef has plants in all the columns from Ai to Bi (both inclusive) where 0AiBi<N.

Help Chef find the length of the side of the largest square that is green.

Input Format

  • The first line contains an integer N, the size of the garden.
Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇


  • The next N lines contain two space-separated integers Ai and Bi, representing that plants are present in all the columns from Ai to Bi (both inclusive) of the ith row.

Output Format

Output a single integer denoting the length of the side of the largest square that is green. In other

Bidding CodeChef Solution 

Pass the Exam CodeChef Solution

Chef and Candies CodeChef Solution

Journey of the Knight CodeChef Solution

Slow Solution CodeChef Solution 

Game of Piles Version 1 CodeChef Solution

Find A, B, C CodeChef Solution

Largest Square in the garden CodeChef Solution

Game of Piles Version 2 CodeChef Solution


 words, output the length of the side of the square with maximum size, inside which all unit squares have plants.

Constraints

  • 1N106

No comments:

Post a Comment