akay_99
December 25, 2020, 4:19pm
1
We here at Codechef NSEC College Chapter would love to invite you all fellow community member to join us in this learning trip with Encoding December 2020 .
Contest Link:- Encoding December 2020 .
Codechef NSEC Chapter :
@arnie8991 @sunitasen @rioji @akay_99 @skrstv123 @anjali_190300 @mahesheka2001 and @anuska_18
<>See you in the ranklist!</ >
Editorial Links:
PROBLEM LINK:
Practice
Contest Link
Author: Anjali Jha
Tester: Sunita Sen
DIFFICULTY:
CAKEWALK
PREREQUISITES:
None
PROBLEM:
There are N integers in an array. The kids are happy if the difference between the maximum and minimum numbers in the array is less than X.
EXPLANATION:
The code involves only finding out the maximum and minimum integers in the array and checking if their difference is strictly less than X.
TIME COMPLEXITY:
The time complexity will be O(N)
SOLUTIONS:
Sette…
PROBLEM LINK:
Practice
Encoding December’20
Author: Akash Kumar Bhagat
Tester: Arnab Chanda
Editorialist: Akash Kumar Bhagat
DIFFICULTY:
Cakewalk
EXPLANATION:
Given the row R and column C of the assembly, one has to return the number of Students present.
Answer=R*C
SOLUTIONS:
Python 3.7 for i in range(int(input())):
r,c=map(int,input().split())
print(r*c)
C++ #include <bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(false)…
PROBLEM LINK:
Practice
Contest
Author: Shekhar Srivastava
Testers: Akash Kumar Bhagat , Sunita Sen
DIFFICULTY:
EASY
PREREQUISITES:
Bitwise operators, the binary number system
PROBLEM:
You will be given a number x and you have to perform four different operations on x.
check i^{th} bit, if it is 1 print “ON” else print “OFF”.
turn on the i^{th} bit.
turn off the i^{th} bit.
swap the p^{th} and the q^{th} bits.
for queries 1,2 and 3 you will be given the integer i, and for query 4 yo…
PROBLEM LINK:
Practice
Contest Link
Author: Anjali Jha
Tester: Sunita Sen
DIFFICULTY:
EASY
PREREQUISITES:
None
PROBLEM:
2 integers X and Y are given. The last digit of all the integers in the range 1 to X(both inclusive) divisible by Y are to be summed up and printed.
EXPLANATION:
Since the size of the integers is very big, using a loop will result in a TLE. If we observe, we need only the last digits of the first 10 multiples of Y because after that, the last digits are repeated i…
PROBLEM LINK:
Practice
Author: Anuska Sinha
Tester: Akash Kumar Bhagat Arnab Chanda
DIFFICULTY:
EASY-MED
PREREQUISITES:
Math
PROBLEM:
An array of numbers is given and an integer number (say M) is given. After performing 3 operations on the array, you will have to find the immediate greater and smaller numbers to the number provided (say M).
EXPLANATION:
Take an array … ( say [ 5, 15,1, 66, 55, 32, 40, 22, 34, 11 ] ) and take an integer M= 38
Now, perform the 1st step by swapping 5 an…
PROBLEM LINK:
Practice
Author: Rishab Jain
Tester: Akash Kumar Bhagat
Editorialist: Rishab Jain
DIFFICULTY:
EASY-MEDIUM.
PREREQUISITES:
Lazy Segment Tree , Constant time range add operation
EXPLANATION:
The problem can be solved with lazy propagation in segment tree .When there are many updates and updates are done on a range, we can postpone some updates (avoid recursive calls in update) and do those updates only when required.
For more details on lazy segment tree visit Here .
Time …
PROBLEM LINK:
Practice
Contest
Author: Shloka Mahesheka
Tester: Sunita Sen
DIFFICULTY:
MEDIUM
PROBLEM:
Given a string S and a number k. Find the number of distinct characters in the kth lexicographic smallest suffix of S.
QUICK EXPLANATION:
Sort all the suffix of the string. Number of distinct characters in the kth smallest suffix is the answer.This can be done using suffix array in the given constraints.
EXPLANATION:
After each rotation, the barrier shifts lefts.
After all rotation…
PROBLEM LINK:
Practice
Encoding December 2020
Author: Akash Kumar Bhagat
Tester: Arnab Chanda
Editorialist: Akash Kumar Bhagat
DIFFICULTY:
Medium
PREREQUISITES:
Maths, Divide and Conquer
PROBLEM:
You are given an array of numbers A of length N containing distinct integers from the range [1, N]. If we have 2 different sets of N numbers and we connect the i^{th} number from the first to the number i in another set, then count the number of intersections.
EXPLANATION:
This is the typic…
PROBLEM LINK:
Practice
Contest
Author: Sunita Sen
Editorialist: Sunita Sen
DIFFICULTY:
MED-HARD
PREREQUISITES:
DSU
PROBLEM:
Given an array of pairs, we will have to rearrange elements such that each pair is together.
EXPLANATION:
Let us consider the size of the array as N. Then, there will N/2 number of pairs.
So we traverse pairs one by one. There could be two cases here:
Both the elements form a pair:
Then we need not do anything here.
The elements are from different pairs:
Le…
<Happy Coding👩🏻💻/>
5 Likes
pop1912
December 28, 2020, 1:15am
2
Hi, Is there any editorial for the problems, If so please mention the link here please.
1 Like
akay_99
December 28, 2020, 7:46am
3
Sure, we will share the editorials soon