Open In App

Contest Experiences | AtCoder: Beginner Contest 285

This contest was conducted by AtCoder’s Platform on the 15th of January 2023, It consisted of 7 questions and the time given is 100 minutes and each question has different points according to their difficulty level.

Link of the contest: https://atcoder.jp/contests/abc285



OVERVIEW OF QUESTIONS:

Problem Name

Difficulty

Points

Edge Checker 2

Easy

100

Longest uncommon Prefix

Easy

200

abc285_brutmhyhiizp

Medium

300

Change usernames

Medium

400

Work or Rest

Medium

500

Substring of Sorted String

Easy

500

Tatami

Hard

600

My Approach:

1st problem:

They give us a complete binary tree with nodes numbered from 1 to 15 from root to leaf as there are only 14 possible pairs we can give conditions directly to check whether this pair is directly connected or not.



2nd problem:

They give a string ‘S’ of length ‘N’, then we had to find the maximum non-negative integer l that satisfies the following condition:

My approach is to take two for loops, in the inner loop I gave an if condition to check whether the two indexed characters are equal or not, if not equal increase the count value and printed count value for each inner loop.

3rd problem:

They give a string ‘S‘ and we have to find the index of that string. The order is in the format of A, B.. Z, AA, AB,.. ZZ, AAA… My approach to find the index of given string:
first there are 26^k IDs of length k initialize the answer with 26^1 + 26^2 + 26^3… + 26^(k-1) and then add the value of last letter and add 1 to final answer because we have to print 1-based index.

4th problem:

For the problem of changing usernames based on certain rules with a pair of ‘N‘ strings Si and Ti, where each user wants to change their Si username to Ti:

5th problem:

For the problem of finding maximum weekly productivity given a sequence of integers with constraints:

Here’s the approach:

6th problem:

They give an integer ‘N‘ and a string ‘S‘ and ‘Q‘ queries and each query consists 3 elements t, l, k. if t is 1 then l is an integer and k is a character, we have to change the character at lth index to ‘k‘. if t is 2 we have to check substring from l to k is in sorted order or not.

7th problem:

They give a matrix consisting of 2’s, 1’s and ‘?’ and there are two types of tiles 1×2 tiles and 1×1 tiles. We have to fit these tiles into matrix, if these matrix can be filled then print “Yes” else “No“. By using recursion we can check but I didn’t do this because of having less time.

Conclusion:

The contest includes a range of problem complexities, making it suitable for diverse skill levels.


Article Tags :