![](/style/images/good.png)
![](/style/images/bad.png)
Technocup 2022 — Elimination Round 3 and Codeforces Round #759 (Div. 2)
source link: http://codeforces.com/blog/entry/97795
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Technocup 2022 — Elimination Round 3 and Codeforces Round #759 (Div. 2)
By KAN,
3 days ago,
translation,
Hi all!
This weekend, at Sunday, December 12, 2021 at 15:15UTC we will hold Codeforces Round #759 (Div. 2, based on Technocup 2022 Elimination Round 3). They are based on problems of Technocup 2022 Elimination Round 3 that will be held at the same time.
Technocup is a major olympiad for Russian-speaking high-school students, so if you fall into this category, please register at Technocup website and take part in the Elimination Round.
The Div.2 edition is open and rated. Register and enjoy the contests!
Have fun!
UPD: congratulations to the winners!
Technocup 2022 - Elimination Round 3
Codeforces Round #759 (Div. 2, based on Technocup 2022 Elimination Round 3)
The editorial is published.
![paperclip-16x16.png](http://codeforces.org/s/35922/images/icons/paperclip-16x16.png)
3 days ago, # |
can't wait :)
3 days ago, # |
Wait, why is elim round 2 rated for div1+div2 but elim round 3 only rated for div2 and those div1 contestants that are Russian-speaking students?
-
Because we don't have a good set of problems for div. 1 round this time.
-
Then the official round is unrated for those few 2100+ registrants, right?
-
The Technocup round is rated for all participants.
-
But you don't have a good set of problems for div1 participants. The official round has div1 participants.
-
Maybe it's just unbalanced for Div. 1 participants, but balanced for an elimination round rated for all Russian schoolers.
Just me trying to justify this move. I was also disappointed with the absence of a Div. 1 version.
-
Maybe they don't have hard enough problems to serve all Div 1 contestants (like IGMs and LGMs) but good enough for lower rated Div 1 contestants, which they expect in the official round.
-
-
-
-
3 days ago, # |
if problem statements were this short like this blog!
3 days ago, # |
Hope I can become Candidate Master in after this round
2 days ago, # |
so nitin_05 and ashokesen02 both registered in this round.
- will they cheat again in this round?
- if so, will they not be caught and be rated again?!
- who will cheat better and drain more ratings from other innocent users?!?
2 days ago, # |
Contest extended by 5 minutes. Is everything ok?
2 days ago, # |
hope I do better....
2 days ago, # |
+5 minutes. Might be a signal that I should not attempt this round if I don't want to drop down to Expert!!!
-
Don't worry so much about rating. Focus on learning
2 days ago, # |
I think the additional 5 min delay is to apply/fix the rating changes of the last round.
2 days ago, # |
Why delayed by 5 mins!
2 days ago, # |
Why start time was changed suddenly?
Will this be the first contest without the score distribution known in advance? :O
2 days ago, # |
Hope to increase my rating by 50 pts
-
Using Inspect in you browser!!!
-
By that I can virtually become grandmaster in just 5min!!
-
Well you want exact 50 else you can get +50 easily by solving 2 problems very fast IMO.
-
-
2 days ago, # |
Are there queue issues?
2 days ago, # |
another 5 minutes...
2 days ago, # |
Oooh ! Another 5 minutes delay !
2 days ago, # |
Not A good sign of a Good Contest !!!
2 days ago, # |
delayforces
2 days ago, # |
What's going on ?? delayed by 5 mins again.
2 days ago, # |
Double delayed!
2 days ago, # |
Late OP >_<
2 days ago, # |
!!Another 5 minutes delay.....
2 days ago, # |
why is it constantly delaying?
2 days ago, # |
+5 again, hope this round will be smooth.
2 days ago, # |
Why delayed again?
2 days ago, # |
the problems stuck in 5 minute-less loop
2 days ago, # |
Delayforces!
2 days ago, # |
Oh,delay again.
2 days ago, # |
how many selection rounds for techocup gonna be?
2 days ago, # |
we are about to get some fun
2 days ago, # |
I have a joke on codeforces but I'll say it after 5 mins.
will codeforces catch them as cheaters or not ? I think the answer is NO.
-
I also want to report this. Is there a person manipulating different accounts in the contest? This should also be considered cheating. And since these accounts are newbies, it will make others rating drops much since you will be considered "defeated" by a bunch of newbies if these cheaters are not removed.
UPD: They finally appear on official ranking 22-26, 28-39 (except two CM and one expert)
2 days ago, # |
Solution of F : ARC 115 E
-
Yeah, got first solve on F because of this. lol
-
Is the round going to be canceled?
-
There are several duplicated problems in the past, but they never made a round unrated because of duplication. So I think it's still rated. (Though, I think it should be unrated in my opinion. I didn't like free rating like this very much.)
-
-
2 days ago, # |
My E has encountered memory problems when in my opinion there is no real improvement to do. Are others in this case?
2 days ago, # |
How to solve C?
-
WLOG, if a1,a2,…,an is the sorted sequence of positive coordinates, the goal is to try to minimize the number of times you go back to the origin from the later coordinates in the sequence; since the coordinates are increasing, it would be less expensive to go back to the origin from somewhere at the beginning than to do it from somewhere at the end. As an example, let the sequence be 1,2,3, and k=2. If you choose to collect the first two items followed by collecting the last item, it will cost you 2+2+3=7. But, if you choose to collect the first item followed by the second two, it will cost you 1+1+3=5. You can see how it was more optimal to go back from 1 to the origin than to go back from 2 to the origin.
2 days ago, # |
A strange thing happened to me, this solution to problem C gave RunTime Error on Pretest 1 but, on local ide it gave correct output and when I submitted it to C++ version 14 instead of 17, pretests passed!
-
somebody please help. why this is giving RTE?.link
-
A bit wierd. Now technically integer overflow is undefined behavious as it happens in line "for (int i = sz(pos) — 1; i >= 0; i -= k)" when size of pos is zero (size is a unsigned int), however most of the time it works fine.
Anycase it is a bad idea to rely on undefined behavious. I just typecasted it to signed and it worked fine. https://codeforces.com/contest/1591/submission/139012140
-
-
It has undefined behaviour in line "ll x=a.size()-1, y=b.size()-1;". When a.size()=0 or b.size()=0.
-
Shouldn't x or y be simply -1 in that case and the control shifts to the next line? Or, am I missing something?
-
Well a.size() returns unsigned int 0. When you subtract 1 from it, it overflows which then is assigned to x. Hence a undefined behaviour (overflow). Most of times it evaluates to -1 but i guess undefined behaviour is called undefined for a reason.
-
-
2 days ago, # |
What is the approach to solve problem C??
-
For me C was horrible implementation problem, I fiddled like an hour on it.
Actually it is not so complecated. First observe that left and right side are independent of each other, each can be solved separate.
Then consider blocks of k elements, starting with the outermost (the longest distance) elements. For each block we need to walk the distance to the max one, and most likely back.
Do this for both sides. Then, after end, we can remove the one distance we not need to go back, that is max(abs(a[min]),a[max]). i.e. we go to the farthest element last, so can subtract that distance in the end.
2 days ago, # |
Too little time limit in task E. Please raise the time limit in task E up to 8-10 seconds.
This F question is as like as two peas ARC115E. It's really speechless!!!
2 days ago, # |
How to solve D ?
-
The cases where
n = 1
andn = 2
are trivial.Let's suppose
n >= 3
and all elements are distinct. We can notice that by using a 3-cycle, the parity of the number of inversions in our vector remains the same. So, if all the elements are distinct, then we only have to check whether we have an even or odd number of inversions in our array.If there are at least 2 equal elements, then we can use them to put all other elements in their place, so the answer is YES everytime in this case.
-
How do you define "inversion"?
-
An inversion is a pair of indices
(i, j)
such thati < j
anda[i] > a[j]
-
Maybe apply coordinate compression and use fenwick tree or segment tree to count number of inversions?
-
Applying merge sort you can easily count inversions.submission
-
-
-
-
I did with counting inversion, such a triple swap of three distinct elements changes the inversion count by 0 or 2.
Also the array can be pre sorted. And if the array includes any element twice, then it is allways sortable because we can use the double element to simply swap elements.
-
Case 1: There are no duplicate values. In that case, we can decompose the permutation into cycles where i→a[i]. After playing around with some cases on paper, you'll find that we can perform the following operations:
- Merge two cycles of size A and B into a single cycle of size A+B−1, or split one cycle into two.
- Merge three cycles of size A,B,C into a single cycle of size A+B+C, or split one cycle into three.
- Increase of decrease the size of a cycle by 2.
An array can be sorted if it can be split into cycles of size 1.
So now we decompose the array into cycles, merge the cycles, and the answer is YES if the size of the resulting cycle is odd.
Case 2: There is a duplicate value. In that case, it's always possible. Say the value x appears twice in the array. For the case where all our cycles merge into a cycle of even size, we can reduce the cycle to size 2, then shift the cycle to one between two values (x,y), then fix that swap with the help of the second x.
-
The implementation can be even simpler. In Case 1 we can show that the permutation can be sorted if and only if the number of even cycles is even. We just run dfs and find the number of even cycles.
-
I think that's around the same implementation difficulty as mine, because when I say "merge cycles," I just mean "add up their sizes."
-
-
I solved D without using the ideas of inversions. First, for the case with duplicates, we can see that we can use any two of the same number and "move" a third number into sorted order.
So, for the case without duplicates, the array will be a permutation. The sorted array will have a[i]=i for all i. Instead of using inversions, I tried, for every i, to swap i into position i. If after all swaps the array is sorted, the answer is YES and otherwise NO.
To swap i into position i, assume number i is at position x (x≠i). Then, if x≠n we can select the positions i, x, and n to move i to position i. If x=n, we can use position n−1 instead. This works because we only care if number i is at position i, so we can arbitrarily use the last position to be our third number. All we have to do is keep track of the positions of each number when performing our operations and lastly check if the a[i]=i for all 1≤i≤n.
2 days ago, # |
Hi, Can anyone help me here in this code? https://codeforces.com/contest/1591/submission/138922945 This one gives me WA in 2nd tc but it runs perfectly in my local.
Finally managed to solve two questions for the first time.
Edit: FST :( on B
I stupidly printed 1 instead of 0 if the last element was max (when not sorted), surprised the pretest didn't cover it, oh well, I will try to solve 2 or more next time :).
2 days ago, # |
The more famous Codeforces will be, the more cheaters will be there.
2 days ago, # |
How did you guys solve problem B?
I figured out that the array stops changing when we have a[n] = max(a1, ..., an), but could not continue from there.
2 days ago, # |
Can someone who found the similar problem to F during the contest please tell how did they go about searching it?
-
The comment is hidden because of too negative feedback, click here to view it
-
By seeing the number of solves, some very fast solves and the simplicity of the statement I also figured that there's a very good chance that a similar problem may have existed. I was just curious if someone who hadn't solved that atcoder problem was able to find it and if yes how?
-
-
I thought I remembered it from an Atcoder contest so I searched the 50 most recent ABC's and then went through ARC's until I found it.
2 days ago, # |
I "solved" B by going over the problems but it was too slow on pretest 5. Was there any way to make it faster? Was it just a "recursive" problem until the biggerThanX arrays length is 0?
-
The expected solution has a complexity of O(N).
Just iterate over the array from the last position, and whenever you encounter an element greater than the current max, increment a counter and update the current max.
If the array is already sorted in asc. order, the counter's final value will be 0.
Problem E is really good, it can be solve in O(n log n).
The ideia is really similar to this old one from Codeforces, besides the MO and stuff:
https://codeforces.com/contest/375/problem/D
PS: finally coded it right, here it is: https://codeforces.com/contest/1591/submission/139023972
2 days ago, # |
Problem B : In the 2nd test Case [1,3,2,4,5], why not we pick "2" and then [1, 2, 3, 4, 5] ?
2 days ago, # |
I can't believe that none of the testers has solved ARC 115E
2 days ago, # |
Why do you set problemF without changing any words? Maybe your purpose is to find the participants who have solved thisARC115E-LEQ and NEQ?
I mean this round should be unrated. It's a big mistake.
2 days ago, # |
I'm confused about the decision to make n≤106 in problem E. DFS with recursion depth 106 is quite dicey, and if you look in the accepted submissions list almost every submission runs in at least half, if not almost all of the time limit.
-
The intended complexity of solution is O(n+q). This was an attempt to cut off O((n+q)⋅log(n)) solutions with big constant.
Unfortunately, I wasn't allowed to decreases TL any further. As I see it, recursion and input takes most of the time in linear solution, so decreasing TL to 3s wouldn't change anything for them independently from implementation. But it could have cut off some solutions with __gnu_pbds::tree or segment tree.
-
Yeah, unfortunately it's practically impossible to distinguish O(n) from O(nlogn) in the world of CP. I think the best course of action in this case would be to either give up and let O(nlogn) pass, or try to modify the problem in some way such that the O(nlogn) solution doesn't work. Trying to force O(n) with a strict time limit is almost guaranteed to cause negative feedback.
-
2 days ago, # |
Why is the time limit for problem E so tight? What solution are you trying to kill?
-
The comment is hidden because of too negative feedback, click here to view it
-
I think trying to distinguish O(n) vs. O(nlogn) is a terrible idea here (and usually is in general). Both I/O and DFS have a comparable runtime to nlogn algorithms in practice.
-
The comment is hidden because of too negative feedback, click here to view it
-
-
2 days ago, # |
can someone explain solution of problem c?
-
Lets solve the problem separately for elements with xi < 0 and elements with xi > 0.
Notice that if number of elements, that are for example more than zero(lets denote them as R), is divisible by k, we can get optimal answer by going firstly to closest 1...k elements, than to k+1...2k, and so on.
So, we can firstly take R%k elements, return back, and R-R%k elements that will left can be taken using greedy approach that I have described. Solve it independently for two types of elements(smaller and greater than zero) and subtract maximal abs(xi). I hope i have explained clear enough, sorry for my english :). If you have any questions I can send my code.
-
I understood the coding part 138928969 , but still lack clarity in the whole idea.
I want to make sure that some idea from this problem sticks to my knowledge tree, so that it becomes transferrable to other problems. I want it to have an impact on how I will think of other problems in the future, but so far I didn't manage to extract anything generalizable.My best attemt is a two-part summary:
1. Try to ignore one part of the solution (probably they are symmetric).
2. Try to split the space into k parts.But I doubt that this summary is a useful insight that will stick with me and will help me solve other problems. There has to be a clearer picture or some other useful abstraction :)
-
-
This contest was even worse than the previous contest. If the solutions to problem D and problem F are already out then it's just the sport of Googling, not a mind sport. Why do problem setters even try to copy the same problem? It's not just a coincidence that the problem setter in atcoder (problem F) and in Kattis will form exactly the same question.
2 days ago, # |
In the problem E, setters want to kill set's log isn't it?
My solution without set passed in 1871ms
2 days ago, # |
Number of successful submissions in F are far more larger than those in E.
2 days ago, # |
Is this contest rated??
2 days ago, # |
What's the solution for F?
2 days ago, # |
Did expected solution for F require inclusion exclusion?
2 days ago, # |
The explanation of example test case 1 in Problem B has something wrong. In the explanation, it's said: The first eversion: a = [1, 4, 2, 5, 3]. But in fact, a = [2, 4, 1, 5, 3]. The explanation troubled me a lot and made great influence.
2 days ago, # |
2 days ago, # |
People who saw problem F before on AtCoder, Problem
-
At least three (F,D,C) out of six problems are literally stolen from older contests lmao
-
Yeah C was also like I have seen it somewhere. But coded once again on my own instead of finding. Can you please post the link from where problem C was copied?
-
https://po.kattis.com/problems/biblioteket I had solved from here before, but this site is for old Swedish olympiads so you probably solved somewhere else if you're not swedish.
-
-
I don't understand what's wrong with my solution for D using segment tree.
https://codeforces.com/contest/1591/submission/138912355
Can someone point out mistake.
-
Looks like problem was integer overflow somewhere. Submitting same code by replacing int with long long int everywhere passed.
2 days ago, # |
The problemset was great and beginer friendly.. I'm thankful.. :)
I didn't like the round. Coding segment tree for D, coding treap for E, coding compressed segment tree for F... It was too much of binary balanced trees. However, one friend of mine told me that I could have used __gnu_pbds::ordered_set for D and E. Also, I am glad to hear that the intended solution for E is linear.
UPD: Well, it seems that F also have linear solution. Then... OK, I just have chosen bad ways to solve the problems.
-
D, E also have linear solutions without any binary trees too)
-
Really, you can count inversions in O(n)? I have believed that the two ways for it are merge sort and segment tree, both are O(nlogn)
-
I can count parity of number of inversions in permutation in O(n).
Iterate through permutation from right to left. Maintain inverse permuation along the way. Each time you look at ai≠i you swap ai and aa−1i and change the parity.
-
Cheating reported. Official ranking of 28-39 (expect two purple users) are all have same code.
UPD: So as 22-26 (except 24)
2 days ago, # |
Because many people solved the last problem, I was convinced that it's easy and I spent all the time working on it, Didn't even think about doing D lol. All this because people just copied solution from some Atcoder submisson. It happens, whatever.
2 days ago, # |
another <0 rated blog lol
Am I the only one who got D correct but missed the fact that there could be repeated numbers ? :'(
Spent entire contest trying to figure what's wrong.
2 days ago, # |
Problem F : Non-equal Neighbours is repeated from past atcoder contest:(
the source :
2 days ago, # |
Next time give links to the sources where you have copied the problems from, why put in so much work? At least it won’t be unfair for those who don’t use google during contests.
2 days ago, # |
A great contest with completely original problems and reasonable time limits.
It provides great experience and shows how dumb I am.
12 out of 10, would absolutely lose my ratings again.
Sorry for the italics, but this is not the best contest I've ever had :(
I thought F was easy when I saw a lot of people solved F and wasted some time on it.
Plz check again with your tasks to see if there's any existing problem that has a similar solution.
At least change the statements a bit more if you intended to add these problems...
One more contest being downvoted a lot.
Have fun!
Almost everybody: It's not funny
2 days ago, # |
This contest deserved downvotes. Last one didn't.
2 days ago, # |
Seeing 8 people from Japan in the top 10, I should have known to look for F on AtCoder...
2 days ago, # |
How to solve D?
2 days ago, # |
F for F in the chat
2 days ago, # |
Make it unrated, it’s unfair for those who didn’t search the problems on the web.
-
There had been many instances where problems were directly copied from some other contests. But all of them were rated, as it's not discouraged or penalized by MikeMiryayarnov. So, the contest will be rated.
Codeforces Round #759 (Div. 2, based on Googling 2022 Elimination Round 3) much better
-
If you have to give such a name then replace Atcoder with Kattis as 2 problems were copied from there. You can replace Atcoder with Googling as well :)
-
I think the problems were not copied (most probably, the authors didn't even know the existence of those problems). Unfortunately, the probability of coming up with an already used problem is quite high. I invented at least 6 problems that turned out to be already on the Internet.
2 days ago, # |
KAN getting all the negative contribution of down votes although he is neither among authors nor testers.
2 days ago, # |
Hi, so to me seems like a notorious coincidence.
41 hour(s) ago, # |
The author wants to filter out O(nlogn) solution in E, but I got AC with O(nlognlogn) (query fenwick tree in binary search checking function)... I don't think a O(nlogn) solution is bad even if there exists linear solution.
38 hours ago, # |
Why the problem E are difficult to solve in O(nlogn)? I have done it for half a noon!
31 hour(s) ago, # |
This contest:
30 hours ago, # |
i don't know where to clarify, so i post here yeah...
why i got rank 83 in these publish rating changes.
but my actual rank 74 (handle:Son) in common standing ??
Why is rating relapsed? Recalculation? EDIT 3: it keeps on relapsing and fixing itself... strange.
26 hours ago, # |
Please increase the TL for E in practice at least by a few seconds. Non-standard IO optimisation shouldn't be the difference between AC and TLE.
This morning (GMT +7), I get a message from the system that my submission: https://codeforces.com/contest/1591/submission/138915027 for E is the same as some https://codeforces.com/contest/1591/submission/138907536, but actually I don't even know who this guy is, and after using a pbds, this problem is very easy to implement, and it seems like we have 0% of chance to share code with others and I don't see any reason to skip my contest this time.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK