### Akulyat's blog

By Akulyat, 2 months ago, translation,

Hi, Codeforces!

Three years later, first ideas of a contest turned into this complete set of problems, so I am glad to invite you to take part in Codeforces Round #824 (Div. 2), which will take place on Oct/02/2022 17:35 (Moscow time). The round will be rated for the participants with rating lower than 2100. Participants from the first division are also welcomed to take part out of competition.

You will be given 2 hours 15 minutes to solve 6 problems. All the problems were created and prepared by me.

I would also like to thank:

Scoring: $500-750-1250-1750-2250-3000$.

Note that some problems have similar scores. Your sense of the scoring distribution may differ, don't forget to read further problems if you get stuck.

I look forward to seeing you on the leaderboard. I hope you'll enjoy all 6 problems and wish you good luck!

Too many thumbs down

UPD1: Editorial

UPD2:: Winners and First to solve

Div2

Place Participant
1 HugeWide
2 9u46
3 naaamte
4 seaneri
5 huweidong

Div1 + Div2

Place Participant
1 maspy
2 orz
3 BurnedChicken
4 MeliodasIRA
5 Chenyu_Qiu

First to solve

Task Participant
A smartnotu
B Chenyu_Qiu
C Elaina-chan
D Sai_t
E swift-zym
F tfg

• +227

 » 2 months ago, # |   0 \ (•◡•) /
 » 2 months ago, # |   +8 I can't wait to get back
 » 2 months ago, # |   +60 I reacted with heart on telegram
 » 2 months ago, # |   +5 wish everyone will find something interesting in this round
 » 2 months ago, # |   +11 I hope to cross 1000 rating mark in this contest for the first time ^_^
•  » » 2 months ago, # ^ |   +1 I think, I made it :))
 » 2 months ago, # |   0 Mamba Mentality Round
 » 2 months ago, # |   +16 Its time to summon the hearts <3 army. Letss go
 » 2 months ago, # |   -30 I am not giving any advanced vote anymore ,last round was literally disappointing with weak pretests, hope this one goes well
 » 2 months ago, # |   +7 Finally a contest on the weekend that I can do!
 » 2 months ago, # | ← Rev. 2 →   0 Hope For a Big +ve delta to everybody in the contest
•  » » 2 months ago, # ^ |   -7 That's not actually possible because rating is not calculated like this, let's suppose everybody solved all problems then its not that everybody will have +ve delta, delta is based on the people which have higher rating than you but performed less than you, then you will have a +ve delta...like sort the registered participants by rating and then see on which number you are coming if your rank in the contest is more than that then you will have +ve delta (assuming everybody who has registered participates).
•  » » » 2 months ago, # ^ |   -6 I know this but I wish max no participant in this contest get +ve delta
 » 2 months ago, # | ← Rev. 2 →   +16 A round with no tester comments! That's pretty astonishing. Edit: Now there are some.
•  » » 2 months ago, # ^ | ← Rev. 2 →   +9 Many users(including me) would be sad as the last round had too many FSTs and Hacks due to bad testing in problem B and C! :(
•  » » » 2 months ago, # ^ |   0 hope good pretests this time, lost too much points cus of fst
•  » » » 2 months ago, # ^ |   0 What is FST?
•  » » » » 2 months ago, # ^ |   0 Failed System Testing
 » 2 months ago, # |   +61 As a tester, this contest has a couple of nice problems, and the overall quality is much better than average!
•  » » 2 months ago, # ^ |   0 The first half gave me PTSD. Hoping for a good round ^_^
•  » » 2 months ago, # ^ |   0 Extremely excited! hope to solve atleast A,B AND C. Wish you all the best friends
•  » » 2 months ago, # ^ |   0 A comment like this from the testers always gives me extra confidence!
•  » » 2 months ago, # ^ |   +3 So can you guarantee that I will go to BOI remaining purple?
•  » » 2 months ago, # ^ | ← Rev. 3 →   -17 [Deleted]
•  » » » 2 months ago, # ^ |   +1 do you use some extension? How there is 3 extra columns in the end ?
•  » » » » 2 months ago, # ^ |   0 yea, i cant find that extension, can u pls share the name
•  » » » » » 2 months ago, # ^ |   +2 It is 'Carrot'
•  » » » » » » 2 months ago, # ^ |   0 Thanks
•  » » 2 months ago, # ^ |   0 I don't know then what's average for you :|
 » 2 months ago, # |   +5 As a tester, I must say that the problems are really great and I highly recommend everyone to come.
•  » » 2 months ago, # ^ |   +106
 » 2 months ago, # |   -8 Hoping for interesting problems! Good luck everybody!
 » 2 months ago, # |   +3 This gonna be my first contest ever, I'm so excited
 » 2 months ago, # | ← Rev. 2 →   +1 Hopefully i dont get destroyed by the problems like the last contest :*).
 » 2 months ago, # |   0 Hope to become a pupil ^_^
 » 2 months ago, # |   -6 Hopefully this contest will go a bit better for me than the last one.. good luck to all participants!
 » 2 months ago, # |   0 Good luck to all, I hope everyone can enjoy me this round.
 » 2 months ago, # |   0 Hoping for +141 delta
 » 2 months ago, # | ← Rev. 2 →   -9 meme ...
 » 2 months ago, # |   0 i wish i will get plus in this contest
 » 2 months ago, # | ← Rev. 3 →   0 .
 » 2 months ago, # |   0 My first competition
 » 2 months ago, # |   0 hope to get a positive delta from this round
 » 2 months ago, # |   0 Good Luck Everyone!!! Hope everyone has a fun time :)
 » 2 months ago, # |   +39 You could find someone to teach you if you don't know how to write a problem description, and about what information shuold be emphasized.
 » 2 months ago, # |   -32 Solution for problem D has been leaked on a discord group by a user named Instrospection. Solution is in PythonATTENTION, please look into it coordinators and MikeMirzayanov
•  » » 2 months ago, # ^ |   0 but how did you find that out
•  » » » 2 months ago, # ^ |   0 ahahhahahahha he was searching for it
•  » » 2 months ago, # ^ |   +21 i don't think you should comment this under the blog (where everyone can see it) in the middle of the contest :/
•  » » » 2 months ago, # ^ |   0 Strongly agree with you.Still, he couldn't have known if it was leaked on a "discord group" if he wasn't in that group.
•  » » » » 2 months ago, # ^ |   0 I'm a part of that group but didn't know that they cheat, i joined for educational purpose
 » 2 months ago, # |   +7 The problem statements were shit.
•  » » 2 months ago, # ^ |   -10 So is my implementation skills ;-;
•  » » 2 months ago, # ^ |   -10 D is a good problem, but the problem statements are very bad.
•  » » 2 months ago, # ^ |   -11 cant agree more, i wasted more than 10 minutes trying to understand A either the statement is a puzzle or my english is shit or both
•  » » 2 months ago, # ^ |   0 I could not understand problem B at all
 » 2 months ago, # |   -40 For me Global round was far better than this shitty round.
 » 2 months ago, # |   0 I spent too much time understanding the question, which is unfair to foreigners like me. Maybe my English is too poor.
 » 2 months ago, # |   -12 Enjoy seeing how number of upvotes falls
 » 2 months ago, # | ← Rev. 6 →   +17 I appreciate illustrations to the problem statements to make them more understandable. Without them it might've been crazyA — 24mins, still don't know what it was about, just submitted the obvious formulae from the samples after giving up on thinking.B — 16mins,C — 31mins, I feel like my implementation is crap but the task itself is quite decent.D — 24mins (just like A). Surprisingly easy. I enjoyed this kind of problem but wonder if it is too straightforward. Guess could've solved it even faster. So to me C>A>D>B . But from the number of submissions the round seems well balanced in general except E which has a very few submissions but it is fine for most people I guess.
•  » » 2 months ago, # ^ |   0 how do you do D? Why is it easy?
•  » » » 2 months ago, # ^ |   0 I guess as always for me I either think in the right direction or not. And here I was lucky.First think about how to find all triplets. Notice that two cards uniquely identify the third one. So you can calculate all the triplets for n*n*k. After that it becomes a basic combinatorics
•  » » » 2 months ago, # ^ |   +3 1) By two cards you can determine third to be in set2) So if two cards determine the third, then there cannot be two sets with strictly two common cards3) It means that any meta-set is two sets with one common card4) This gives O(n^2 * k) solution (store all meta-sets by common card and some combinatorics)
•  » » 2 months ago, # ^ |   -8 lol idk why so many ppl have such weird opinions on the problem set. Sure, the statements were unclear (especially for B, where it was blatantly incomplete). Regardless, I think the ideas required for the first 3 problems were what you would expect in a Div2
•  » » » 2 months ago, # ^ |   +3 ok then maybe ur better than me then. I find it's super challenging to think (even if the problem is easy) after spending 90% of brain stamina to understand the statements.
•  » » » » 2 months ago, # ^ |   -9 I wasn't replying to you. But I can tell you for sure that the English used for A was perfect, not sure about B. It's just that A is a difficult to understand problem in itself, maybe they could have reworded it better to make it sound less mathematically rigorous?
•  » » » » » 2 months ago, # ^ | ← Rev. 2 →   0 k. Ur an english genius then.
 » 2 months ago, # | ← Rev. 3 →   -17 The gap between D and E is too big.And WHY TIMELIMIT OF D is FOUR SECOND???Even the most brute force $\mathcal{O}(n^3k)$ can pass??? Why???(Submission 174397296 and My hack)Just why 4 sec??? Is there a standard solution that cant run in 2 sec??? a very bad round for me. not worthy of the time. wow upvotes are dropping very fast:) expected it to happen:)
•  » » 2 months ago, # ^ |   0 Wuf. Even my python solution passed for half a second
•  » » 2 months ago, # ^ |   +7 If $O(n^3k)$ can pass then it is the fault of the weak pretests not the loose time limit.
•  » » 2 months ago, # ^ |   +2 I'm actually very surprised that brute force would pass, even with the generous 4 second time limit, since it's like, $10^{10}$ operations. My guess is that the pretests are actually not too strong, and we might see TLE hacks and/or FST on $O(n^3k)$ approaches. I think the standard approach would take $O(n^2 k \log n)$ time (find sum of all pairs, store them in a map; then for each card, count how many instances of its additive inverse is present as a pair sum and add the count choose 2 to the answer). Mine took 623ms, so it should comfortably fit 4 seconds with slower languages or approaches with poorer constant factors (though I don't think mine was anywhere near optimized to begin with). Maybe they wanted to disallow unordered map hacks?
•  » » 2 months ago, # ^ |   +3 n^3*k passed main tests...
 » 2 months ago, # |   +10 I think the problems is really good and I enjoy it, but the descriptions of them is so unclear that I waste lots of time. Hope the next time the words will be much clearer.
 » 2 months ago, # |   0 did u have to do graphs to detect cycle in C?
•  » » 2 months ago, # ^ |   -13 well, it's just one cycle so you can check indegree and outdegree but I was too lazy so I used a DSU xd
•  » » » 2 months ago, # ^ |   0 can u show me ur submission by pasting it here or somewhere else with a link? i wanna see but submission are not viewable rn
•  » » » » 2 months ago, # ^ |   -18 Here you go#include #include #include #include using namespace std; int main() { int q;cin>>q; while(q--) { string db(256,0); string dbr(256,0); int dsu[256]; for(int i=0;i<256;i++)dsu[i]=i; int n;cin>>n; string s;cin>>s; functionfind= [&](int k){if(k==dsu[k])return k;return dsu[k]=find(dsu[k]);}; functionmerge=[&](int a,int b) {a=find(a);b=find(b);if(a!=b)dsu[b]=a;}; string unq; setcs; for(char&c:s)if(!cs.count(c)){cs.insert(c);unq+=c;} for(char&c:unq) { for(char t='a';t<='z';t++) { if(c==t)continue; if((find(c)!=find(t)|| (size(unq)==26&&unq[25]==c)) &&dbr[t]==0&&db[t]!=c) { db[c]=t; dbr[t]=c; merge(c,t); break; } } } for(char&c:s) { cout<
•  » » » » » 2 months ago, # ^ |   0 thanks
•  » » » » 2 months ago, # ^ |   0 https://codeforces.com/contest/1735/submission/174413223No graph. I used a Map to track which character corresponds to which character (obviously empty in the beginning).Filling that map is the crux of the problem. I used a List-array of size 26 to store all connections. ExampleString: bafdcesighLists: init [[a], [b], [c], [d], [e], [f], [g], [h], [i], [j], ..] connect b to a [[a, b], [], [c], [d], [e], [f], [g], [h], [i], [j], ..] connect a to c [[], [], [c, a, b], [d], [e], [f], [g], [h], [i], [j], ..] connect f to b [[], [], [c, a, b, f], [d], [e], [], [g], [h], [i], [j], ..] connect d to e [[], [], [c, a, b, f], [], [e, d], [], [g], [h], [i], [j], ..] connect c to d [[], [], [], [], [e, d, c, a, b, f], [], [g], [h], [i], [j], ..] connect e to g [[], [], [], [], [], [], [g, e, d, c, a, b, f], [h], [i], [j], ..] connect s to f [[], [], [], [], [], [], [g, e, d, c, a, b, f, s], [h], [i], [j], ..] connect i to h [[], [], [], [], [], [], [g, e, d, c, a, b, f, s], [h, i], [], [j], ..] connect g to i [[], [], [], [], [], [], [], [h, i, g, e, d, c, a, b, f, s], [], [j], ..] connect j to h [[], [], [], [], [], [], [], [], [], [j, h, i, g, e, d, c, a, b, f, s], ..] 
•  » » » » » 2 months ago, # ^ |   0 thanks, thats a really smart method
•  » » » 2 months ago, # ^ |   +1 I used DSU with path compression. I was about to implement union by rank, when I recalled that it's only size 26, which is definitely not worth that much effort. flakes24 it should be enough to just store a parent array or even a map to indicate which character precedes another. Then when you want to make a new mapping, you can simply check all ancestors to make sure this new successor doesn't form a cycle, unless you already have a chain of all 26 letters, so the only remaining relation is to complete the cycle. I didn't actually do this (I used DSU instead), but I think this should still pass the time limit, provided that the rest of your algorithm is efficient enough.
•  » » » » 2 months ago, # ^ |   0 I thought about doing the second method (cycle method also striked but im not that comfortable with graphs yet), but it felt too implementation heavy to check 26 ancestors. But i had about 110 minutes after doing B and should have given it a try atleast. Thanks for the help tho.
•  » » » 2 months ago, # ^ |   0 btw, do u know any good resource to learn dsus in this context?i dont know why youre getting downvoted tho
•  » » » » 2 months ago, # ^ |   -18 I just went to cp-algorithms during the competition for this
•  » » » » » 2 months ago, # ^ | ← Rev. 2 →   0 can you link that particular page / piece of code please
•  » » » » » » 2 months ago, # ^ |   -18
 » 2 months ago, # |   +13 5/10 for problem quality.1/10 for problem description.
 » 2 months ago, # |   0 Solved D 30 seconds before the end of the contest b/c I had thought my sol was incorrect.
 » 2 months ago, # | ← Rev. 2 →   +2 I did not like A at all. I liked B a lot. The hardest about C and D were understanding the problem statements. I am grateful the testcases were good, else I would not have understood anything. The difficulty felt nice, except for A. I think A was too strange, took me 30min to write 1 correct line of code. Solved A, B, C and D
 » 2 months ago, # |   -12 Upvotes on this blog is gonna drop faster than my rating
 » 2 months ago, # |   +8 The problems is really good but the descriptions of these problems are not clear.
 » 2 months ago, # |   +10 got a stroke reading/trying to understand problem C
 » 2 months ago, # |   +11 E is a bit boring, because there are too many details to pay attention to.
 » 2 months ago, # |   +34 In problem B, " You want that for each pair of pieces, their sizes differ strictly less than twice. "Twice of what?In problem C, " each letter in s was replaced with the one that follows in clockwise order ",Follows what in clockwise order? should have been "replaced with one that follows it in circle in clockwise order"
