Open In App

Contest Experiences | Educational Codeforces Round #149 (Div. 2)

Last Updated : 30 Oct, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

ABOUT THE CONTEST:

  • This Educational contest was conducted by codeforces #149 for Div 2 Participants.
  • There are a total of 6 problems, and 2 hours time given to solve this problem.
  • For each wrong submission, the a 10-minute extra penalty.

Link of the Contest: https://codeforces.com/contest/1837

My Experience:

I was able to solve 5 problems out of 6 problems in these contests.

OVERVIEW OF ALL CONTEST PROBLEM:

Problem Name

Difficulty

Approx. time to solve

Number of submissions by me

Grasshopper on a Line

Easy

10

1

Comparison String

Easy-Medium

10

1

Best Binary String

Easy-Medium

10-15

1

Bracket Coloring

Easy-Medium

15

1

Playoff Fixing

Hard

Editorial for Two

Hard

25

2

LET’S DISCUSS THE QUESTIONS:

Problem A- Grasshopper on a Line

To solve the problem, we first calculate the remainder of x when divided by k. If the remainder is 0, jump directly to x. If the remainder is not 0, make at least two jumps: First jump in the direction of the remainder. Second jump to reach the nearest point divisible by k in the opposite direction. Third jump to reach x. Print the number of jumps and their distances. This approach ensures that we reach the destination in the fewest moves while adhering to the constraints of the problem.

Problem B- Comparison String

We need to determine the minimum cost among all arrays that are compatible with the given string s. For each test case: Traverse the string s character by character. Whenever you encounter ‘<‘, increment a counter for the number of different elements in the array. After processing the entire string, print the counter as the minimum cost.

Problem C – Best Binary String

To solve this problem: First count the number of ‘0’ and ‘1’ characters in the given pattern. If there are too many ‘0’s or ‘1’s to maintain non-decreasing order, it’s impossible to match the pattern. Otherwise, construct a binary string with ‘0’s and ‘1’s based on the counts. Distribute any ‘?’ characters evenly among ‘0’s and ‘1’s to minimize the cost and maintain non-decreasing order. Print the constructed binary string.

Problem D- Bracket Coloring

To solve this problem: First identify balanced subsegments in the bracket sequence. Assign a unique color to each balanced subsegment. If unbalanced brackets remain, color them to match the nearest balanced subsegment. If it’s not possible to color the sequence as described, print -1. Otherwise, print the number of colors used and the colors assigned to each bracket.

Problem F- Editorial for Two

To solve this First sort the problems by their editorial duration in ascending order. Choose the k problems with the shortest editorial durations. These are the k problems that Monocarp and Polycarp will work on. To minimize the total time, Monocarp and Polycarp should work on problems alternately to balance the workload. Calculate the total time for the editorial by summing up the durations of the chosen problems, and the longer of the two’s workload (Monocarp or Polycarp) will determine the editorial duration.

Conclusion:

At the end of this contest I was able to solve 5 problem. For me problem E was difficult, I was not able to understand problem E.
All the best for upcoming contest.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads