Open In App

Contest Experiences | Codeforces CF Round: #884 (Div. 1 + Div. 2)

Last Updated : 09 Nov, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

ABOUT THE CONTEST:

  • This Codeforce CF Round was conducted on 11 Jul 2023 by codeforces #884 for ( Div1 + Div 2 ) Participants.
  • In this Contest, there are a total of 8 (question F- two Version ) problems, and 2 hours and 15 minutes are given to you to solve this problem.
  • For each wrong submission 10 minutes extra penalty.

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

My Experience:

I was able to solve the A, B, C, D, and E problems of these contests.

OVERVIEW OF ALL CONTEST PROBLEM:

Problem Name

Difficulty

Approx. time to solve

Number of submissions by me

A. Subtraction Game

Easy-Medium

5 – 10 minutes

1

B. Permutations & Primes

Easy-Medium

5 – 10 minutes

1

C. Particles

Easy-Medium

10-15 minutes

1

D. Row Major

Medium

10-15 minutes

2

E. Great Grids

Medium

20-25 minutes

2

F1 .Min Cost Permutation (Easy Version)

Medium

F2 .Min Cost Permutation (Hard Version)

Hard

G .Tree Weights

Hard

H .Multiple of Three Cycles

Hard

LET’S DISCUSS THE QUESTIONS:

A. Subtraction Game:

To solve this if the difference between a and b (b – a) is 1, select n = 1. The second player can guarantee a win. If the difference between a and b is greater than 1, choose n = 2 for the second player to always win.

B. Permutations & Primes:

In this problem maximize the primality of a permutation, we should start by placing prime numbers from 2 to n (inclusive) in the permutation. Then fill the rest of the sequence with the remaining non-prime numbers in any order. This method ensures that the majority of subsequences will have a prime MEX.

C. Particles:

To solve this first sort the charges in ascending order. Iterate through the sorted charges. Combine negative charges and keep track of the total. If we have an odd number of negative charges, we might have one negative left, and it’s beneficial to combine this with the smallest positive charge available. Calculate the maximum charge by considering the possibility of one remaining negative charge.

D. Row Major:

For my approach to solve this problem is For even n, create a string with two characters in an alternating pattern. For odd n, start the string with the alternating pattern of two characters and append an extra character.

E. Great Grids:

To solve this first create an empty grid of the required size (n x m). Iterate through each constraint given. Check for each pair of cells in a constraint and assign their values as equal. While assigning, update the neighboring cells to ensure that no two cells sharing a common edge contain the same letter. If any conflict arises while trying to assign values, return “NO”. If all constraints can be assigned without conflicts, return “YES”.

Conclusion:

In the end, I was able to solve A, B, C, D, E problems. For me problem F1, F2, G, H was difficult. I wasted a lot of time to solving last problems, but I was not able to solve this. All the best for the upcoming contest.
Thank you !!!


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads