Hello Codeforces,
I am happy to invite you to GeeksforGeeks's Pan-India Coding Contest – Code India Code. Showcase your coding skills and win rewards up to INR 7 Lakhs.
Contest Details are as follows:
Qualification Round: (Register Here)
- Sunday, 6th March 2022, 12:00 AM (IST) to 7th March 2022,12:00 AM (IST)
- In order to qualify in the first round, the participant needs to solve a minimum of 1 question out of 4 in 24 hours.
Final Round:
- Thursday, 10 March 2022, 7:30 PM to 10:00 PM IST
- Only those who qualify in the first round will receive a link to the final round.
Prizes:
- Rank 1: Macbook Pro + Course voucher worth INR 12,000
- Rank 2: iPad Air + Course voucher worth INR 7,000
- Rank 3: Smart Watch + Course Voucher worth INR 3,000
- Rank 4-25: Tablets + Course Voucher upto INR 1500
- Rank 26-100: Noise Earbuds + Course Voucher upto INR 1500
- Rank 101-200: Noise Smartbands + Course Voucher upto INR 1500
- Prize distribution is limited to those residing in India only.
Problem Setting Panel:
- Contest Coordinators: Ashishgup, AvinashKartik
- Problem Setters: Ashishgup, AvinashKartik, Utkarsh.25dec, bunty_x, i.am.pratik, Omja
- Problem Tester: manpreet.singh
Even though the prizes are only for Indians, I would like to invite others to participate — the problem-set (specially the finals) contains some interesting and challenging problems :D
Good luck everyone. See you on the leaderboard!
Auto comment: topic has been updated by Ashishgup (previous revision, new revision, compare).
Cool prizes!
reply challenge on same day
Will the qualification round results be considered in any way while deciding the rankings for the prizes?
No :)
Congrats on winning Macbook Pro!!
Top performers will be given course vouchers, but logically thinking, do the top performers need those courses???
Right. I think they should provide the course voucher to those who perform average in the contest. So that they can enhance their skill with their expertise.
Is using prewritten code allowed? The rules don't seem to address this.
Yes :)
Really Excited to participate.
are the prizes be for Indians in top-X, or top-X Indian contestants in a separate Indian ranklist?
Top X Indian contestants
Is testcase of "MINIMUM MOVES" is wrong?
Test cases are correct.
will we enter the ranklist only after clicking on finish test? Edit :No
Mass cheating is going on!
A youtube channel is revealing the solution for problem A and problem B.
Please ban the youtube channel as soon as possible :(:(:(
Please remove the links.
you could have told this in private to any of the organisers.
Can anybody share the solution of the last 3 problems.
Don't know if it's intended or not but I solved Problem D(Special Number Count) with Digit Dp.
My dp solution has $$$13$$$ states which are as follows:
In all the memory declaration for my dp looked like this
ll dp[20][2][2][2][2][2][2][3][5][7][2][3][2];
The recursive function looked like this
ll recursion(int pos,int small,int two,int three,int five,int seven,int mod2,int mod3,int mod5,int mod7, int zero , int sumg1 ,int start ,string &curr)
Each recursive call was somewhat like this
val+=recursion(pos+1,0,n2,n3,n5,n7,(mod2+k)%2,(mod3+k)%3,(mod5+k)%5,(mod7+k)%7,n0,nsumg1,0,curr);
My somewhat okayish implementation
Heartfelt sincere orz!! 13 state DP
I did the same basically, but you don't really need $$$13$$$ states. You can compress quartic sum modulo each prime into a single value upto $$$210$$$ ( using custom radix base $$$\{2,3,5,7\}$$$ ). Also, similarly you can compress whether product contains $$$2/3/5/7$$$ into a 4 digit bitmask.
So my dp looked like
dp[20][210][1<<4][2][2][2]
Nice solution.
Downvoted for having the problem A in the contest
Can anybody share the solution to the first problem :)). Tried everything.
It's similar to this Problem. The only difference I found is that you don't need more than 3 operations to convert A into B.
But the solution is entirely different, and also here update operation is
A = A | X
where X could be any number >= 0Basically, if B <= A, we need to do |B-A| moves, as we can only increase B by 1. Otherwise, it is not difficult to see that we can always do it in at most 3 moves, as we will take the highest bit (say i) that they differ at, and in 1 move set all the bits in A smaller than i (by or-ing) and then increment A by 1, and then or the remaining bits smaller than i to make A and B equal. Now that we know the answer is always <= min(B-A, 3), we only need to check for answers 1 and 2. This is easy, as we only need to check for 4 cases, (A|X) = B, ((A+1)|X) = B, (A|X) = B+1, (A|X)+1 = B. For the last case, just reduce B by 1 and check.
Hey, this implementation handles all the cases you described. Why its giving WA?
I don't think you have handled the last case, (A|X) + 1 = B
Thanks got it.
This case just took my entire SUNDAY.
If
B > A
Somehow the main ambition is to make
A
a sub mask ofB
. Now, ifA
is already a sub mask ofB
, we can make them the same in only one operation!let
i
be the most significant bit whereA
andB
are not the sameupdate
A = A | (2 ^ i - 1)
for example
A = 10101
andB = 11010
, we updateA = A | 7
, nowA
becomes10111
update
A = A + 1
Now
A
becomes the sub mask ofB
for sure, and you will need only one operation to make both equal!So, at most, three operations are required to make
A
andB
equal.We have to handle cases where only one or two operations are sufficient.
Thanks for the detailed explanation
Am I the only one that is always bothered by statements like "win rewards up to INR 7 Lakhs"? Because it is not actually possible to win 7 lakh; the best you can do is a MacBook (which I can't imagine costing 7 lakh). 7 lakh appears to be the total value of the rewards; in addition, none of it is actually in the form of money, which is even more false advertising. Also, about 2 lakh comes from GFG course vouchers, which I suspect aren't really worth anything.
Destroyed in seconds
GFG course vouchers are not only limited to programming/dsa courses, you can take any( OS, DBMS, etc.) course.
He is still likely correct.
but when did he said he is wrong?
Yeah you are correct it is rather a way of advertising it to suit their needs for greater participation
Can someone explain how to solve problem — The Duality Task?
You can find duality by considering a common prime number for each element in a subsequence. Now, just take initial C as B and find its duality. ans = n — max(0, duality_A — duality_B)
How to solve B — “Split the Array”? I had nothing better than an $$$N^2$$$ DP…
It involved a bit of casework.
Think along the lines of what will happen if k is odd/even and j is odd/even.
The problem then reduced to a dp with $$$4$$$ states per element.
That $$$O(n^2)$$$ is enough just to ensure that you don't create a segment of length more than 20. So it will become $$$O(20*N)$$$
You can work on paper to see that if a segment has a length of more than 10 then you can split the first/last 4 elements into 2 segments of length 2 and it won't change signs. These 10/20 are the loose upper bounds, I didn't try finding exact values.
Upd: Idk the reason for these downvotes, but it's correct. I have 100 points (and 6th rank) on the scoreboard using this solution and I'm confident about its correctness as well. See you all in Finals now.
Is there any way , to get notify on new blog in recent actions in Codeforces.
:(, feeling very bad not able to participate , I did not know about contest .
Has anyone received any mail saying "Congratulations..etc and asking for details for sending the prize"?
It's been more than 3 days and not a single mail from gfg after the contest. Ashishgup any clue?
Any updates on prize distribution Ashishgup,Omja?
Will the contestants above rank 200 be included under 200 after removing overseas particpants.