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

Автор 74TrAkToR, история, 2 года назад, По-русски

Привет! В 23.06.2024 17:50 (Московское время) начнётся Codeforces Round 954 (Div. 3) — очередной Codeforces раунд для третьего дивизиона. В этом раунде будет 7 задач, которые подобраны по сложности так, чтобы составить интересное соревнование для участников с рейтингами до 1600. Однако все желающие, чей рейтинг 1600 и выше могут зарегистрироваться на раунд вне конкурса.

Раунд пройдет по правилам образовательных раундов. Таким образом, во время раунда задачи будут тестироваться на предварительных тестах, а после раунда будет 12-ти часовая фаза открытых взломов. Мы постарались сделать приличные тесты — так же как и вы, мы будем расстроены, если у многих будут падать решения после окончания контеста.

Вам будет предложено 7 задач и 2 часа 15 минут на их решение.

Штраф за неверную попытку в этом раунде будет равняться 10 минутам.

Напоминаем, что в таблицу официальных результатов попадут только достоверные участники третьего дивизиона. Как написано по ссылке — это вынужденная мера для борьбы с неспортивным поведением. Для квалификации в качестве достоверного участника третьего дивизиона надо:

  • принять участие не менее чем в пяти рейтинговых раундах (и решить в каждом из них хотя бы одну задачу)
  • не иметь в рейтинге точку 1900 или выше.

Независимо от того являетесь вы достоверными участниками третьего дивизиона или нет, если ваш рейтинг менее 1600, то раунд для вас будет рейтинговым.

Задачи были придуманы и подготовлены 74TrAkToR. Хочу поблагодарить всех, кто оказал бесценную помощь в подготовке этого раунда:

Всем удачи!

UPD: Разбор

UPD: Видеоазбор

  • Проголосовать: нравится
  • +198
  • Проголосовать: не нравится

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

OMG 74TrAkToR!!!!

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

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

Are you sure this is Codeforces?

It might be:

  1. Mathforces

  2. Algoforces

  3. Codeforces

  4. Interactiveforces

The question asks you to upvote and answer :D

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

OMG Bro 74TrAkToR!!! :Skull

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

Why everyone disrespects him, everyone made mistakes before. Just enjoy round!

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

Div.3 begin, 74TrAkToR's back, enjoy the trip.

:)

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

OMG! Another 74TrAkToR Round ..

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

I feel this blog will be the most downvoted blog in codeforces history.

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

74TrAkToR has to increase his contribution. Good luck !!!

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

Looking at your contribution value, I don't want this round.

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

Sorry Guys

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

Competition will return

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

rated div-3 after 255 days)

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

I hope you have a wonderful round

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

I believe 74TrAkToR will bring us a wonderful Div3 this time.

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

As a tester, I tested :)

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

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

    What's up with div1 + div2? I can't help, but notice that for some reason low-rated users participate in these contests less eagerly than in div3/div4/even div2

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

      As a CM, I can say that there is a notable difference in difficulty and performance between div2 and div 1+2. This would further exasperated if I could do rated Div3 and Div 4 like pupil/newbie. They just want to do the easier problemsets.

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

int count = div_3_every_month;

if(count>=3) { cout<<" Helpful for Newbies , Pupils and specialist "<<endl; } else { cout<<"As it is now"<<endl; }

what do you think?

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

Good Bye 2023!!

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

This is going to be the one for the books

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

Oh no, Oh no no no no, 74TrAkToR is the author, shut the doors and windows, a crisis is about to begin

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

I think 74TrAkToR is one of the geniuses He is very good at writing problems and is very popular on this site

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

Have the ratings of previous rounds been re-judged? I don't know how my rating got decreased by 18 suddenly.

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

Hope to solve A

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

are there any hacking points for this contest?

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

    No, there are no points for hacking in contests with open hacks phase (usually educational, div 3, and div 4) as someone might create multiple accounts to hack themselves and gain points for this, but if you find a test case that can be used to hack a lot of solutions you can get a better place in the standings by hacking people above you.

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

Finally I can write this.

as a tester, I can confirm that this contest will be a div 3

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

on the edge of being specialist

trust in 74TrAkToR round

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

hope to reach candidate master

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

I think we should let the bullets fly for a while, at least until we see the problems of this one :D

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

My cf id is not opening and handle is kxhitz. I had given last contest on 16th June 2024. Please check it out. Solve this issue as soon as possible so that i can continue my practice and participate in contests.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +125 Проголосовать: не нравится
this round is brought to you by...
»
2 года назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

as div3 enjoyer, i hope it will be a great round!

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

Dreaming to achieve contribution as 74TrAkToR

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

Who's going to try to OEIS G tomorrow?

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

free tibet!!

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

damn i thought 74 is all history

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

Hope pref 2000+ Although 74 round

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

i have high respect for low contribution authors

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

Hope today is not speedforces.

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

delayforce

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

Delayforces...

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

Bro it's delayed!

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

what should we do in delayed time?

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

74TrAkToR is late...

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

Delayed cause everyone's watching F1

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

Delayed

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

delayed :)

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

This is a delay in second 74TrAkToR's contest in a row

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

Delayforces :(

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

Is there ever going to be a div 3 round without delay?

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

The TrAkToR is going slowly so we have a delay.

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

thanks I just finished a heavy plate of pasta and I needed that 15 minutes

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

Everyone will try to become a pupil or specialist. I will try to submit before the cheaters

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

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

Please, don't worry about delay, Mike asked for it to increase testing speed a little.

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

Traktor king lets go

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

What happened? why so much people know about the writer?

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

I thought that I missed the round start by one minute. But, it turned out that I have to wait for more than 10 minutes for the round start now!

Good luck to all, compete fairly and enjoy competitive computer programming.

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

Hope Goodbye 2024 will be super hard for B and above problems and only A is very easy if 74TraKtor Coordinates again.

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

good round, solved A,B,C

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

I don't understand the author's intention to split $$$G$$$ into two tasks and not able to think of a specific algorithm to solve $$$G_1$$$.

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

not-balanced round

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

Does D use meet-in-the-middle to solve? It seemed so easy but I couldn't solve it...

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

    it's just brute force on brute force

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

    first solve the following question: given an array of numbers, what is the minimum value of their expression?

    this is easy enough: multiply ones and zeroes, sum everything else.

    after solving this problem all you have to do is try it for all possible lists of numbers. notice that there are only $$$n - 1$$$ such lists

    the final complexity is $$$O(n^2)$$$

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

      I was thinking that approach, but it seems there are lots of cases to handle. For example, assume the digit is "abc0def". How do you decide whether to multiply c x 0, bc x 0, 0 x d, 0 x de, ..? We need exactly N-2 symbol. Probably 0xde leads to the most optimal one instead of 0xd.

      At the end I use DP.

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

    Handle the edge case where result is 0. Which is pretty simple.

    Since you always have (n-2) signs, therefore theres always a 2 digit number(including 01-09) present in your calculation.

    The problem reduces to finding this 2 digit number then applying the following algorithm:

    Let i be the starting position of the 2 digit number. For each character from 0..i-1 and i+2..n, add if digit is not 1 otherwise multiply it and finally add the 2 digit number.

    Now to find that 2 digit number: You can iterate through all possible 2 digit numbers and add them to vector and sort it.

    Then among lowest 2 digit numbers that have the same digit in 1's place, pick the one that gives you the lowest result.

    You need to do this because sometimes picking the minimal number is not optimal, like 22 gives better result than 21 in one of the test cases.

    I couldn't come up with a better method to pick the minimum number so I kinda brute forced it. The time complexity is O(nlogn). (Picking optimal 2 digit number through sorting)

    Sorry if my description is kinda convoluted I am still learning

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

    Actually, you can brute force the element that will be combined with the right one and then try this: When there is 1 you multiply it, otherwise you sum it and write corner cases with zero, because you can multiply everything and make ans 0, but not in 101 and etc.

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

Really nice problems!

I found a bug in my bridges code due to problem F, thanks to problem authors!

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

You must think you're humorous by choosing these questions. :D

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

bye bye rating 💩

problem b were bit hard for it's position (second div3 problem), waste 30min to implement without ChagGPT, rating completely ruined

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

I loved G, cool round! (maybe F was a bit too obvious tho)

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

Thanks for the amazing contest 74TrAkToR !!! Finally a Div 3 contest that felt like a proper, balanced Div 3 contest <3

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

G2 43no case: what is the case that getting mle

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

What was intended for G2? I used (almost) the same $$$O(n\sqrt{n}\log(n))$$$ code for G2 as G1 which doesn't seem like it should pass G2.

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

    I solved it in $$$O(nlogn + n*maxdivs(A))$$$ which $$$maxdivs(A)$$$ about $$$300$$$ i guess. The problem becomes for 2 simplified fractions, count the number of pairs of fractions $$$(x1/y1), (x2/y2)$$$ multiplied together to produce an integer. When fixing the denominator of the first fraction ($$$y1$$$) => the numerator of the second fraction must be divisible by the fixed denominator ($$$x2$$$ divisible by $$$y1$$$). => count the number of fractions with numerators $$$x2$$$ and $$$x1$$$ divisible by $$$y2$$$. Just brute all $$$y2$$$, processing $$$x1$$$ can be done before.

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

D and E are too much implementation heavy...

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

    what is the correct idea of E? I thought of try pairing every two elements from A so every element we can write it as follow : a[i]=x*k + a[j] for j != i

    but I didn't implement it

    is it correct?

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

      Let $$$x + kn = y$$$ ($$$n$$$ operations on $$$x$$$). This implies $$$y - x = kn$$$. This difference is divisible by $$$k$$$. Thus, two elements can only be made equal if they give the same remainder when divided by $$$k$$$ (if they don't, their difference is not a multiple of $$$k$$$).

      So we group elements with the same remainder modulo $$$k$$$.

      If there are $$$\geq 2$$$ groups with odd number of elements, it is impossible to construct a palindromic array.

      So, we move on to the case where you can apply operations.

      For each group, let its sorted list of elements be $$$a_1, a_2, \cdots, a_n$$$.

      For an even-sized group, $$$(\lvert a_2 - a_1 \rvert + \lvert a_4 - a_3 \rvert + \cdots + \lvert a_n - a_{n-1} \rvert )/k$$$ is the minimum score needed for that group.

      For an odd-sized group it's similar but a little bit more complicated. You will pair $$$2k_1$$$ elements in the front and add their score using the even group method. Then, an element will be left out to be the middle element of the palindrome. After that, the score for the remaining $$$2k_2$$$ elements will be added. The optimal left out element can be calculated using prefix sums.

      So you have the total score for each group, and you sum it over all the groups to get the final answer

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

First time get MLE in div3 round

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

For E, I wasted a lot of time on prefix/suffix sums to find the optimal element in the odd length array to put in the middle. Then, I realized I could use DP to do it without much thinking.

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

solved F 3 minutes after contest finished...... :(

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

I would die rather than to attempts traktors mathy and implementation heavy rounds

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

L round

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

wrote recursive function to verify my observations in D and I found out that I can memoise my recursion function and convert it into dp.

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

Skipping traktor's rounds from now on.

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

who let him cook a template bridge problem???

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

I thought what could possibly change by just increasing the constraint by a mere 5 times in problem G, but it effectively thwarted my square root decomposition solution from G1, and I ended up having many MLE/TLEs :( .

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

div 2.74 (74 from 74TrAkToR)

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

div 2.74 (74 from 74TrAkToR)

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

why carrot giving error?

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

good round, thanks for the problems.

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

Task F can be said to be a learning task for finding bridges in a graph. I copied the bridge search algorithm from an Internet site (the algorithm was published long before the start of the round) without rewriting it by hand and made some changes. I read the competition rules on the codeforces platform and still didn't understand if I could do this. I hope this question will be clarified to me.

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

Why u would put a copy past bridge template in F

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

I'm not able to guess the complexity for my solution of G2, someone hack it. 267078205

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

Decent round tbh. Better than previous round by 74TrAkToR. Skill issued on implementing, but so did everyone else, I guess.

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

Here is my DP solution for D.

267043778

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

You can check my video editorials of D, E and F if you have any doubts

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

Silly mistake cost me E :(

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

Okay I'm fairly new to Codeforces, so I have no idea what hacking is. I had successfully solved A and B. But now sometime later after the round has ended, I open up the round page, B is highlighted in red, and after checking submissions I see that the verdict for B has changed to "Hacked"..... what.... why.......

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

I have a new version of c can anyone help me in that.
Update in 1986C - Запросы обновления, what if t was not allowed to sort the string c then how will approach. any suggestions.

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

    Here's what i thought about this:

    First lets store the distinct occurences of indices in increasing order along with its count. Now for an index $$$i$$$ in this array, we will try to place the smallest available character in $$$ith$$$ pos of $$$s$$$. The position of the chosen character in string $$$c$$$ should be such that we can place all other occurences of $$$i$$$ before it (since it only matter what we place last for an index $$$i$$$). For each character the best chance to be able to choose it would be if we choose the last available occurence of that character.

    So now what remains is how do we choose which characters would correspond to the leftover occurences ? It would be best to strike off the maximum characters to the left of the last occurance of the chosen character. We can simulate that using a segment tree.

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

      I was thinking of the same approach but the main difficulty I faced was like suppose for index 1 we have count of 4 and for index 2 we have count of 3.
      So, we have sorted t array something like this: 1 1 1 1 2 2 2 .........
      Now have to assign best character to last 1 such that there are at least 3 characters before it so that we can assign them to preceding 1. Now for 2 we need to remove max 3 characters that were assigned to 1 and the smallest characters then again go with 2.
      Can you tell how you will tackle this, if possible, provide the pseudo code and expected Time complexity.

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

I don't know why some people complains so much about this Round, it doesn't matter if it's all implementation or math, after all is a problem u need to solve, there are no excuses in real life problems, good Round admins!

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

Contest was great,but cloudfare spoil it for me

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

Any reason we are using memory limit 128M instead of the default 256M for G?

I didn't see any reasons to reject solutions on the memory constant factor.

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

MLEFORCES

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

Can anyone explain why unordered_map solution is giving TLE, while map is working fine?

unordered map

map

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

can someone explain why this fail for problem B https://codeforces.me/contest/1986/submission/267043411

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

    Your code fails if n=1 or m=1:

    if(i==0){
        if(j==0) {
    	if(mat[i][j] > max(mat[i][j+1], mat[i+1][j]))							 
                   mat[i][j] =max(mat[i][j+1], mat[i+1][j]);
    	}
    

    You look at positions (i,j+1) and (i+1,j) without checking if they exist. I don't recomend to write so many if-statements, because then it's very easy to make small mistakes like this. Example of my code without so many if-statements: 266984242.

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

Surprised Pikachu

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

    Turns out test 43 is the first test where $$$n = 500000$$$, which is odd.

    Stress tests should be among the initial tests. Otherwise, it takes too long to get the verdict during a contest.

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

Can someone please explain that in E — Beautiful Array, for the input

13 3 2 3 9 14 17 10 22 20 18 30 1 4 28

How is the output 14? I re -checked multiple times and found it to be 15.

Please reply ASAP

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

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

Can someone explain why this solution failed as TLE?267007171 .I expected the Time complexity as O(nlogn+mlogm).

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

    I'm pretty sure that you are making it O(n^2) through string concatenation (basically, appending a char to a string of length n has time complexity of O(n) because strings in python are fixed-sized unlike C++ where they are almost a glorified vector)

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

      Thanks for your reply and pointing out the mistake, i think it would be a lot helpful to me in the future. Really appreciate it But still i got a question — why does this same code passes with Python3- 267178416 whereas the same code gets a TLE with PyPy3- 267007171

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

        I am not Python expert, I mostly do C++ and some Rust but my guess is that Python3 interpreter recognizes that you are building a string char by char and does some clever optimization on this code which allows it to avoid the O(n^2) pitfall somehow

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

I have sacrificed 'D' to score 'E'! It was a little heavy implementation (E).

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

unrated

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

unrated???

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

Is the round going to be unrated??? The ratings aren't updated after system testing

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

unrated :(

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

why unrated

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

Changing map to a sorted vector of elements + binary search works in G2, the time complexity is the same but i can't figure out why it removes the MLE i get with map, since intuitively, i am storing count in map and elements in vector, the storage in map is more sparse, is this happening because in testcase 43 the array values are such that, it leads to lower count values in map and thus, reducing the advantage of sparseness?

Map submission

Vector submission

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

So why does this code: link return a result of Runtime error? I was able to compile the sample locally.

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

So why does this code: link return a result of Runtime error? I was able to compile the sample locally.

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

i'm kinda new to contests in codeforces so i dont know if this was a hard contest or the other div 3 contests where too easy. i normally solve around 2 or 3 problems in div 3 contests but i could only solve problem A in this one.is that just a me problem ?

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

Was there some changes in the rating updation?

I had gotten +39 now I have +51 in this contest.

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

jiangly Can you please explain your solution for G1 and G2?

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

Good contest

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

.