### Ashishgup's blog

By Ashishgup, 10 months ago,

We invite you to participate in CodeChef’s December Cook-Off, this Monday, 21st December, from 9:30 PM to 12:00 AM IST.
Note the unusual time.

You will be given a total of 9 problems (7 in Div2, 7 in Div1) to solve in a duration of 2.5 hours.

Joining us on the problem setting panel are:

Problem Submission: If you have original problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Prizes: The top 10 Indian and top 10 Global participants will receive CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here.

The video editorials of the problems will be available on our YouTube Channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Good luck and have fun!

• +173

 » 10 months ago, # |   +11 Btw, why it is not on Sunday as usual?
•  » » 10 months ago, # ^ |   0 Because cf has a round.
•  » » 10 months ago, # ^ |   +26 That's because the round was clashing with Technocup based Codeforces Rounds that could not be rescheduled.
•  » » » 10 months ago, # ^ |   +65 Next LTIME clashes with AGC(goodbye rng_58 day1).Can the date be changed?
 » 10 months ago, # |   0 The problem submission link is broken.
•  » » 10 months ago, # ^ |   0 Just get rid of the prefix.
•  » » 10 months ago, # ^ |   0 Fixed, thanks.
 » 10 months ago, # |   +32 Reminder 1 — Contest starts in 2.5 hours.
•  » » 10 months ago, # ^ |   +21 Reminder 2 — Contests starts in less than 15 minutes.GL; HF!
 » 10 months ago, # |   +1 Is it a first time cookoff will contain 7 problems in each division? (Now, it seems like codeforces :p)
 » 10 months ago, # |   0 reminder : Just 6 min left.Hope my first Div1 contest will be good .
 » 10 months ago, # |   +4 Is the server down for anyone else? I'm not able to submit solutions.
•  » » 10 months ago, # ^ |   +6 Sorry, there was an issue with CodeChef. It is being handled.
•  » » » 10 months ago, # ^ |   +1 The contest should have been extended by 5-10 minutes due to the issue.
 » 10 months ago, # |   +3 Server cannot process your request. Please try again.
 » 10 months ago, # |   +3 You didn't mention rippling is hiring through this contest too.
 » 10 months ago, # |   +29 We faced some issues with our servers, and as a compromise, we have taken down most of the IDE service. So you will not be able to use https://www.codechef.com/ide properly for now. Apologies for the issue.The contest is rated.
 » 10 months ago, # |   +47 SEDPASS problem was written very poorly. It took me forever to realize that S was the whole string.
•  » » 10 months ago, # ^ |   +19 Very true, I literally spent half an hour wondering how is "a" a bad substring and then saw the announcement :(.
•  » » 10 months ago, # ^ |   +50 Let's see: Literally first sentence in the statement: "managed to obtain a string S" Literally last sentence in the statement: "Help Sed find the number of good substrings in the string S." Input: "The first and only line of each test case contains a single string S." Constraints: talks about S. Also somewhere in the statement: "the original string S" What else would S be?
•  » » » 10 months ago, # ^ |   +13 "A substring of S is good if it is possible to choose a lowercase English letter C such that the following process succeeds:" I missed the "of" in this sentence. :(Anyways the problem was nice!
•  » » » 10 months ago, # ^ |   +39 IMHO, the problem statement could have been worded better. There was not that much need of introducing the process success aspect. The problem needs to be studied much carefully to properly understand everything. Probably this much amount of deep reading is not warranted for the problems of easier difficulty level.May be the same thing could have been written like this.A substring r is considered good if you can convert r into a string R (by replacing each of the '?'s in r by some letter from 'a' to 'z', note that all occurrences of '?' must be replaced by the same letter) such that the parity of each letter from 'a' to 'z' in the original string S ('?' won't be accounted for parity calculation) should be same as that in the string $R$.
•  » » » » 10 months ago, # ^ |   +4 More structured instead of one long sentence, but sure. That's further away from the original statement with its "if we can do the following" and "such that the third condition of the procedure holds", I had enough with 8 fairly long problems (actually 9 at the end) to go into such redesigns.
 » 10 months ago, # | ← Rev. 2 →   +19 I had such a hard time in understanding the question SEDPASS. May be I should improve my English language skills :(
•  » » 10 months ago, # ^ | ← Rev. 3 →   +16 ahh i agree statements were huge :. also the definition of substring mid problem statement was a bad idea. I think putting it at the bottom would have been better.
 » 10 months ago, # |   +39 Cool contest again, thanks to setters and admins! SWEETRQ is especially cool, but, maybe, SDSTRING is too easy to be in Div1 contest.SWEETRQ: let's count number of triples of cells $(c, c_1, c_2)$ such that $c, c_1$ are in the same row, $c, c_2$ are in the same column, and the number in $c$ is larger than numbers in both $c_1$ and $c_2$. Then sweet rectangle contains $2$ such triples and non-sweet — exactly $1$, so it's enough to count number of such triples, which is just sum over all cells $(x, y)$ of (how many numbers in row $x$ are smaller than $a_{x, y}$)$\times$(how many numbers in column $y$ are smaller than $a_{x, y}$)
•  » » 10 months ago, # ^ |   +74 Increasing difficulty of the first problem may not be a good idea. Many people will just leave the contest if you raise its difficulty. Solving first problem quickly commits people to participate in the contest, otherwise if it starts taking more time, the propensity of people leaving the contest rises.
 » 10 months ago, # |   0 What's the approach for d1D (Baskets)? I tried experimenting with capacities being powers of 2, but that didn't pass (or I might have implemented it wrong). Am I on the right track?
•  » » 10 months ago, # ^ |   +12 Am I on the right track? Yes, all capacities except one are powers of 2 (in my solution).
•  » » 10 months ago, # ^ |   +8 Yep, I think you're on the right track as I also did powers of $2$. The idea is you fill in a bucket of size $2^k$ until there are $2^{k-1}$ fruits, and then keep filling the bucket of size $2^k$ one fruit at a time while using the rest of your three fruits to fill up $2^{k+1}$ until the bucket of size $2^{k+1}$ reaches a fruit count of $2^k$, which must happen before the bucket of size $2^k$ gets full. Then do the same thing for the bucket of size $2^{k+1}$ and so on.
•  » » » 10 months ago, # ^ |   0 Oh ok, I was trying something similar to that. Guess my implementation was off somewhere. Thanks!
•  » » 10 months ago, # ^ |   +26 Maybe you forgot that sizes of baskets must be less or equal than $n$?
•  » » » 10 months ago, # ^ | ← Rev. 2 →   0 Yes, I did that mistake and realized it after the contest.
•  » » » 10 months ago, # ^ | ← Rev. 2 →   +4 Oh my god, that was it. I printed 2^x from x=1 to x=16 and forgot that it had to be <=n. I wish they told you if your samples passed or failed, that would have probably made me realize.
•  » » » » 10 months ago, # ^ |   0 I've started writing a lot of asserts on my output to ensure that they satisfy whatever constraints — helps you catch many mistakes locally (also, you get runtime error instead of wrong answer)
•  » » 10 months ago, # ^ | ← Rev. 2 →   +10 Yup, powers of two is on the right track. SpoilerSuppose we are filling a basket of size $2^{i}$ from $2^{i - 1}$ till $2^{i}$, increasing one per step using one operation. Then in the same $2^{i - 1}$ steps we can fill a new basket from $0$ to $2^{i}$ as well using 2 more operations per step. Code#include #define int long long using pii=std::pair; using namespace std; int t, n; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> t; for(int cases = 0; cases < t; cases++) { cin >> n; cout << 30 << "\n"; for(int i = 1; i <= 30; i++) cout << min(1ll << i, n) << "\n"; cout << 1 << "\n"; cout << 1 << " " << 1 << "\n"; int cursz = 2, curbasket = 1, nestep = 1; for(int curstep = 2; curstep <= n; curstep++) { if(curstep > cursz) { cursz *= 2; curbasket++; nestep = 1; } cout << 3 << "\n"; cout << curstep << " " << curbasket << "\n"; cout << nestep++ << " " << curbasket + 1 << "\n"; cout << nestep++ << " " << curbasket + 1 << "\n"; } } return 0; } 
 » 10 months ago, # |   +45 Amazing problemset! Thanks for all who created this contest.
 » 10 months ago, # |   +4 Video editorials for the first 8 problems have been uploaded here. The last video editorial will be uploaded over the next day or two.
•  » » 10 months ago, # ^ |   0 Editorials for 5 problems can be found here. The remaining editorials will be published in a day or two.
 » 10 months ago, # | ← Rev. 2 →   +22 Problem sets were very good but servers were not :(
 » 10 months ago, # |   0 For "BASKETS", only 3 fruits per day is enough!Just wondering, if allowing 4 helps in any way. At least I couldn't think of a simpler solution using 4 fruits.
•  » » 10 months ago, # ^ |   +26 simpler solution using 4 fruitsThats the reason they allowed 4 fruits and 1000 baskets. Many times they fake constraints instead of making them tight so as to avoid giving out information. Utkarsh and Ashishgup did same in D. Circle Game as well. They could have very easily made T<=1e5 and d<=1e18 in D. Circle Game.
 » 10 months ago, # |   -30 It's extremely easy to solve SEDPASS if we just think about one word: Divide and Conquer. Ez solution to SEDPASS