Open In App

Contest Experiences | Codeforce Round: #876 (Div. 2)

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

About the contest:

  • This contest was conducted by codeforces #876 for Div 2 Participants.
  • In this contest, there are a total of 5 problems, and 2 hours and 15 minutes time given to solve this problem.
  • The penalty was 10 minutes for each wrong submission.

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

My Experience:

I was able to solve 4 out of 5 problems during these contests.

OVERVIEW OF ALL CONTEST PROBLEM:

Problem

Difficulty

Topic

Approx time to solve

Number of submissions by me

The Good Array

Easy

Array

10 – 15 minutes

1

Lamps

Medium

Array

10 – 15 minutes

1

Insert Zero and Invert Prefix

Medium

Array, Prefix Sum

15 – 20 minutes

1

Ball Sorting

Medium-Hard

Array, Dynamic Programming

20 – 25 minutes

2 ( 1 WA )

Decreasing Game

Hard

Array, Dynamic Programming

LET’S DISCUSS THE PROBLEM:

Problem A: The Good Array

We first opens a file (at index 0) and skips the first line (likely headers), processes subsequent lines by splitting them into two integers, and then calculates and at the end prints a result based on those integers.

Problem B: Lamps

In this question we takes input for the number of test cases, and for each test case, we builds a dictionary (dict1) to store lists of integers associated with specific keys. Then, sorts these lists in descending order and calculates the sum of the first i elements in each list. The final result is the sum of these sums.

Problem C: Insert Zero and Invert Prefix

In this question for each test case, we checks if a specific pattern can be created from the input list. If the pattern can be created, we prints ‘YES’ and displays the pattern. If the last element of the input list is 1, then we prints ‘NO’ and moves on to the next test case.

Problem D: Ball Sorting

To solves a problem for multiple test cases by using dynamic programming. We calculates the minimum cost of dividing an array into decreasing sequences and at the end prints the results for various numbers of decreasing sequences in each test case.

Problem E: Decreasing Game

Implements a two-player game where the players take turns making moves based on the values in an array. The First player has a strategy to optimize their moves, while the Second player responds accordingly. The game continues until one player wins or the game concludes. We can use Dynamic Programming to solve this question.

Conclusion:

At the end I was able to solve 4 problem out of 5 problem. 5 question was difficult to me. I waste lot of time to solve last question but I was not able to solve it.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads