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

Автор Stepavly, 5 лет назад, По-русски

Привет, Codeforces!

UPD: Так как после тестирования раунд кажется чуть сложнее обычного, мы продлили раунд на 15 минут.

<almost-copy-pasted-part>

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

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

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

Штраф за неверную попытку в этом раунде (и последующих Div. 3 раундах) будет равняться 10 минутам.

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

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

Задачи на этот раунд были придуманы MikeMirzayanov, Supermagzzz и Stepavly.

Спасибо Fly_37, -is-this-fft-, A_Le_K, sstrong, ANZ, kiwii, Lihwy, Sho, ASIXER, songsinger, OlegZubkov, AlexFetisov, darkkcyan, ivanzuki, kocko, Gassa за помощь в тестировании раунда.

Спасибо MikeMirzayanov за платформы и координацию нашей работы. Удачи!

</almost-copy-pasted-part>

UPD: Разбор

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

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

It's my first time as a blue coder in a (Div 3) contest. I was waiting for this for a long time. Best wishes to all the rated contestants.

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

Round 719, yes I have arrived in past.

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

Hello! Codeforces Round #719 (Div. 3) will start at Wednesday, May 5, 2021 at 20:05UTC+5.5.
<almost-copy-pasted-part>
I think it should be <fully-copy-pasted-part> instead

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

I am missing vovuh for Div-3 rounds.

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

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

Any motivational lines please?

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

I waited so long for this day! At last, unrated in div3 for the very first time *_* Cant't wait more for the contest.

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

finaaly i realy miss div 3 contest :(

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

Aiming for specialist.

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

What is the 10 min penalty for the wrong submission? will time reduced if submitted wrong solution??

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

UPD: Since the round seems a little more complicated than usual after testing, we extended the round length by 15 minutes.
Hard problems coming up

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

Suddenly my rating changed to 1601 from 1598. Will the round be still rated for me lol?

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

Wow!!!! This is the first unrated contest for me!!!

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

fingers crossed no technical issues for this contest

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

Since the round seems a little more complicated than usual after testing, we extended the round length by 15 minutes.

This is super sus.

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

E is the worst problem I've seen.

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

Sequence of problems should be A->B->C->F->D->G->E

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

I started implementing E and then it was while parsing the input when I realized that it was a bad idea..

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

My first time solving the entire contest

"the round seems a little more complicated than usual" must be a joke

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

is F that easy more that 4K solved it sadly I have no time to see it :(

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

Very balanced round
B = C = D = E = F = G

Only A was sadly out of the pack

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

A moment of silence for those who were trying to solve D using Gcd to handle the No case

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

Is there a purely mathematical solution for G, I wasted an hour trying to fit the right formula but couldn't figure it out, then I realized there exists a thing called binary search.

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

    logic? or how you decide that x gifts can be made?

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

    If we take $$$N$$$ gift sets of type 1 ($$$a$$$ red, $$$b$$$ blue) and $$$M$$$ gift sets of type 2, then we want the maximum $$$N + M$$$ constrained by $$$Na + Mb \leq x$$$ and $$$Nb + Ma \leq y$$$, which are two lines. The optimal point is at the intersection of those two lines. So we get an $$$\mathcal O(1)$$$ solution.

    Submission

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

      Ah.. just recalled it from my linear programming course, thanks!

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

      Yeah, But I tried to solve them using simplex and get an WA, I think using Simplex here is OverRated.

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

        lol yea simplex was actually my first thought when reading the problem as well, but simplex can't find the optimal integer solution, just optimal solution in general.

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

      Oh, I've looked into your solution, that's much simpler then mine... I did coordinate transformation $$$N=K+G$$$ and $$$M=K-G$$$ so I could maximize $$$K$$$ without regards of $$$G$$$ (since $$$K=\frac{N+M}{2}$$$) and then needed to check for $$$K \lt G$$$ and $$$K \lt -G$$$. But judging from your submission I totally didn't need that transformation.

      I guess I did that, because I wasn't sure, that the ideal solution will be at the intersection. After performing the transformation it was obvious, that the solution will be either at the intersection or at $$$N=0$$$ or at $$$M=0$$$. But I still continued my calculations from there with the transformation which made it more laborious.

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

    Same with me.

    Except that I quickly decided that I'm too stupid for math and started to write binary search from the start

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

    I solved G with a logic/math solution similar to neal's first ac submission (he resubmitted with binary search uh oh) which is $$$\mathcal{O}(1)$$$. I'm not confident that it is correct (bcz I suck at proofs) but it seems to intuitively make sense. My general approach was as follows:

    Assign $$$\min(x, y)$$$ to $$$x$$$ and $$$\max(x, y)$$$ to $$$y$$$. Then, attempt to balance $$$x$$$ and $$$y$$$ by subtracting $$$\min(a, b)$$$ from $$$x$$$ and $$$\max(a, b)$$$ from $$$y$$$ until either $$$x$$$ and $$$y$$$ are balanced or $$$x$$$ has been exhausted. Then, evenly subtract the rest from $$$x$$$ and $$$y$$$ by alternating $$$a$$$ and $$$b$$$ (starting with $$$\min(a, b)$$$ for $$$x$$$ and $$$\max(a, b)$$$ for $$$y$$$). My solution code is below.

    pls hack this or smth

    Does anyone else have this solution?

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

I think Problem-F should be placed before Problem-D or may be also before Problem-C.

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

WTF was the positioning of F. I read it when there was 1 minuite left!

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

problem D is bad itself(case consideration), and moreover, I had to change longlong->int and map->unordered_map to pass tl, G with ternary search with stupid trick can be easily passed, some other problems I can't remember, they weren't interesting, not very good round for me:(

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

    What is wrong with D? Probably, you just have bad implementation. My solution is short and clear, no corner cases. You see it is part of the programming skill to write in such a way that there are no corner cases and huge code.

    G is also my problem. I think it is good) Ternary search, probably, is wrong in this problem.

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

      it's just my opinion, I wasn't able to come up with a good solution, so I spent my nerves on consideration), also I think that G can be solved in that way is not really good, but most likely it will be hacked, I suppose. Anyway, most of the previous div3 rounds were more interesting for me, so...

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

      Agreed!!

      I wrote a poor code in D, but still fail to understand why my TLE submission got AC after changing a lots of heavy lines of if-else statement into single if-else statement.

      Does that affect the code somehow :-(

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

    What's wrong with case analysis? The fastest solution for D runs in 30 ms, how can you say the TL is was strict?

    But it would be nicer if the TL was 4-5 seconds or if ${T} was decreased to 1000 from 10000. This would allow solutions in slower languages to pass comfortably, without compromising the core idea.

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

    It can be tempting to say a round isn't very good because you found it difficult, or what you tried didn't work. A good round has a range of problems of different difficulties, not 7 easy problems that anyone can get. I think this round was good, because it had interesting, and in some cases unusual, problems, which were varied in difficulty.

    I struggled on G too because I tried ternary search. I got it wrong, and then had a different idea which worked. That's part of the fun.

    D I also got wrong initially because I missed a crucial pruning insight. Again, that's part of the fun.

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

      firstly it's just my(very important:)) opinion, secondly, I said nothing about difficulty, but I think you're right about the correlation between difficulty and fun. But in my opinion, that's not a such case

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

well that was embarrassing

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

Any hints for D?

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

D ruined the contest for me.

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

Solving F but not solving D army !!

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

Here's my video of the contest (including solutions) on YouTube: https://www.youtube.com/watch?v=FXcIKhU_3IU

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

is it just me or the time-limits on D and memory -limits on E were strange for some reasons ?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
  1. what is the trick for problem C.
  2. Help me in problem D where i am doing wrong. https://mirror.codeforces.com/contest/1538/submission/119067539
»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Is C literally that easy? How to do it?

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

Problem E should be put in the position of the problem G.

And for new competitors, you don't need to solve these questions in default sequence, if you have solved problem i, the next problem you are going to solve is unsolved problem j that have maximum accepted users, j don't need to be i+1.

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

I solved C using point compression and segment tree, was there an easier solution?

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

My greedy solution for G passed pretests, does it survive system testing?

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

How to prime factorize (count the number of prime factors) the two numbers in D in 2 seconds ?

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

I think that the test cases of D are slightly weak. Mine should have given TLE imo.

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

How to solve E ?

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

I registerd yesterday and I did not get any ranking points, why?

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

In problem D when using int it is getting accepted but showing TLE for long long! why??

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

Pretty easy but my hands aren't fast enough to AC all :(

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

imagine all above Mike's comments written by radewoosh...

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

You can solve C using Dynamic segment tree!

Link

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

This is ridiculous, how the time limit for D is so strict for c++ but not for other language?

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

10^9forces

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

What is the expected time complexity of D?

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

Can anyone please explain me why in my function getPf changing getPf(int x) to getPf(ll x) gives TLE for question D

TLE code: 119084091

AC code: 119084144

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

Can anyone suggest me problems like F. Interesting Function.

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

119063957 119067741 119066275 check all solutions of these people they are the same ... They did this in all contests....

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

Is there any discrepancy in the test case for Problem C, This guy naitikvarshney has hacked more than 100 AC solution. MikeMirzayanov please look into the matter.

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

119083149

Anybody, please help!

I am not able to figure out why I am getting TLE in question D https://mirror.codeforces.com/contest/1538/submission/119083149

I really appreciate any help you can provide.

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

I kind of applied the same logic in D as mentioned in the editorial, but not able to pass the tests. Can anyone tell me what am I missing link

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

119082014 for D i have calculated prime factors for both the numbers in O(sqrt n) then also giving tle.

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

Nice contest. I wish the authors of the tasks success in the future!

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

I personally believe the level of this contest was not exactly same as other Div 3 contests. Its difficulty level was somewhere between regular Div 3 and Div 2. Again, it's a personal opinion.

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

How come all the java submissions are being hacked (tl)by naitikvarshney, while the same solutions in C++ and python are working perfectly fine ?

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

Can someone tell what is wrong in this code of Bugaboo C — Submission I am not able to see testcase on which it went wrong.

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

For problem D, I'm using a long long data type, which makes me TLE, but when I change it to INT, I get AC

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

Can anyone tell which corner case I am missing in the solution to problem D? I am getting WA on token 1021 of test case 2. Here's my link 119065848. Thanks.

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

For the first time I was able to solve 4 questions :)

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

I wasted more than 100 minutes on problem D and still couldn't solve the problem in the contest (WAs throughout), only to find out later that I had taken return type for a function (counting prime factors) as "bool" instead of "int" ! I have never felt so useless before lol

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

Do runtime errors count in wrong submissions?

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

A bit confused, after how long will the ratings be updated? (also if someone can share blog post on codeforces which talks bit more on this)

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

Hey! This is my first time giving a contest so I have a few doubts. My rating has not changed from 0 till now. I did successfully submit 2 ques near the end of contest. So will they not be counted cause I took too much time??

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

Hi ! MikeMirzayanov when will you update the rating?

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

I can't understand why this round was made unrated Can anyone explain me the reason. Thanks in advance.

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

I'm wondering about division system? Is it based on rating? If yes then how is div1 div2 and div3 divided?

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

why E had so less submissions? I felt it easier than many other problems.

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

Why hasn't the Rating been updated

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

fahimfardous8 and Toxic_046 both account is mine. I tried to solve Codeforces #725 contest problem in both account.When I solved problems A,B then submttefd in both of my accounts.I apologise for that.I can give proof that both of the account is mine.

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

    It's still wrong even if both accounts are yours, you are essentially bypassing all the WA penalties. How do you expect CF to know which account belongs to which human on earth. If 2 accounts use the same solution, they should be penalised.

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

I have been accused of plagiarism against my own solutions. Please look into this.

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

Всем привет! Мне пришло письмо с сообщением о том, что решение участника vippro https://mirror.codeforces.com/contest/1538/submission/118981243 совпадает с моим https://mirror.codeforces.com/contest/1538/submission/118983434. Да, я сам был поражён, когда открыл код. Ранее мне приходило такое предупреждение, когда я писал на сервисе ideone.com и случайно оставлял открытыми мои исходные коды, которые потом парсили что-то вроде ботов. На этом же соревновании я писал в visual studio code и вообще не использовал онлайн сервисов. Я понимаю, что участник vippro предоставил решение раньше, но я даже не знаю, как я бы нашёл его код (только если бы у меня не было бота по типу, как того, который у меня украли). Я просто прошу заметить, что я сдал все задачи на этом контесте. Явно, если я сдал задачу E, я бы не стал искать решение задачи B. Я надеюсь на понимание администрации, что такие совпадения имеют место быть, особенно когда задача тривиальна. Если сравнить моё решение с оригинальным авторским — https://mirror.codeforces.com/blog/entry/91637, то явно тоже практически один-в-один, только я никогда функции solve не пишу. MikeMirzayanov Supermagzzz Stepavly

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

????????????where's my rating??????bro???????????

NO rating ??????????

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

Thank you to the authors for such a great contest! This contest helped me a lot to become specialist for the first time!! :D

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

Why are the problems for this round not getting rated???????????????