Hello everyone!
Cybros, the competitive programming club of LNMIIT Jaipur is back again to invite you to participate in Enigma 2025 — Cybros LNMIIT. Enigma is the flagship event of Cybros LNMIIT conducted in the LNMIIT Jaipur's annual tech fest Plinth.
This will be an individual programming contest and the duration will be 2.5 hours and you will be given 6 problems to solve.
- Registration Form : Form link
- Contest Link : Enigma '25
- Date : January 26, 2025 at 14:00 IST (8:30 UTC)
The prize pool of the contest is INR 22000 split into two divisions of participants, online and onsite. You must fill the registration form if you want to be considered for the prizes.
Prize pool for onsite participants :
- INR 10000 (Winner)
- INR 7000 (First runner up)
- INR 3000 (Second runner up)
Prize pool for online participants (only applicable for Indian school/college students):
- INR 2000 (Winner)
- Goodies (Top 5 participants)
The problems have been authored and tested by synthborne, paramveer5404, Punpun018, AyushK22, Overlord99.

Cybros LNMIIT is also conducting more Competitive Programming events in their tech fest. You can check the rest of the events in the brochure which might interest you.
As a part of Plinth, we will also conduct IUPC (Inter University Programming Contest), which is an ICPC-like contest for teams of three people. This contest is a good practice for the real ICPC rounds with cash prizes.
You can register for rest of the events from our Instagram and receive future updates regarding the events.
UPD1 : Contest registrations are open!
UPD2 : The contest starts in 30 minutes. Do register.
UPD3 : Top 5 participants of the contest :
- kingmessi
- arnabmanna
- 1_2_3_4_5_9
- uzers8
- AJ148
First solves :
UPD4 : We are sorry for the delayed editorial.
EDITORIAL
Author : AyushK22, synthborne
A : 580057A - Counting is Fun
TutorialLets see when the answer is $$$0$$$. If two consecutive non missing elements are not following the condition i.e. $$$a_{i + 1} \leq a_{i}$$$. If two elements one to the left of a missing position, lets call is $$$a$$$ and one to the right, lets call it $$$b$$$ are not following the condition i.e. $$$b \leq a + 1$$$.
In any other scenario, the answer always exists. We can place $$$b - a - 1$$$ elements at each missing position ($$$a$$$ and $$$b$$$ as defined above) and multiply all these values to get the answer.
Solution
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef unsigned long long ull ;
void solve()
{
int n ;
cin >> n ;
bitset<65> bt1(n);
set<int> possible ;
int previ= 0 ;
for(int i =0 ;i<=64; i++ )
{
if( bt1[i] == 0 )
{
for(int j = i-1 ; j>=previ ;j-- )
{
bt1[j] = 0 ;
}
ull t2= bt1.to_ullong() ;
possible.insert(t2);
previ = i;
}
}
cout << possible.size() << "\n";
for( auto x: possible)
{
cout << x << " " ;
}
cout << "\n" ;
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tt;
cin >> tt;
while(tt--)
solve();
return 0;
}
Author : roronoa_2z
B : 580057B - Bitwise Treasure Hunt
Hint1If a bit is unset it remains unset.
Hint2Notice when a new AND value is added to the set.
TutorialThe AND Sequence, though infinite, involves a decreasing operation. The solution employs a greedy approach: if a continuous segment of ones is set in the binary representation of the last number added to the set, they all become unset simultaneously.Thus, our approach is simple: set all consecutive segments of ones from right to left to $$$0$$$, and each time, add the resulting number to the set. Given that $$$n \le 10^{18} $$$, we have at most $$$\mathcal{O}(60)$$$ operations per test case, as there are a maximum of $$$60$$$ bits.Be careful that are sequence start from $$$n$$$&($$$n$$$+$$$1$$$).
Solution
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef unsigned long long ull ;
void solve()
{
int n ;
cin >> n ;
bitset<65> bt1(n);
set<int> possible ;
int previ= 0 ;
for(int i =0 ;i<=64; i++ )
{
if( bt1[i] == 0 )
{
for(int j = i-1 ; j>=previ ;j-- )
{
bt1[j] = 0 ;
}
ull t2= bt1.to_ullong() ;
possible.insert(t2);
previ = i;
}
}
cout << possible.size() << "\n";
for( auto x: possible)
{
cout << x << " " ;
}
cout << "\n" ;
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tt;
cin >> tt;
while(tt--)
solve();
return 0;
}
Author : synthborne
C : 580057C - Permutation Colouring
TutorialLets rephrase the problem first. If we can colour a permutation in $$$k$$$ operations, we can always colour it in exactly $$$k$$$ operations. So, I will try to colour permutations in least number of operations possible. I will always select a maximal increasing subarray at any instance and colour it entirely. Now, the problem reduces down to finding minimum number of increasing subarrays I can split the permutation into, lets call it $$$x$$$ which can be coloured in $$$x$$$ operations.
We can see that if a permutation can be split into $$$x$$$ increasing subarrays. It has $$$x - 1$$$ number of adjacent value pairs where $$$a_i \gt a_{i + 1}$$$. Lets call these kinds of adjacent value pairs as "bad" pairs. So, we will try to find the number of permutations for each value of $$$k$$$ from $$$0$$$ to $$$n - 1$$$ where $$$k$$$ denotes the number of bad pairs.
We will use dynamic programming to do this. $$$dp(i)(k)$$$ stores the number of permutations of length $$$i$$$ with $$$k$$$ bad pairs. Now, if we want to place the element $$$i + 1$$$ to make permutations of length $$$i + 1$$$. I can place it as the last element of any $$$k + 1$$$ increasing subarrays to retain the number of bad pairs or place it anywhere else to increase the number of bad pairs by $$$1$$$.
Solution
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef unsigned long long ull ;
void solve()
{
int n ;
cin >> n ;
bitset<65> bt1(n);
set<int> possible ;
int previ= 0 ;
for(int i =0 ;i<=64; i++ )
{
if( bt1[i] == 0 )
{
for(int j = i-1 ; j>=previ ;j-- )
{
bt1[j] = 0 ;
}
ull t2= bt1.to_ullong() ;
possible.insert(t2);
previ = i;
}
}
cout << possible.size() << "\n";
for( auto x: possible)
{
cout << x << " " ;
}
cout << "\n" ;
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tt;
cin >> tt;
while(tt--)
solve();
return 0;
}