•  » » 2 months ago, # ^ |   +3 Exactly ! Not specified clearly
•  » » 2 months ago, # ^ |   +3 Nice comment!
•  » » 2 months ago, # ^ |   +5 Twice of what? I think it is pretty clear the size of two items differ strictly less than twice means the bigger of the two is less the two times bigger than the smaller. Idk
•  » » » 2 months ago, # ^ |   0 It definitely was not clear. My initial interpretation was that if you compare every possible pair, you would find strictly less than two instances in which the the result was that the elements were different. Of course, this would imply that all elements must be equal unless there are $\leq 2$ elements, so I was very confused at how simple this was, until I saw the test cases. The visual explanation helped clear up my mistake, but it doesn't change the fact that the initial wording was very poor. Thankfully, a clarification was issued shortly at the start, so they at least responded properly to inquiries.
 » 2 months ago, # | ← Rev. 2 →   0 I think C is easy for people who knows graphs (dfs) and can write very hard code
•  » » 2 months ago, # ^ |   +47 I think all questions are easy for people who know how to solve it
•  » » 2 months ago, # ^ |   +9 You don't need graphs and dfs for C
•  » » » 2 months ago, # ^ |   0 Yes, but i don't say that graphs is only solution
•  » » » 2 months ago, # ^ |   +6 Also come on. Stop mentioning dfs as some advanced technique that few people know
•  » » » 2 months ago, # ^ |   0 Yes, a while loop will do.
 » 2 months ago, # |   -11 LOL who was writing problem statements. give him some money so he can write few more lines lol
 » 2 months ago, # |   +4 All the problems were insanely good, and I especially liked C. One of the most balanced + well prepared round I have ever participated in. Congrats to authors!
 » 2 months ago, # |   +41 Problem F is a good problem!
 » 2 months ago, # | ← Rev. 2 →   0 I misread the shit problem statements many times. My entry experience was extremely bad.
 » 2 months ago, # |   +25 Is there anybody else who struggled in understanding problem statements today?
•  » » 2 months ago, # ^ |   0 Unclear statement in B
•  » » 2 months ago, # ^ |   0 I struggled a lot
 » 2 months ago, # |   +35 Very confusing description... Had to guess the meaning based on given test cases for the first few problems :-)
•  » » 2 months ago, # ^ |   +1 Can you specify what exactly was not clear?
•  » » » 2 months ago, # ^ |   +9 Perhaps "very confusing" is a bit over, but I think I do need to carefully look over every word in the description to understand them, while in previous contests just skimming over is enough. For example, "For this reason, all 26 lowercase English letters were arranged in a circle in some order, afterwards, each letter in s was replaced with the one that follows in clockwise order, in that way the string t was obtained." It seems unclear to me what each character in s is replaced with, and I had to go over the TCs to make sure what I am thinking is correct.
 » 2 months ago, # |   0 How to solve D?
•  » » 2 months ago, # ^ | ← Rev. 2 →   0 Ok, this was the first time I solved D, and to do so I broke this problem into different parts, so the first significant observation was no 2 sets can have 2 same cards, as it will force the third card to be same and hence 2 sets to be same. So let's say card 1 was in 6 sets then I can combine any 2 sets and that will be a meta-set, so the total meta-set would be 6C2 (choose any 2 sets among all possible), so, if I am able to find in how many sets each card is in then I can sum all their results (cnt[i]C2). To find a set, for each pair of cards I found out which was the required card so that they form a set (this card will always be unique) and checked if that card existed in our n cards, to do so in log(n) I stored each card in the map. so total time complexity was O(n*n*k*log(n)).
 » 2 months ago, # |   0 I spent the last 20 mins in only reading and understanding problem C and its test cases.
»
2 months ago, # |
-96

# Make it unrated

•  » » 2 months ago, # ^ |   +3 Why? That's all legal. Statements hard to understand but you can understand
•  » » 2 months ago, # ^ |   0 This round must be unrated because we can't understand the problems. So without understanding we can't solve.some people are not good in english so you better use simple words/sentences."their sizes differ strictly less than twice." this is shit.
•  » » » 2 months ago, # ^ |   0 1.Read carefully 2.Watch at examples and notes 3.Use translator
•  » » » 2 months ago, # ^ |   0 I think, your problem isn't "understanding problem"
 » 2 months ago, # | ← Rev. 2 →   +1 How much for a good problem statement, please? ,
•  » » 2 months ago, # ^ |   0 true i was not able to solve problem B because of that
 » 2 months ago, # |   0 why engish in this round so hard to understand qnq
 » 2 months ago, # | ← Rev. 2 →   -6 Is there anyone like me? When I'm confused about a problem statement, my brain is fried and can't think anymore for the rest of the contest.I was super confused about A and D problem statements.
•  » » 2 months ago, # ^ |   0 I spend about 20 minutes in understanding problem A and decided to leave the contest.
•  » » » 2 months ago, # ^ |   +1 I spend around 25 min in finding a approach with wrong submission , It is more logical than B
 » 2 months ago, # |   +3 I quickly found a solution for E, but unfortunately, because i was stuck on C for a long time because of implementation issue, i had no time to implement E. Solved A,B,C,D
 » 2 months ago, # |   0 Solution for D:Firstly,let's find all "sets":Enumerate each pair $(card[i],card[j])$,we can calculate a unique $card[k]$ according to $card[i],card[j]$.Next, we only need to check whether $card[k]$ is in the given cards.Time complexity:$O(n^2k)$.Next, we notice that the intersection of two "sets" has at most one card.$Proof$:assume the intersection of two "sets" has 2 cards $card[i],card[j]$,we can calculate a unique $card[k]$ according to $card[i],card[j]$,which leads to contradiction.For each $card[i]$,suppose it exists in $k[i]$ sets,if $k[i] \geq 2$,we can select two from the $k[i]$ "sets" to form a "meta-set".It can also be proved that all selected "meat-sets" are distinct.So the answer is $\Sigma {C^{k[i]}_{2}}$.
 » 2 months ago, # |   +37 D and E are amazing!D ... All CPer who have played SET must think "From $2$ cards I can identify the last card" at least once, I guess.E ... We must use matching to solve this? Nope.
•  » » 2 months ago, # ^ |   0 Should practice CP problems topicwise or rating-wise?
•  » » 2 months ago, # ^ |   0 rainboy and others tried doing that and most got TLE.
 » 2 months ago, # | ← Rev. 2 →   0 The problems were nice but the description and illustration of test cases.... Omg, I have no words. I'm sorry but last 2-3 rounds were really crappy. Please please improve on making problem statements more clearer.
 » 2 months ago, # |   0 continuously 2nd worse round, i could have done better, is it me who is failing to grasp or problems are getting better in these contests
 » 2 months ago, # |   0 good contest!!!
•  » » 2 months ago, # ^ |   0 6
•  » » » 2 months ago, # ^ |   0 dag wall how eye knee
 » 2 months ago, # |   0 A- took some time, it was was troublesome to find out the general formulaApproach I took: Basically 'n'(now u can't choose n-1 and 1) is already off choose '2'(now u can't choose 3 and 1) as off. now if choose a number 'k' and we move k ahead of 4 and 2*k behind n-2. so we get 4+k=(n-2)-2*k => k=(n-6)/3 from here we find 3rd number= k+4 so we have 3 numbers which are days off: 2, k+4, nnow the difference can be calculated and maximum of all the minimum can be taken :)PS: If somebody had better approach please do share :)
•  » » 2 months ago, # ^ |   0 simple idea i could think of is:- you have to chose 3 points so first subtract these points (so you can calculate the distance from remaining points) now you have to select diff distance so the least distance is 1,2,3 which makes it 6 , so if given num is less then 9 there is no solution also since we have to selcet maximum of min funtion after every 3 addition you can increase your ans by 1( from 1,2,3 your new distance will be 2,3,4). here is my solution :-https://codeforces.com/contest/1735/submission/174379850
•  » » » 2 months ago, # ^ |   0 nice approach :)
 » 2 months ago, # |   +1 Problem description left the chat.
 » 2 months ago, # |   -10 i spent more time understanding problem statements than actually solving them.
 » 2 months ago, # |   +6 CF rounds helping us practice reading comprehension as well. nice.
•  » » 2 months ago, # ^ |   0 yes lol
 » 2 months ago, # |   +2 "their sizes differ strictly less than twice." I bet it'll be fun to solve the "once" version of it. Twice fun in fact.
•  » » 2 months ago, # ^ |   +1 It was a weird way to write the statement ;/
 » 2 months ago, # | ← Rev. 2 →   +4 I solved A by test case №3 i just divided 1033/3 and found genius formula.
 » 2 months ago, # | ← Rev. 3 →   -13 Good overall,
 » 2 months ago, # |   -12 Problem DEnglish version: "A feature for three cards is called good if it is the same for these cards or pairwise distinct."machine translation of Russian version: "For a trio of cards, a characteristic is good if it is the same for all three cards, or all three are different in pairs"Sad that I prefer the machine translation...
 » 2 months ago, # |   0 Can anyone please explain problem C in a clearer way?
•  » » 2 months ago, # ^ | ← Rev. 2 →   +4 in order to get the lexicographically smallest string you should go from left to right and try to map every character by the alphabetical order from a to z,consider it as graph where there is a directed edge from a character to the character it is mapped with, here you should take care of 3 cases 1 — you can't map a character to itself (loop edge)2 — you can't make a cycle of length less than 26 3 — you can't map a character to an already mapped one take a look at my code , i hope i made it clear.
•  » » » 2 months ago, # ^ |   0 where is your code?
•  » » » » 2 months ago, # ^ |   +4
•  » » » 2 months ago, # ^ |   0 Many many thanks for explaining the solution approach, but I was more into problem statement, what actually the problem said?
•  » » » » 2 months ago, # ^ | ← Rev. 2 →   +4 simply you initially have a string s , to obtain the string t you make your own alphabetical order of the 26 letters such that each letter in string s is replaced by the letter the goes next to it in the alphabetical order you just made for example if your s is aqerk and your 26-string order is something like au..qw..er..rz..ko , then your t-string is uwrzo now you have string t , you should output the lexicographically smallest string s which could lead to string t by some mapping order
•  » » » » » 2 months ago, # ^ |   0 Okay, Thank you very much. I think now I get it.
 » 2 months ago, # |   +21 ReadingForces
 » 2 months ago, # |   +1 Very intresting!I tried my best and I think I will get a good result.I really love these problems.
 » 2 months ago, # | ← Rev. 3 →   0 I really enjoyed today's contest. Although some of the problem descriptions werent the best, problem A B and C were very interesting and the pretests were very strong. keep it up!
•  » » 2 months ago, # ^ |   +4 Howard Hamlin of HHM, I sincerely agree to your opinion.
 » 2 months ago, # |   +6 Problem description is like: Go A to B then go C then back to B, again back to A then go C finally print "Helo World".
 » 2 months ago, # |   0 First I thought iam not able to think about A quickly but it seems everyone has same feeling
•  » » 2 months ago, # ^ |   0 I solved B before solving A B was in 0:17 and A was in 1:19
 » 2 months ago, # |   +3 Had a contests filled weekend and I had a great time
 » 2 months ago, # |   0 The questions were really good! Thanks for good questions :) The solutions and proofs were all very beautiful(for the questions I have solved) The problems were generally straightforward My only possible critism is that this round was more about finding ideas....But I really enjoyed it!
 » 2 months ago, # |   0 Anyway, a good contest!
•  » » 2 months ago, # ^ |   +4 Agree with you :)
 » 2 months ago, # | ← Rev. 2 →   0 can someone please help me, where am I going wrong this is solution for B  Arrays.sort(arr); int div = 2*arr[0]-1; for (int i=0; i= 2*arr[0]) { ans += (int)Math.ceil(1.0*arr[i]/div); } } System.out.println(ans); 
•  » » 2 months ago, # ^ |   0 I think you need Math.ceil(1.0*arr[i]/div)-1 instead of Math.ceil(1.0*arr[i]/div) as dividing a number in n pieces will need n-1 operations
•  » » 2 months ago, # ^ | ← Rev. 3 →   0 Note: ans+=(arr[i]+div-1)/div-1; That is math
 » 2 months ago, # |   0 In problem D, I used unordered map to hash from vector of int to int and it took over 1 second to run which is longer than most submissions. Anyone know why?
•  » » 2 months ago, # ^ |   +1 hash function could be slow, there could be hash collision in your hash function, or else there is somewhere else that adds/multiplies to the time complexity.
•  » » » 2 months ago, # ^ |   0 Is there any better data structure to store the value for each card? Because editorial also suggests us to use map/hashmap.
•  » » » » 2 months ago, # ^ |   +1 I think map/hashmap is good enough for the question, but generally I don't recommend you using unordered_map on codeforces, as it could be vulnerable to hacks by deliberately causing hash collisions.
•  » » » » » 2 months ago, # ^ |   0 In the case of problem D, I think it is possible to hash the set without hash collisions using 3**k and long long int; If you used this as an hash value, I think map/hashmap is going to be near to best you can use.
•  » » » » » » 2 months ago, # ^ |   +5 Yeah, I just tried your suggestion and it still took quite long so the problem might be my implementation. Anyway, thanks a lot for detailed explanation.
 » 2 months ago, # |   +1 I would like to thank: "Aleks5d, arzhantsev64, ChthollyNotaSeniorious, DanWallgun, flowerletter, Gegege337, Imakf, LeoRiether, mejiamejia, okwedook, PO3OBAR_Bblnb, SSerxhs, TomiokapEace, triple__a, wabadabakalakaboo for testing the round and giving significant feedback." I see that there are several testers. Do they only verify the accuracy of the judge data or do they proofread the problem descriptions as well?
 » 2 months ago, # |   0 Can Any Body explain the Solution of Problem B
•  » » 2 months ago, # ^ |   0 174391163 if you see my code.I think you can understand this problem.
•  » » 2 months ago, # ^ | ← Rev. 2 →   0 It is no good to divide further the smallest number, as it will always result in more operations caused by having to divide up other numbers further. And therefore, we can transform the question to: given n numbers, make every numbers that are not the smallest number between the range of smallest number/2+1 ~ smallest number*2-1. Dividing each number so that all numbers are between the range will take ceil(number/(smallest number*2-1))-1 operations: and so the answer is the sum of it for all numbers.
•  » » » 2 months ago, # ^ |   0 dhyang24 why you have taken ceil(number/((smallest number*2)-1))-1 rather than ceil(number/(smallest number*2))-1 this
•  » » » » 2 months ago, # ^ |   0 The question states that the biggest number should be strictly smaller than smallest number*2; the maximum number after the division must be (smallest number*2-1)
•  » » » 2 months ago, # ^ |   0 It is guaranteed that if you divide a number in ceil(number/(smallest number*-1))-1 parts, when evenly distribued, it is in the range of smallest number/2+1 ~ smallest number*2 -1
•  » » » » 2 months ago, # ^ |   0 And can you tell why have take -1 after calculating ceil value
•  » » » » » 2 months ago, # ^ |   0 dividing a number into n parts will take (n-1) operations, as each operation increases the total number of parts by 1, and the initial number of parts is 1.
•  » » » » » » 2 months ago, # ^ | ← Rev. 2 →   +3 Ok I got it thanks for giving time to my Queries dhyang24 And Congrats for becoming Candidate Master
 » 2 months ago, # |   0 It was interesting, thanks guys for making this awesome round!!! :-D
 » 2 months ago, # | ← Rev. 2 →   +53 I’m sorry that the English statements are confusing.I tried to make them plane, but it was hard for some sentences.We discussed the places you were confused by and these are the best formulation we eventually came to.I would really like to see your suggestions for replacing them. I still can’t choose good options. I hope that next time I’ll be more careful and precise.I hope you enjoyed the problem ideas after you got through the statements.Anyway, don’t forget to check the editorial and feel free to ask me if there is something unclear there too.
 » 2 months ago, # |   0 Problems have pretty bad wording, otherwise it is fine I think
 » 2 months ago, # |   0 C, it correct when I tested but codef say... 174424830
•  » » 2 months ago, # ^ |   0 I don't understand your approach entirely (it would help if you commented what the different arrays actually meant), but it seems like you're missing the check for when all 26 letters are linked, in which case you would need to link the endpoints to form a cycle. Instead, I think your approach would eventually try to extend beyond the 26 letters and/or try to access an array element that was not initialized, which can lead to different results. As such, even if you saw the correct answer on your own machine, there may be undefined behavior, which can lead to different results in other machines.
•  » » » 2 months ago, # ^ |   0 I want to shorten the array so that only different characters are included, so i use dem[] to count the characters. f[c] is the character before c on the circle, for example a -> c -> d -> e so f['e'] = 'd', f['c'] = 'a',... I use letter 'a' to 'z' (from small to large) to put in the f[] and use chx[] to mark characters that have been used. After put in one, i want to check if the circle is closed (such as d -> a -> b -> d, b -> a -> b,...) or not (if it is, it won't have room for another character and i have to use another character to precede f[s[i]]) It accepted if I use map -> 174737123
 » 2 months ago, # |   -9 I need upvote anyone can help TT.
 » 2 months ago, # | ← Rev. 2 →   0 Finally cyan!!!
 » 2 months ago, # |   0 Got +ve delta. Now waiting for next contest and hoping that I'll be able to Finally change my colour to Green for the very First Time :)
 » 2 months ago, # |   +20 Ratings updated preliminarily. We will remove cheaters and update the ratings again soon!
•  » » 2 months ago, # ^ | ← Rev. 2 →   0 Remove cheaters when? CC: MikeMirzayanov
 » 2 months ago, # |   -26 speedforces
•  » » 2 months ago, # ^ |   -16 not really, at least problems up to C were definitely not the hardest problems (in the corresponding position) I've ever seen. I even thought D might have been worth a try. (though I did lack the ideas for it)
 » 2 months ago, # |   +15 Problem F is very nice, thank you!
 » 2 months ago, # |   0 Congratulations to TOPPERS.
 » 2 months ago, # |   0 In question C: why can't badcfehgjilknmporqtsvuxwzy be the answer for abcdefghijklmnopqrstuvwxyz?
•  » » 2 months ago, # ^ |   0 because you must always get a big loop with length 26. But in your example you have loops: a->b->a, d->c->d and so on
•  » » » 2 months ago, # ^ |   +1 Oh yes....got it. Thanks
•  » » » » 2 months ago, # ^ |   0 You're welcome)
 » 2 months ago, # | ← Rev. 2 →   +13 There is Codeforces Official Channel in Telegram with round announcements. For some reason, all posts get an overwhelming amount of thumbs down. Can we turn the situation around and let hearts win?` 209 hearts and 139 thumbs down at first message, 134 hearts and 137 thumbs down at second, hearts are winning
 » 2 months ago, # |   +1 I like this Score Distribution : 500 — 750 — 1250 so much
 » 2 months ago, # |   0 Had lot of learning and fun. Thank you
 » 2 months ago, # |   +20 I think the problem D should add a tag named Reading Comprehension.
 » 2 months ago, # |   +6 I don't quite understand why there are many difficult questions to read recently, such as the D question, which is difficult to understand, but I can quickly pass after understanding
 » 2 months ago, # |   0 D and E are very nice problems! (especially D in my opinion)
 » 2 months ago, # |   0 Details of the game this round I started playing this game on October 2, 2022 at 11:00 p.m. Beijing time The first question first uses the algorithm of brute force search, times out at the test point, and then obtains a universal law through mathematical calculations The second question is calculated according to the law of the sample at the scale of big data The third idea is obviously greedy, traversing the string, and then judging what the smallest letter can be taken at this position, the key to judging is not to form a ring of length not 26. The fourth question actually has only one situation, that is, c1, c2, c3, c4, c5, c6 in C1, c2, c3 meet the requirements, c1, c4, c5 meet the requirements. The condition that satisfies the requirement is that each dimension mod 3 is 0 after the addition of the three vectors.
 » 2 months ago, # |   +1 can't find my rating; I can still see the score and rank, but not rating, I remember seeing a notification saying that my rating has updated post this contest. Was the contest made unrated or is this something that only I am facing?
•  » » 2 months ago, # ^ |   0 yeah it's saying that I'm unrated on my profile right now, but a few hours after the contest it had shown a rating. It also says that the contest was unrated on my profile.
•  » » » 2 months ago, # ^ |   0 I can see my rating now
 » 2 months ago, # |   0 My solution to A was reported similar to someone else. Now, this is because we happened to use the same code template, which is available online, and the code for A was pretty short and simple. This is a mere coincidence. Why would I plagiarize problem A. Please revert back my rating changes, I have given the contest honestly
 » 2 months ago, # |   0 Why rating not changing ?
 » 2 months ago, # |   0 You are given an array nums consisting of N integers where N is even.You have to perform the following operation N/2 times:Select nums i, nums j from the list Take their bitwise AND, add the value of the least significant set bit to the score Delete those two numbers If the selected numbers are 5=(101)2 and 7=(111)2 then the bitwise AND of the two numbers is 5=(101)2. So, the least significant bit of 4 i.e. 4=(100)4 will be added to the current score.find the maximum score possible
•  » » 2 months ago, # ^ |   0 can anyone help me
 » 5 weeks ago, # |   0 For me, I had difficulties understanding the description of first 3 problems. Specially 3rd one.