Блог пользователя tibinyte2006

Автор tibinyte2006, 3 года назад, По-английски

Hello, Codeforces! Or, as we like to say in Romania: Sus Sus Sus, ca la Strehaia tată!

I am glad to finally invite you to participate in Codeforces Round 875 (Div. 1) and Codeforces Round 875 (Div. 2), which will start on May/28/2023 17:35 (Moscow time). In both divisions, you will be given 6 problems and 2 hours and 30 minutes to solve them.

The problems were authored and prepared by Andrei_ierdnA, Doru, Gheal, IacobTudor, LucaLucaM, RedstoneGamer22, SlavicG, Sochu, alecs, andrei_boaca, anpaio, lucaperju, cadmiumky and me ( tibinyte ).

I would like to thank:

  • irkstepanov for further help with logistics of organization.
  • freak93 for no morning refreshment.

Scoring Distribution

  • div 2: $$$500-750-1250-1750-2500-3000$$$

  • div 1: $$$500-1000-1750-2250-3000-3500$$$

The editorial has been published here!

And here are our winners!

# Div 1 Div 2
1 Ormlis kotrin
2 squareOf105 CLOCKS_PER_SEC
3 dorijanlendvaj IHatePaiu
4 tourist Lihwy
5 Radewoosh VietCek
  • Проголосовать: нравится
  • +575
  • Проголосовать: не нравится

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +32 Проголосовать: не нравится

As a non-newbie, I miss being newbie :(

»
3 года назад, скрыть # |
 
Проголосовать: нравится +65 Проголосовать: не нравится

As an average tester, I average tested.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

As a bad tester,I tested like good tester.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

didn’t Mike say you can’t put the wrong colors for usernames?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +43 Проголосовать: не нравится

sus

»
3 года назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

As a setter, I didn't test.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +47 Проголосовать: не нравится

I am a simple man: i see pepe the frog, i upvote the blog

»
3 года назад, скрыть # |
 
Проголосовать: нравится +96 Проголосовать: не нравится

Why so few authors? What happened to the rest?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +33 Проголосовать: не нравится

Wasn't everyone's name colored grey initially? What happened?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

Only 14 authors :D

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -180 Проголосовать: не нравится

Kind request to question setter. Please try to keep,

1) questions are balanced,

2) different topics ( rather than one single topic ),

3) cover largest input and longest run time test cases and yet keep one or two edges cases so contest could be fun with hacks.

4) give clear explanation for the example test cases.

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -51 Проголосовать: не нравится

The contest clashes with the leetcode biweekly contest 105. Please do something about the timing :)

Update

As I can see my comment has initiated a spread of hate towards a certain platform in the thread, I would like to clarify that we live in a world of free will, thus anyone can opt to give either of the two contests according to their preference. I'd myself choose the codeforces contest due to the better quality of questions. My comment was only intended to make the round makers aware of a clash between the two contests and nothing else. Finally to everyone, who blindly downvoted my comment due to their specific hate for a platform just shows their herd mentality. Rest I hope for everyone to have a great performance in the contest.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +28 Проголосовать: не нравится

As grey. I hope be specialist next round uWu

»
3 года назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

As a participant, I like participating.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

leetcode biweekly + div2 both tomorrow. But everyone gonna choose div2...

»
3 года назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

omg grey round!

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

longest duration contest 2:30 hr.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

Wow! A negative-rated author! Hopefully, enjoy this round (❁´◡`❁)

»
3 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

As a contestant, i am waiting...

»
3 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

What is "Scoring Distribution: TBD"?

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Good Luck for everyone

»
3 года назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

vuw

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Sniff sniff, i smell AmOnGuS!!!

»
3 года назад, скрыть # |
 
Проголосовать: нравится -16 Проголосовать: не нравится

Is this Div2 rated for participants with rating < 2100 ?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится

damn where scoring distribution? is it soo hard to publish it at least 1 day before the round? why almost nobody does that now...

»
3 года назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Always welcome weekend rounds :) First rated contest for me in a long time.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

good luck everybody!!!

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Timing clashing with Leetcode Contest :(

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +54 Проголосовать: не нравится

who let a negative rated guy set problems 😡

»
3 года назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

Is this round is rated?

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Good luck everyone!

»
3 года назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

I hoep everyone will get good marks in this contest. Good luck!

»
3 года назад, скрыть # |
 
Проголосовать: нравится -137 Проголосовать: не нравится

MikeMirzayanov please postpone this contest , today is IPL final , Probably dhoni would be playing for the last time today and everyone wants to see him. Please Postpone the contest Gheal

»
3 года назад, скрыть # |
 
Проголосовать: нравится -25 Проголосовать: не нравится

RescheduleForces!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

(()def()r(es??again?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Please, if the round is postponed also this time, try to tell it earlier

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I'm crossing my fingers and toes, hoping I don't plummet from my precious blue rank in today's game. It's a delicate balance, you see—I'm teetering at a hilariously precise 1601 points. Wish me luck!

»
3 года назад, скрыть # |
 
Проголосовать: нравится -45 Проголосовать: не нравится

CSK match >>>> CF contest :) feeling sad because not going to participate in this round

»
3 года назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

I was registered for the contest when I was an expert. But I just noticed that I am a candidate master, but registered for div2. I think it would be better if the system would inform you about this.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Just as former world champion Magnus Carlsen won the recent chess tournament and came back again at the top, tourist(Gennady) should also try to get his first position back today :)

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

+76 is needed for CM. is it possible??

»
3 года назад, скрыть # |
 
Проголосовать: нравится -16 Проголосовать: не нравится

Problem B is s*ck

»
3 года назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится

FSTs loading...

»
3 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

nice round,but i forgot something and got lot of wrong:(

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +63 Проголосовать: не нравится

Really dissapointed by B problem (Div. 1). There is 4 sec TL, and my $$$\mathcal{O}(n\sqrt{n})$$$ solution with hashmap doesn't pass. I tried to optimize it many times, using fast hashmaps, different pragmas and other methods.

Judging by standings I can conclude that I'm not the only one with this problem. But some people have achieved +5/+10/+20, others not.

TL 4 sec implies that $$$2 \cdot 10^5 \cdot 650 \cdot [hashmap time] = 1.3 \cdot 10^8 \cdot [hashmap time]$$$ will pass!

If author's solution has another complexity TL must be 1sec. If author's solution is just 2 times faster for example you can't ban people with $$$\mathcal{O}(n\sqrt{n})$$$ solution — this is not Codeforces politics.

So, AB were good tasks, C was interesting too, but I just waste all time to speed up B, it was terrible round.

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

Decided to optimize D at the last second(after 1hr of being indecisive XD), it changed runtime from 3700 ms -> 1700 ms. But idk if it's actually just weak tests. Try hacking it 207664263. This problem would probably have many TLEs.

UPD: Turns out the initial 3.7s solution TLEd, but this one still passes in 1.7s

»
3 года назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

How to solve B div1/ D div2?

»
3 года назад, скрыть # |
 
Проголосовать: нравится -10 Проголосовать: не нравится

For the problem C do we have to use DFS? If anyone have use DFS to solve please can you share submission link.

»
3 года назад, скрыть # |
Rev. 3  
Проголосовать: нравится +26 Проголосовать: не нравится

div1 B too easy to come up with a solution but constraints too bad, it spoiled the contest for many people. Almost solved d1C, i think, could smb please write the solution? wanna check if mine is correct

  • »
    »
    3 года назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    I am not sure about B constraints, I wrote the first thing which came to my mind and it passed in 2.1s. It's not optimal, surely it can be easily optimized to 1.5s and probably to <1s with some effort. But tbh I am not completely sure it will pass systests, I did not prove complexity. Upd: passed systests in 2.1s

    Regarding C, I did not solve it but I think one of the important insights is that any 2 intersecting (but not nested) segments [A;B] and [C;D] can be replaced with 3 non-intersecting segments [A;C) [C;B] and (B;D]. Then we can somehow remove all intersecting segments and solve a much easier subtask where segments can be only nested (build a tree from them).

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится +3 Проголосовать: не нравится

    Yea I'm kinda bummed out because for d2D/d1B I had a java solution early on that got TLE, and I tried a lot of things but just couldn't get it under the TL. Then I converted the same code into c++ (which I barely know) and it passed, but by then I already wasted 1+ hours.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Great Contest! If you are stuck on Problem A, Problem B, Problem C (Div2) then this editorial might be helpful: link

»
3 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

how to solve D?

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    idk

  • »
    »
    3 года назад, скрыть # ^ |
    Rev. 7  
    Проголосовать: нравится +17 Проголосовать: не нравится

    you need to use the fact that the values of a[i] and b[i] are less than "N".

    So, for each pair (a[i],b[i]), we have to traverse till sqrt(N) at max, and see if the reverse pair exists or not.

    first of all, shard the pairs(a[i],b[i]) based on the first value (a[i]). Also sort each shard for applying faster search operation using binary_search.

    We also need to keep track that how many times particular pair has been encountered in past, to do so we need a map < pair <int, int > , int > where map[(x,y)] denotes, how many times particular pair (x,y) has been encountered yet.

    for(int i = 0 ; i < n ; i++) {
       shard[a[i]].push_back(b[i])
    }
    for(int i = 1 ; i <= n ; i++) { // sort each shards
       sort(shard[i].begin(),shard[i].end())
    }
    // suppose shard pairs are (1,2),(1,3),(2,3),(2,1),(4,8),(4,12),(4,4)
    // shard[1] = { 2 , 3 }
    // shard[2] = { 1 , 3 }
    // shard[3] = { empty , because no pair has a[i] == 3 }
    // shard [4] = { 4 , 8 , 12 }
    // Hope part 1 is clear...
    

    Core logic part is here now, suppose (a[i] , b[i]) and (a[j] , b[j]) are expected pair, then we will a[i] * a[j] - b[i] = b[j] , for better understanding I will use (x,y) and (p,q) instead of (a[i],b[i]) and (a[j],b[j]) from now on. so, (x*p — y == q) must hold in order to count the pairs.

    if shard[x] has value 'y' in it, that means, we have a pair (x , y) somewhere. Now, any pair (x , y) and (p, q) to be in the answer, we must make sure that x * p <= 2*n, otherwise answer is never possible ( because of the restriction that 1 <= y <= n && 1 <= q <= n,,, their sum will be 2 <= y + q <= 2*n. ) , that's why x * p must be less than 2 * n ;

    So, now using above facts, please go through code,


    for(int i = 1 ; i <= n ; i++) { for(int j = 0 ; j < shard[i].size(); j++) { int x = i; int y = shard[i][j]; // now assume that p is 1,2,3... until p * x <= 2 * n; for(int k = 1 ; k <= n ; k++) { if( x * p > 2 * n ) break; // here answer is never possible, // Now, try to find in shard[k], whether the value x*p - y is available or not // to do so, we can use binary_search, or set, or lower_bound() or anything auto it = lower_bound(shard[k].begin(),shard[k].end(),x*p-y); if(it != shard[k].end() && *it == x*p-y) { // Condition to see if the x*p-y is present or not // if the current value is present, then we have to add it number of times it has been encountered till now, ans += map[(x,y)] } } // once we have processed a pair (x,y), // we also have to add it to our map of encountered pairs map[(x,y)]++; } } // finally return ans, dont forget to initialise it with 0 by the time declaring it. :) . } Final complexity is O (N log N) + O(N * sqrt(N) * log N) in my case of implementation. With unordered maps and more further optimisations u could reduce log N factor to O(1) in the second part. but that's unnecessary to get AC.
»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +9 Проголосовать: не нравится

Edit: Oops, forgot checking by [] creates the element if it isn't already present. These unnecesary inserts and increase in query time due to map size probably leads to a 2-3x increase in running time leading to TLE.

Does gp_hash_table really use $$$\gt 500MB$$$ to store $$$2 \times 10^5$$$ elements????

gp_hash_table to store pairs (207666127) -> MLE

binary search on vector of deduplicated pairs (207666127) -> AC with 10KB memory usage

Also is there a faster than $$$O(n \sqrt n \log(n))$$$ solution to Div2D / Div1B? I spent like 1 hour optimizing it to remove TLE and then MLE T_T.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I do think there's no need to set the memory limit to 256MB instead of 1024MB. It is trivial to optimize the memory of knapsack on tree to $$$O(n)$$$ my storing the dp values into the return value of dfs.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What is second test case for D?

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Is it possible to solve F by SMAWK + persistent segment tree?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Confusing Round. C is a good problem.But B is just a Trash.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +22 Проголосовать: не нравится

Had the new idea in the last 15 minutes. My heart can't handle this.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve div2 C?

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +12 Проголосовать: не нравится

Judging by the number of people upset over Div2 D(Div1 B), I doubt the editorial would be satisfying(though I expect to learn something different/new). Still would love to know any approach that worked for you guys. Was stuck on this problem for 2 hours :(

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    My approach was to split everything into buckets by A. Then we need to iterate through small buckets (A <= sqrt(MAX*2)) in an outer loop because otherwise, a*a will be too large and iterate through all buckets in an inner loop.

    At each iteration, calculate the answer for pair of buckets. To do it efficiently, sort elements in buckets, and use the smaller (by the number of elements) bucket as a needle and the larger as a haystack, do a binary search to find the number of matching elements.

    Also, we need to match every A <= sqrt(MAX*2) bucket with itself but it is fast so can be done in a variety of ways.

    I think my submission 207627709 is pretty clear but I am not sure if it was the supposed solution. Passed in 2.1s, probably could be optimized to 1s.

    • »
      »
      »
      3 года назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      I thought about the exact same optimization during the contest but wasted too much time trying to prove its worst-case time complexity. Here is my submission 207739872 after the contest. I still haven't figured the time complexity part yet. Do you (or someone else) have any insights?

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Don't know why but I thought that there will be edge from u to v and not from v to u and treated the graph like a directed graph which resulted in a bad contest

»
3 года назад, скрыть # |
Rev. 4  
Проголосовать: нравится +63 Проголосовать: не нравится

This is the moment that I am very nervous about system testing. I solved problem div1 C in the last minute. If any of the div1 B and C passed, I will reach master! Please, don't FST, don't FST, don't FST.

ranking

UPD: I passed B, and I will reach master.

UPD again: Yes !! I passed C. In my estimation, problem 1C problem have a difficulty of at least 2300, and this problem will be the highest rating problem I have ever solved in contest.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

Seems that many people passed pretests on D with 500MB of memory (me included). Could it have been a good idea to increase the memory limit to 1024MB instead?

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

for me , problems C<A<<<<<<<<B

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +99 Проголосовать: не нравится

Yeah, solved 1830B - The BOSS Can Count Pairs in $$$O(n^2)$$$. Solution

»
3 года назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

For problem D, I am having difficulty thinking of a solution with less than O(n^2) time complexity. How should I approach this? For the entire duration, I was thinking of leveraging the fact that the sum of two elements can be at most 2*n and was not able to think of anything else. So far, I have only seen people using fancy data structures which I have never heard of.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Might cross 1700 today for the first time in my CF journey 💙. I'm lucky that the contest was rescheduled because my internet connection was terrible yesterday.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

please guide for B div 2

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    suppose a[] = [_ _ _ _ x x x x _ __ _ _ ] b[] = [_ _ x x x _ _ _ ]

    You need max length subarray of equal elements

    for this you need a subarray from (array a) and a subarray of same element from (array b) and concatination of both will contribute to ans

    at last ans will be max of both subarray length

    fr(i , n) { lli val = v[i]; lli cm = 1; lli j = i + 1; while(j < n and v[j] == val) { cm++; j++; } i = j — 1;

    temp1[val] = max(cm , temp1[val]);       
    }

    // storing subarray of equal element size in temp array at particular index of that element

    // same for both array a and b at last finding max of both size

    lli ans = -1; fr( i , n + n + 1) { ans = max(ans , temp1[i] + temp2[i]); }

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

GreatForces

»
3 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

C was fun.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to approach problem 1831C - Copil Copac Draws Trees ?. Got TLE while solving using Queue 207622849. Couldn't figure out why it is getting TLE.

»
3 года назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

for today B problem i am understanding something wrong

  1. 1 1 1 1 3 2 2 2 2 — -
  2. 2 2 2 2 3 1 1 1 1-- for this i have checked output of users you have system test passed as ans 8 but which merging will lead to 8 as a answer. I am not getting. Maybe i am understanding something wrong.
»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Does the third question of div2 requires some knowledge of tree or it can be solved normally wihtout trees,as soon as i saw tree in the problem statement i left

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится +8 Проголосовать: не нравится

    Things you should know about tree to solve Div2C:

    • tree contains $$$n-1$$$ edges, where $$$n$$$ is the number of vertices
    • tree is connected graph without cycles
    • there exists exactly one path from some vertex $$$v$$$ to some vertex $$$u$$$
»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Missed the contest but my ratting saved from going down :p

»
3 года назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Great Contest, learnt something new in BFS 1831C - Copil Copac Draws Trees

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Problem C — BFS-like solution:

I keep 3 sets: written, processed and current_edges.

written: Nodes that are written at the moment, but not fully processed

processed: Nodes that are fully processed.

current_edges: edges that are going to be processed.

Also, per each node, I keep a set of edge pointers.

  • At the beginning of the solution, add 1 to written set.

  • While there are nodes to be processed, keep processing (processed.size() < n)

  • For each node in written set, get all the edges where this node is part of, and insert them into current_edges set.
  • For each edge in current_edges set, get both nodes (one of them is alredy processed at this point, but I was too lazy to do the additional if statement), and insert to current_edges set all the edges that are greater than cure. Then, delete all these edges from it's edges index. If the set is empty, then insert it to processed set, otherwise, it should be processed fully so insert it into written set instead.

Solution link: https://mirror.codeforces.com/contest/1831/submission/207672990

It's a pitty I didn't got AC in the contest. I had a bug with lower_bound(...).

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    I had a similar solution, I maintained an adjacency list so didn't need to use lower bound(because if once a node is inserted into current_edges it is either going to be processes fully in this iteration itself or the next iteration)

»
3 года назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

Did I miss some O(n) solution for D div 2 / B div 1? I tried square root decomposition, but I either get TLE or MLE. If I save the pairs as map<ii, int> I get TLE (which is understandable, as it is O(nlog(n)sqrt(n)). If I save them as unordered_map<i64, int> (using some hashing of course) I get MLE.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Can't wait for rating update! :)

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

So happy to. Victory thank, you

»
3 года назад, скрыть # |
 
Проголосовать: нравится +66 Проголосовать: не нравится

Very good problems, well done guys!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Thanks for the round, finally blue!

»
3 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

D is a great problem with stupid Memory limit

  • »
    »
    3 года назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится +15 Проголосовать: не нравится

    I might be paranoic but I thought 1024MB is just a big spoiler. For me reading 1024MB in that problem just means "do some nsqrt memory dp".

    Setting $$$n \le 10^5$$$ to reduce memory also seemed to spoil a little, what setter does $$$n \le 10^5$$$ if not for $$$O(n \cdot \sqrt{n})$$$ or $$$O(n \cdot log^2)$$$ solutions? There was also a scam that worked quite well with this limit.

    I get we could set 1024MB limit to all problems, but I was unsure we wouldn't run into technical issues then.

    And the hld to reduce memory was posted not long ago so I thought most people knew about it...

    Nevertheless, I'm happy you enjoyed the idea of the problem.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

This is one of the best rounds I've taken in a while, Tho Mle for Div2 D could've been less strict, Thanks!

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

can anyone explain me about problem 2 in div 2

  • »
    »
    3 года назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится +1 Проголосовать: не нравится

    You are given 2 arrays a and b of length n. You have to merge these two arrays into c of length 2*n such that c has maximum length sub-array of equal element.

    Suppose a={1,2,2,3} and b={2,2,1,1}. We can merge it like, c={1,2,2,2,2,3,1,1}.here c[2,4](1 indexed)sub-array contains equal element. So answer is 4. Note that, We can also merge it in different way. Just keep mind that the Order of elements of array a and b will not change.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Div2 b Taught me not to use arrays when you can use vectors,

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Would someone be able to check why my solution to Div 2 D TLEs on case 8?

It's basically the same as the official solution and runs in O(n*sqrt(n)), so I'm unsure why it TLEs.

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Problems D seems like a typical atcoder ABC F

»
3 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Would someone fix my code, i don't know why it's wrong on test 4. thanks for help!

»
3 года назад, скрыть # |
Rev. 4  
Проголосовать: нравится +8 Проголосовать: не нравится

This comment is in context to the plagiarism applied to my code for the contest 875 div2 , for the problem C , with CatFirstSearch , on the submissions 207612824 and 207614629 , on going through the codes one can easily see how different they are one uses a dfs based approach while the other uses a bfs , I don't understand why are the codes plagiarised the only similarity I found was the template on top of the solve functions , to any one checking for plagiarism if he goes once through my submissions before the contest I have been using that template for more than 6 months and hence I have sufficient proof of my innocence and the false cheating charges levied on me should be taken back . MikeMirzayanov errorgorn irkstepanov freak93 tibinyte2006 . Please just look into the solutions and you will know that these solutions are not at all same . MikeMirzayanov I hope you give me a fair trial . Thank You.