Open In App

Contest Experiences | AtCoder: ABC #284

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

Atcoder is an Online Platform where coder come and solve the questions to gain experience of coding, during interviews and also make their foundation strong. There are different types of contests Available on their platform such as AHC (AtCoder Heuristic Contest), AGC (AtCoder Grand Contest)ARC (AtCoder Regular Contest), and ABC(AtCoder Beginner Contest).

About the Contest | AtCoder Beginner Contest #284:

  • Contest Date: 07/Jan/2023.
  • Contest Time: 05:30 pm (IST)
  • Duration: 100 minutes
  • Number of Questions: 8
  • Question-wise point values: 100-200-300-400-500-500-600-600
  • Contest Rule: You get a score based on problems solved during the contest.
  • Rank Computed: From the total marks of Question- [(the time you spend to get your current score) + (5 minutes) * (the number of incorrect attempts)].

Link of the Contest: https://atcoder.jp/contests/abc284

Overview of the Challenge:

Problem Name

Difficulty

Pre-requisite

Approx. time to solve

Sequence of Strings

Easy

Strings

5 min.

Multi-Test Cases

Easy

Even Odd

5 min.

Count Connected Components

Easy – Medium

Connected Components

10 min.

Happy New Year 2023

Medium

Prime Numbers

20 min.

Count Simple Paths

Medium

Depth First Search

30 min.

ABCBAC

Hard

Z algorithm

Only Once

Hard

Graphs

Count Unlabeled Graphs

Hard

Graphs

Problem 1: Sequence of Strings

This was a basic problem in which we had to print the given sequence of strings in the reverse order of which they were given in input. I used a vector to store the strings and then iterated over the vector in reverse order using a for loop.

Problem 2: Multi Test Cases

This problem was also a straightforward one. In input, we had a list of integers for each test case, and we needed to print the number of odd integers in the list for every test case. I initialized a count variable to zero for count of odd integers and incremented it whenever the integer inputted was odd. And then printed its value, for each test case.

Problem 3: Count Connected Components

It was a standard Graph based problem to count number of connected components in an undirected graph. You can check a detailed article Connected Components in a Graph to know more about this problem.

Problem 4: Happy New Year 2023

In this problem, a positive integer N was given, and we needed to find two distinct prime numbers p and q such that N = p2q. Here, N could range up to 1018. So, the catch was to know that min(p,q) will always be less than or equal to N1/3, so we could check for prime numbers from 1 to N1/3 to get values of p and q.

Problem 5: Count Simple Paths

In this problem, I used a depth first search approach to count number of paths from the node having value 1. As mentioned in the problem, we need to return minimum of number of paths and 106, so we can return once the number of paths exceed 106 to avoid time complexity issues.

Problem 6: ABCBAC

I was unable to solve this problem during the contest. But later on, I discovered that this problem would be solved using Z Algorithm about which one can read the detailed article on GFG.

Conclusion:

The contest was on a medium to hard level on overall basis. You can start exploring the platform to test your DSA and competitive programming skills. You should start with Atcoder Beginner Contests on the platform and then once you are comfortable with solving questions in those contests, you can go for ARC( AtCoder Regular Contests) and other contests on the platform. It is a decent platform to prepare for your placements as well as to master competitive programming.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads