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

Автор vovuh, история, 4 года назад, перевод, По-русски

<almost-copy-pasted-part>

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

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

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

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

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

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

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

Спасибо MikeMirzayanov за платформы, помощь с идеями для задач и координацию моей работы. Спасибо моим очень хорошим друзьям Дарье nooinenoojno Степановой, Михаилу awoo Пикляеву, Максиму Neon Мещерякову и Ивану BledDest Андросову за помощь в подготовке и тестирование раунда. Также спасибо Артему Rox Плоткину и Дмитрию _overrated_ Умнову за обсуждение идей и тестирование раунда!

Удачи!

</almost-copy-pasted-part>

UPD: Также спасибо ma_da_fa_ka и infinitepro за тестирование раунда!

UPD2: Разбор опубликован!

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

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

vovuh logic

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

vovuh hello , I guess my rating will down to less than 1600,but I've registered before,will I be rated in this case?

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

Wow wow, another Div.3 but this time I will not get rate :D

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

I good opportunity to get my rating back from today's Div2 lol

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

What does "open hacking" mean, sorry I am new? How can you hack a solution?

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

    After each contest, there is a time of 12 hrs where if we find someone's solution incorrect, then we can give input the case at which the submission fails, if hacked you are rewarded with some points sometimes.

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

      is there a way to sort solutions by programming languages? Now, I have to go through all the submissions to find Java submissions.

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

    1)After this contest (the same for following div.3 rounds and educational rounds), there's a period of 12-hour hacking phase.

    That means, you can hack anyone you want(while in normal rounds you can only hack your "roommate" during the contest).

    2)If you find something wrong in other's solutions(but passed the pretests), you can give an input which will make the solution fail (wa,tl,...)

    In div.2 you get 100 points from each successful hack and lost 50 points from each unsuccessful one

    In div.3 there's no prize or penalty for hacks.

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

      What's "roommate"? Sorry, newbie.

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

        In a normal round, you are assigned to a specific room, with ~50 people if I'm not mistaken. During the round, you can attempt to hack their solutions, but only if you lock your own solution first (this is because you will be seeing others' codes, it wouldn't be fair if you could change your own code).

        A successful hacking attempt will give you a 100pt boost, while an unsuccessful hacking attempt will take away 50pts from you.

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

          and what does locking the solution mean? If hacking starts after the round then how can one change his code?

»
4 года назад, # |
Rev. 4   Проголосовать: нравится -25 Проголосовать: не нравится

Hope it won't go too mathematical ;/ questions about string is more interesting;)

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

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

    But comparison of other websites code forces server is good

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

    Did you ever participate in codechef cook off or luch time...they can't handle even 5000 participants properly...whereas codeforces handles nearly 20K participants...comparitively codeforces servers >>>>> any other cp server

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

    The girl is the middle would rather be saying that "Give the lengthy problem A and engage participants."

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

    Did you ever participate in atcoder contests It servers cannot hold even 5000 participants. Codeforces servers when it is +5000 submissions at time it will get some time but when it is less it works good!

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

      it was just a meme bro... I know CF is really good.. I apologize for posting this...fine?

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

After every contest i felt disappointed.But believes that practice makes a man perfect. Best wishes for all. <3

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

Hoping to see "Yet Another Problems".

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

finally a div 3 contest :(

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

Can "Hacking A Soluton" also be included in Div 3 ?? Just an idea.

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

    When div3 was first proposed then it was said that a beginner should waste time in hacking instead of solving problem. So contest time hacking is not available in div3 rounds. And there is 12 hours hacking phase for improving hacking skill. But i think 12 hour is too long. It can be reduced.

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

      I think 12 hour just for global, maybe someone finish the problems then have to go to bed.When they weak up, they can hack.

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

        Actually after 6 to 7 hours nothing for hacking. Almost all the hackable solution are already hacked in this time.

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

Thank you, as always I am excited for another div.3 :)))

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

Hello, is this rated?

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

I'll try to skew my propagating wave at least this time. Pray for strong pre-tests

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

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

Problem set in recent codeforces contests seems tough for me. Looking to get some easier problem this time.

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

hopefully some short problem sentence

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

Why setter is yelling at tester?

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

Hoping for stronger pretests in A. Got hacked (unfortunately) in the educational rounds and it had been a while since I had solved 3 T_T and I missed it thanks to the A.

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

    You should be more careful with some corner cases

    That's more important and valuable than strong pretests.

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
  • I hope it will be like this for second time!!
»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I hope to see Math problem~~

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

you make me a green i dare you

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

good luck

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

Hope the system test won’t be too long.

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

It's good to see vovuh back but I expect that codeforces will do something in order to handle such large number of submissions during the contests and I guess this time it won't be queueforces :)

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

I hope that the gap between the div.3 rounds will be decreased , its the best round

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

Hope my rating will go up.

I'm so vegetable......

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

Hope the statements will be shorter -_-

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

Thanks vovuh again for bringing such contests in this pandemic situation we highly thanked to codeforces and its community for bringing such contest in this period to make us somehow busy and involved.Thank you codeforces community !

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

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

I am becoming Expert Blue after this round.

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

Is it rated?

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

Isn't it more logical to not allow experts or above from submitting solution for first 20 minutes rather than making problem A hard/confusing for div3 rounds atleast. Many participants don't even submit solution if they find problem A confusing or tough for it's bracket.

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

My rating is just 1600, so helpless

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

Good Luck Have Fun!

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

what happens when i hack my own solution ?

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

    If successful:

    You will lose a problem solved

    If unsuccessful:

    Nothing changes.

    So it's obviously meaningless to hack yourself unless you've found some mistakes in your code after the contest.

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

What you see: Codeforces Round #XYZ (Div. 3)

What I see: Another unrated contest :'(

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

    architb_12 why the hell are u giving this contest ,if u have such a mentality,and posting this nonsense doesn't show that u are cool

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

      pizza_hut what mentality? I am just saying that I am sad that the contest is unrated. It is much more fun when it is rated. What is your problem with that?

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

        architb_12 whats the problem when contest is rated for 70% of users on codeforces

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

          I think you have completely misinterpreted me. I meant that it is more fun to give a contest when it is rated for you.

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

          hey, first of all, learn to give respect to others (doesn't matter he is highly rated or low) and don't talk rudely. He was just saying that this contest is unrated for him and of course this was unrated for him because he has done efforts to be at that position where Div3 even Div2 is unrated for him. So, please don't post such non-senses. Even today tourist gave the Div3, can you stop him...No nah?

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

Can the frequency of Div.3 contests increase ?

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

This is what happens when Tourist attends Div 3.

»
4 года назад, # |
  Проголосовать: нравится -15 Проголосовать: не нравится

What's the point of having 50000 testcases, if giving verdict still takes you > 10 minutes?

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

    I'm sorry, what about you? I don't see any of your submissions were judged for more than 1.5 minutes.

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

      F took > 10 minutes. It really didn't affect me. I understand its because these rounds don't have pretests, I guess.

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

Wow the servers have REALLY IMPROVED. MikeMirzayanov orz

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

tourist solved 7 problems in 22 minutes and still atheists exist. orz

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

A nice and balanced round !!

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

How to solve E2 and F?

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

Easy +rating, nice contest)

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

I was logged out suddenly while submitting please solve this problem it occurs most often during contests with me!

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

How do you do E2? I spent like 45 minutes binary searching for the second endpoint(and I think it was probably the right way since you have blocks of xyx or just one large block of length x), so you can use binary search to find the optimal value for the second endpoint, but it wouldn't work.

EDIT: Just realized that I thought a_i<=26 for E2 (as it was in E_1) so that's why I was getting wrong answer

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

    Observation:

    The contribution of a number is limited by number of occurrences of prefix and number of occurrences of suffix, In other words, if you have a prefix of 7 occurrences and suffix of 2 occurrences, Then you're only contributing to the final answer with just 4(2 from the left side which has 7 occurrences, and 2 from the suffix), So contribution = min(prefix,suffix) * 2.

    Knowing the above, We can just try for each number x, A possible prefix that has 1 occurrence.. 2 occurrences .. 3 and so on, you can fill the middle with an element that occurs the most, you have only 200 distinct element, just go over them all.

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

      Oh my this is neat. I mean the idea about checking only prefix and suffix. Thanks!!

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

How to solve E2. Any idea??

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

    store position of every element in a vector v[203].for each number between 1 to 200 run two pointer from start and end of its position vector and between them find maximum time occuring integer frequency using prefix sum 2-d array.

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

      can you elaborate on the prefix sum 2-d array? how are you storing in them?

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

more than 60k accepted submission and aprox 26k participants.wow amazing.

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

Why i can't hack someone? It's write me "Illegal contest ID" or "Неверный идентификатор соревнования"

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

Fast servers but speedforces :(

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

How did you all solve E2? I used Mo's and I wonder if that was overkill.

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

    Oh man the alphabet is only size 200, Mo's was definitely overkill.

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

    Yeah, I used Mo's too, don't know how others got that right

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

    Here's my approach:

    1. Loop through all $$$k$$$ possible "symbols". This will be the symbol forming the prefix and suffix (aaa...aaa)
    2. Put two pointers on the first ($$$i$$$) and last ($$$j$$$) occurrences of the symbol.
    3. Find what's the best score for the middle part (...bb...) between $$$i+1$$$ and $$$j-1$$$ using a precomputed table of counts for each prefix and each symbol.
    4. Move pointers towards each other to the next two occurrences of the symbol from #2. At every time, you know exactly how many of these symbols there are to the left (= to the right) of the middle part, so the score for this partition is middle part score + 2 * symbol count.
    5. Repeat until they meet, keeping track of the maximum score.

    $$$O(n\cdot k^2)$$$ in total, but the operation #3 is rare in practice, so it passes the pretests ¯\_(ツ)_/¯. Got MLE on the first attempt though, lol. Don't define int long long where it's not necessary.

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

      Excellent solution. I thought O(N * K^2) would fail, but yours is super simple, so I guess it has a very LOW constant factor.

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

      That is $$$O(n \cdot k)$$$ in total if you have position pre-calculation, not $$$O(n \cdot k^2)$$$. That is because $$$\left(\sum \text{occurrences of symbols}\right) = n, \text{not } n \cdot k$$$.

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

        but for each prefix and suffix of given size and letter, he is going over all 200 letters to find biggest centre block. So I think its really $$$nk^2$$$ with small constants.

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

          I think prefix table can be calculated for vector<int>(200), then the max_element(for "b") can be found in O(k) time. Since we traverse over O(n) two pointer pairs (i,j), this gives total time O(nk).

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

      FYI this approach is almost optimal; but at step 2 you should initialize $$$i$$$ and $$$j$$$ to the two middle occurrences of the symbol (if the amount of symbols is odd, just ignore the middle one), then move them away from each other, towards the end.

      The benefit of this is that you can start with an empty set of frequences $$$f[200]$$$, then initialize that to the counts of each symbol between $$$i$$$ and $$$j$$$. Keep track of the most frequent symbol whenever you update ++$$$f[\cdot]$$$. And then do --$$$i$$$, ++$$$j$$$, and update $$$f[]$$$ as you go. You can always keep track of the most frequent letter in the middle part this way, and complexity is $$$O(n)$$$ because you do ++$$$f[\cdot]$$$ at most $$$n$$$ times.

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

      For E2, I coded a O(nklog(n))time algorithm using the same idea as yours except using binary search instead of prefix sums. I realised that the complexity is too large. However, for testcase 9, which has 134 repeated 2e5 times, my solution should simplify down to O(nlogn). However, when I ran it on my system, it took more than 30 seconds and gave me TLE on codeforces. Can you please help? Here is my submission https://codeforces.com/contest/1335/submission/76624993

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

      E2 complexity analysis:
      $$$\displaystyle \sum_{c=1}^k freq_c \cdot k = \displaystyle k \cdot \sum_{c=1}^k freq_c = O(k \cdot n)$$$

      Sum over $$$c$$$ for choosing the number in $$$1^{st}$$$ block. $$$freq_c$$$ for iterating over all possible lengths of $$$1^{st}$$$(and $$$3^{rd}$$$) block. Multiplied by $$$k$$$ for choosing the number in $$$2^{nd}$$$ block.

      $$$\displaystyle \sum_{c=1}^k freq_c \neq k \cdot (freq_c)_{max} \neq k \cdot n $$$

      $$$\displaystyle \sum_{c=1}^k freq_c = n $$$

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

    What is Mo. I thought of doing binary search but failed to do so.

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

    Could you please explain how you applied Mo's?

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

      The problem can be reduced to answering a bunch of queries of the form: What is the most frequently any element appears in the range [L,R]? If the alphabet is large, you could attack this with Mo's Algorithm.

      Unfortunately, it slipped my mind that since the alphabet is so small (only up to $$$200$$$ symbols), you could more simply create 200 prefix sum tables instead.

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

Really good round! I loved problems D and F. Had an idea for F but gave up after 20-25 minutes of implementation after I realised I didn't account for something mentioned in the question. Had about 20 minutes for E1 and E2 (I regret not having attempted E1 and E2 before F). I believe I'd have been able to solve E if I made a wiser decision earlier but shit happens, lol. Also, ideas for E, anyone?

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

In problem F, if N and M's range can be confirm instead of N*M <= 1e6 will be better

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

How do you guys solve D?

I finally figure out that we must change 9 postions which are respectively distributed in the nine squres.

So I enumerate the column and the row (maybe like N-queen Problem) and get the answer....

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

    Author's solution is to replace all 2 with 1.

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

      I did the same xD

              mat[0][0]=max((mat[0][0]+1)%9,1);
              mat[1][3]=max((mat[1][3]+1)%9,1);
              mat[2][6]=max((mat[2][6]+1)%9,1);
              mat[3][1]=max((mat[3][1]+1)%9,1);
              mat[4][4]=max((mat[4][4]+1)%9,1);
              mat[5][7]=max((mat[5][7]+1)%9,1);
              mat[6][2]=max((mat[6][2]+1)%9,1);
              mat[7][5]=max((mat[7][5]+1)%9,1);
              mat[8][8]=max((mat[8][8]+1)%9,1);
      
  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    a[1][1] = a[2][1], a[2][4] = a[1][4], a[3][7] = a[2][7], a[4][2] = a[3][2], a[5][5] = a[4][5], a[6][8] = a[5][8], a[7][3] = a[8][3], a[8][6] = a[7][6], a[9][9] = a[8][9] This was my idea. Later, got that replacing all 2's with 1's was good enough.

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

Funny way to solve F without detecting cycles: notice that if two robots get to the same cell, then they will always move to the same cell from then on. This means that we can find for each cell where the robot starting in that cell will be after some $$$2^{22}$$$ moves using binary lifting.

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

    This is author's solution :)

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

      Hi, this is my first contest. Can you please share the link to the author's solutions? I am not able to locate it. Thank you!.

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

        I'll post them with the editorial. Please, be patient.

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

          The contest was not at all balanced, I must say. Even you can see the rating of people and compare the no. of questions they solved. Starting 4 questions were not of much use as almost half of the contestant solved the first 4. Also, question D looked like it was meant for April Fool's 202 but was posted by mistake?

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

            Why do you posting this from fake account? :)

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

              You ignored my comment... What am I saying wrong according to you? You should accept the mistakes. :)

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

                Which mistakes? Prediction mistakes? Maybe, I need to clean my magic ball to see the future better.

                The only (and very doubtful) "mistake" here is the "gap" in $$$5400$$$ accepted solutions among official participants (which means that E1 was solved by 1/4 of people who solved D). This is not a big gap.

                I could show you examples of really big gaps but I don't think I need to prove you something anymore. If you don't realize that this prediction with difficulties is good enough, I have nothing to say to you.

                And, if you post your opinion from fake account, it seems like you don't want to anybody know who are you actually :)

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

                  Yeah, you are right. As far as I remember all the Div.3s I have given were perfectly balanced and excellent problemsets and all of them were made by you:)

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

                  Well, I disagree with you :) Most times there are some mistakes that you couldn't notice, but this time the contest went fine. There also were some minor mistakes but not as fatal as usual. This is the rare case when almost everything is fine and I'm glad to see that.

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

                  Thank you for the round! No queue, no weak pretests.I found problem E2 very interesting and problem D a bit hard for me but interesting too.Please make more div 3 contests, we really appreciate you :)

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

      That's actually a really cool approach. Have you also tested a cycle-based solution? I am trying to implement a fairly straightforward search and it keeps running out of memory.

      Looking at 32 pages of MLE results in Status, I think the memory limits for E and F could have been a little bit higher.

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

        The approach with extracting cycles and doing some dp is much harder to implement, so I didn't even tried to do that. I could but didn't do this.

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

          I ended up flipping the dimensions if N > M, and surprisingly this helped (76628096). According to the test results, it uses up 254.5 out of 256 MB, lol.

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

            Well, I'm sorry to hear that. I really thought to increase memory limit, but my solution uses ~200MB (the two-dimensional vector of size $$$nm \log nm$$$) so I thought that the 50MB will be enough (because this is the only array which should have such size).

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

              Hello ; can you please explain me why does N*M*M solutions pass for problem E2 ?

              tourist has written a code with that time complexity ; here is his submission — https://codeforces.com/contest/1335/submission/76520445

              And I am not able to understand how does that happen ; curiously ; I even did try to check the test cases ; and I see test case 9 which should break such solutions.

              So clearly ; I am not understanding something ; can you please help me with this.

              Thanks !

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

                The solution of tourist has the complexity $$$O(nk)$$$ where $$$k$$$ is the size of the alphabet. If you take a look at the two outer cycles, you can notice that they just iterate over all characters of the string and this sum is obviously $$$n$$$.

                Maybe, when I post the editorial, it will be more obvious to understand why this is $$$O(nk)$$$. Just be patient.

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

                  Oh ; I see ; I apologize for being a bit impatient ; and I thank u for the reply.

                  I understand the complexity analysis of that solution now ; Thanks !

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

              vovuh please look at my submission for E2 this it got MLE 252700 KB but now I am submitting it got accepted this with 252800 KB (more space than previos)... :'( and because of that I was not able to submit E1 also during contest...

              very sad!!! :'(

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

    Thanks for teaching me something. I learned binary lifting for RMQ/LCA but didn't consider reusing the table for k-th ancestor queries.

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

I got E 5 min late -_-

Nice round!

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

help me please which problem i have with this code on problem B? https://codeforces.com/contest/1335/submission/76592383

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

How to think fast like tourist... :(

When he was solving each question in about 1 minute, I was drawing on mspaint.exe and looking for the solution :)

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

the best contest ever for me

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

Problem D

Can somebody please help me in finding out the problem of this submission. Apparently, the inputs are not being properly taken, instead some absurd garbage values are being shown. I was stuck with this for the last 40 minutes of the contest and still could not figure it out.

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

    Input is not n*n integers, it is n strings in n lines.

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

    You can't take the input as int sudoku[10][10]. Make it char sudoku[10][10] and change your code accordingly.

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

    cin >> sudoku[i][j]; this takes takes whole row as input. Not a single integer

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

https://codeforces.com/contest/1335/submission/76590246

https://codeforces.com/contest/1335/submission/76509810

both solutions are identical and the person who submitted it from different accounts, intentionally did so to hack (and get points if hacking gets you extra points, not sure tho) !

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

    Maybe that's the reason why he's still gray.

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

    Successful Hacks don't change anything except the victim will lose a problem solved

    Hacks with this method are......meaningless, honestly

»
4 года назад, # |
  Проголосовать: нравится -48 Проголосовать: не нравится

people making such D should be banned from making future contests

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

~~~~~ How is the answer for 6 1 5 1 1 1 1 5? Test case 2 E

2! According to me it should be 6!``

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

It's really bad for me. 1335B - Construct the String said that " to construct a string s of length n consisting of lowercase Latin letters such that each substring of length a has exactly b distinct letters. " e.g. For test case: n, a, b are 22 17 12 my code output: abcdefghijgkkkkkkabcde

is it wrong?

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

    Yes it is wrong for the prefix of size 17. I think you are trying to print this "abcdefghijkllllllabcde".

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

Can someone show me your solution to C?

My solotion is to binary-search the answer and check whether it is legal.

But my solution runs nearly 900ms.

Is there some easier and faster solutions?

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

    Here. Mine runs in 61ms. Idea could be figured from the code but hit me up in PM or here if you need help understanding something.

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

      Can you please briefly explain your solution?

      I have a little difficulty in understanding it....

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

        I can explain mine if you want to :)

        Solution

        Code: 76607507

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

Hi, can I be unrated for Codeforces Round #634 (Div. 3). Reason is with Problem D with Java. I submitted the code https://codeforces.com/contest/1335/submission/76566765 during the contest without PrintWriter but TLE'd on test case 2, although my solution is O(81*10^4) which should be under the time limit. After the contest I submitted the exact same code with PrintWriter https://codeforces.com/contest/1335/submission/76614841 and got AC. @vovuh vovuh

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

Best contest ever for div 3. Thank you god vovuh very much and hope everyone can become expert !

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

I didn't read D correctly and thought you needed to keep the "sudoku structure" ( just swap numbers around, no replacing ), so I came up with a backtracking solution and I just kept wondering how was it a div3D and how did so many people manage to solve it lol.

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

Strong Pretests and Intersting Problems, Fast Test and Good Network.

Thanks to vovuh & MikeMirzayanov

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

What is the intended complexity for E2?

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

    O($$$N$$$ * $$$200$$$)

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

    O(200*200*nlogn)

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

      Not for E2

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

      I can be done in O(N*200) analyzing from the "center" for each distinct value. Centers for value V means two distinct pointers (a, b) where the amount of V before a is the same as the amount if V after b. Then keep jumping a backward and b forward, both at the same time, but the jump is actually to the previous/next V value. While you do this, count the frequency of values in the middle of a and b, and keep the one with maximum occurrences, and add that to (amount of V before a)*2 keeping maximum for each time you move the pointers. This is linear for each value V

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

        Nice solution!, initially I had thought of this method, but I tried to move the pointers closer instead of farther and it led to some complications in maintaining the maximum

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

        Ah! I realise now that what I did was itself O(200*N). I did the complexity analysis wrong. Thanks!

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

In F,Why did you keep 1 as white and 0 as black ?

If your intention was to delay submission time by 2 minutes, congrats :D

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

Could you please help me understand why my code for Problem C doesn't work? It seems pretty straightforward and I have seen other solve it my way, however my code fails on test 4. I have no idea why. Here is my submission.

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

    I don't understand your code, but it seems to fail on the case "1 1 1 1 1 1 1...". The answer should be taking the whole array (n)

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

    Don't compare two Integer(object type) using ==. It compares reference not value.

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

I am getting automatically logged out when i press submit button for the first time in a contest.This is happening regularly with me from past 5 to 6 contests. I am still a specialist and those extra 15-20 seconds don't matter to me right now, but this might be a bug in the server that may need a correction. Please have a look MikeMirzayanov. Thanks!

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

    Maybe your cookies are not working.

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

    I have faced the same issue when clicking from the problem itself instead of going to the submit code tab

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

    I'm also facing some problem while submitting my first solution of previous 2-3 contests. I get some html 403 forbidden error with some token value!

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

In E1 test 2 set 107 is "4 1 4 1" and the expected answer is 4?

Am I missing something?

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

Why are some of the submissions containing this part?

if (t == 'something') cout << "OK" << endl;

Does it give any benefit?

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

So, somebody want to explain 1335F - Robots on a Grid?

As I understand we need to find the loops, and the size of the loops. We can fill all cells of the loops with robots. Then, there are paths leading into the loops. We can use robots from white loop cells and place them on black into-pathes cells.

How to implement that?

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

A very strange thing happened with me during the contest. My code for problem E was running perfectly fine on code blocks but was showing a run time error on test 1 when I submitted. After the contest when i changed ll(which was defining long long int) to int then the solution was accepted Could anyone help me with this.

Code which was showing run time error : https://codeforces.com/contest/1335/submission/76603369

Code which got accepted after the contest : https://codeforces.com/contest/1335/submission/76621202

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +5 Проголосовать: не нравится
    ll q=mp[i].size()-1;
    

    You might get an unexpected high value here if size() returns 0, since it is unsigned.

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

Look at this code.This guy added a special test case in his code just to hack himself later. https://codeforces.com/contest/1335/submission/76620858 I hope the authorities will look into this matter.

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

For problem E2, memory of O(2*N*200) gave MLE, but O(N*200) passes. Can anyone explain the reason. MLE: 76596543 AC: 76621338

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

    Maximum N is 2e5

    2*2e5*200=8e7,an integer takes 4 bytes, so the total space used is 3.2e8 Bytes

    The limit is 256MB,1MB=1024KB,1KB=1024Byte,so the space limit is 256*1024*1024=2.6e8 Bytes

    Obviously 3.2e8 is larger than 2.6e8.

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

tourist in Div3 remembers me of lightning mcqueen in thunder hollow

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

What type of contest was this? I feel this round is more of a typing round. I know it is a div3 contest but it was not meant to be conducted so easy so pls set some good problems next time in div3 too.

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

    Couldn't agree more. Div 3 rounds used to be fun but this wasn't. The contest gave atcoder beginner contest feels.(Especially D problem)

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

    kaneki_007 Am I right in assuming the reason you didn't solve E1, E2 and F despite the contest being so easy is you got bored by how easy they were and left?

    P.S. Please be more respectful to problem setters they put in a lot of effort for seemingly simple problems as well.

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

    Nah, you can feel TypeForces Rounds whenever they happen. This round was pretty easy tbh (okay, vovuh, don't make the next round too hard tho :p). A was one liner, B can be done in 8-15 lines, C can be done in 5-15 and D can be done in 5-15. I tried F but messed up (50-100 lines seem to be good). E can be done in about 50. Considering most people solved A-D, 50 lines of code is pretty easy.

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

      It's not about the length of the code, it's about the techniques and topics needed to solve the problems. I found E2 and F really interesting problems

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

My code fails for input #633 in test case2 for problem C? Can someone suggest what is the problem? Here is my code: Code: https://codeforces.com/contest/1335/submission/76603660

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

    Please do not paste your code here. Instead, paste a Pastebin or Ideone link of the code in case you have any query.

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

My solution to Problem D:

char s[15];
void TestCase() {
    for(int i = 1; i <= 9; ++i) {
        scanf("%s", s + 1);
        for(int j = 1; j <= 9; ++j) {
            if(s[j] == '2')
                s[j] = '1';
        }
        puts(s + 1);
    }
}

Just replace all '2' into '1'.

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

Any reason why unordered_map solutions not getting hacked today?

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

I am not able to figure out why my solution is giving TLE on test 2 though my idea is similar to most of other people's. My Submission

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

    I'm pretty sure it is due to memset in cnt array. Imagine you have 10^4 tests and you memset all the array in each one. That will for sure get TLE. You just need to clear positions you used, not everything from 1 to 2*10^5

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

i am new to codeforces so i have a doubt . Will i get penalty for wrong submission if i could not solve that problem but i submitted too many wrong solutions??

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

What this error mean?? I ran my program on different editors,they gave answers correctly for 1st case but codeforces isn't

Diagnostics detected issues [cpp.g++17-drmemory]: Dr,2020-04-13.M Dr. Memory version 1.11.0

Dr,2020-04-13.M Running "program.exe"

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

C:/Programs/mingw-w64-7/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/debug/vector:417:

Error: attempt to subscript container with out-of-bounds index -1, but

container only holds 3 elements.

Objects involved in the operation:

sequence "this" @ 0x11357920 {

  type = std::__debug::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >;

}

Dr,2020-04-13.M

Dr,2020-04-13.M NO ERRORS FOUND:

Dr,2020-04-13.M 0 unique, 0 total unaddressable access(es)

Dr,2020-04-13.M 0 unique, 0 total uninitialized access(es)

Dr,2020-04-13.M 0 unique, 0 total invalid heap argument(s)

Dr,2020-04-13.M 0 unique, 0 total GDI usage error(s)

Dr,2020-04-13.M 0 unique, 0 total handle leak(s)

Dr,2020-04-13.M 0 unique, 0 total warning(s)

Dr,2020-04-13.M 0 unique, 0 total, 0 byte(s) of leak(s)

Dr,2020-04-13.M 0 unique, 0 total, 0 byte(s) of possible leak(s)

Dr,2020-04-13.M ERRORS IGNORED:

Dr,2020-04-13.M 2 potential error(s) (suspected false positives)

Dr,2020-04-13.M (details: K:\invoker-prod\work\codeforces6\60c583d1d5042c09b8b90fe60fe5fe0b\check-acfb434e06065bfe7c8a7fcb2d8ca975\run\DrMemory-program.exe.3432.000\potential_errors.txt)

Dr,2020-04-13.M 22 unique, 26 total, 39452 byte(s) of still-reachable allocation(s)

Dr,2020-04-13.M (re-run with "-show_reachable" for details)

Dr,2020-04-13.M Details: K:\invoker-prod\work\codeforces6\60c583d1d5042c09b8b90fe60fe5fe0b\check-acfb434e06065bfe7c8a7fcb2d8ca975\run\DrMemory-program.exe.3432.000\results.txt

Dr,2020-04-13.M WARNING: application exited with abnormal code 0x3

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

can someone plz explain the approach for E

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

    Search in this blog, there are discussions about it: https://codeforces.com/blog/entry/75908?#comment-603025

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

    in the question it is given that distinct characters is at most 2 , so u can run two loops of 200 for all combination and make resulting sequence using index of those numbers which u can compute while taking input itself . The problem reduce to a sequence of 2 distinct numbers and u can solve using two pointer method . for i==j ans will be size of index of that i /j .

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

I am not able to figure out that why is my anti sudoko code not working. Please help me.Link to the code:https://codeforces.com/contest/1335/submission/76592951

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

https://codeforces.com/contest/1335/submission/76641997

This is E1 problem Can anyone give me the test case where my solution fails. gfonn ZsibbadtKubikus

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

Задача E1 тест: t = 1 n = 8 a=[1 2 3 3 3 3 1 1] А почему в этом тесте ответ равен 6? А не можеть быть 7? a = 1, b = 3

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

    блок из единиц длины 1, блок из двоек длины 4, блок из единиц длины 1

    1+4+1 = 6

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

after every 12-hour phase of open hacks. Sever gets disturb why?

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

If all my solutions are correct, that is, they are not hacked, how can my rank decrease? After standings were frozen just after the contest, it was 1990 and now it's over 2200.

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

    Probably because successful hackers get extra points.

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

      Successful hacks do NOT give the hacker extra points in div.3 and educational rounds

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

    2200 / 17000 all contestants, i guess you will increase a bit, good luck !

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

    Probably you disclicked "show unofficial" button.

    Sometimes this feature doesn't work properly and some unrated participants mistakenly appeared even you don't want them to appear(unrated participants aren't official participants)

    Rank 1990 is the real ranking(without unrated participants) and 2200 is not(with unrated participants)

    (That's my guess)

    If you clicked "show unofficial" button, then maybe virtual participants affected your standing.

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

      2200 is the rank among all participants. It is around 1100 only for Div3. What's strange, both of them increased after the round. xD

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

    good luck for us

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

How i can solve (problem E) by dynamic programming

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

when the ratings will be updated for this round?

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

It's my first time to read the comments even I've been here for 15 months. I just found the comments section so interesting. I'm going to come here every time. lol

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

What does it mean by the word "hacking" or "hacking phase"? I can see a lots of comments containing the word "hacking".

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

    if you found a solution which might fail some test case then you can hack it by providing the test case and get extra points.

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

Sorry I'm not familiar with these contest. But do we have an access to download the complete problemset of each contest? Thanks.

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

tourist completes the contest within 22 min

problems: Am i a joke to you?

tourist Yes

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

When will the rating result come?

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

When will the ratings update? It’s been quite a while since the system testing after the hacking phase.

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

It was my first contest. I have few questions like When does ratings will change and in my profile under contests it isn't showing anything. vovuh take part in at least two rated rounds (and solve at least one problem in each of them) Since it was my first contest, will my ratings change or not?

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

I've seen a few hacks where the hacked solution contains a statement like "if(n == x) print y" and the hacker just gave x as an input and hacked the solution. Obviously that hacker had himself uploaded the hacked solution from another id. Afaik, after the contest is over, you do not gain points for the hack, so why would anyone do this? Is there any advantage you gain or what?

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

    May be they like to read word "Successful hacking attempts"

    There is no other benefits

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

When will my rating get updated? I've only participated in 1 competition before and my rating after that was 1399. It's been a while since this round ended but my rating hasn't been updated.

In the above blog it says Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you.

So, I will be rated right?

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

    Yeah, you will be. Don’t worry. You might just not show up on the official rank list until you give two rated competitions.

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

https://codeforces.com/contest/1335/submission/76667274 Question E: My idea is to find all x(p times)y(q times)x(r times) strings[x maybe equal to y] then find maximum, which can be solved in O(26^2*N). Test 111 of 2 is failing and I saw none who implemented it. Can anyone please find fault in my code or logic? Thanks In Advance

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

can anyone help me to find my errors.Here is my submission 76673853

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

Finally, solving sudoku in newspapers helped me here. Solved Div3 D within 14 min from first read.

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

Это конечно классно, но давно тырят решения на ideone и как? Я давно не участвовал, тут решил залететь, а сегодня получил сообщение о том, что у меня решение совпадает с участниками (и отдельно написали про ideone). Я почекал аккаунты — тупо какие-то боты, которые, похоже, тырят решения с ideone. https://vk.com/magikek?w=wall-163118470_2584 — в своем посте чуть подробнее расписал. Может кто-то поделиться опытом, что потом происходит?

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

Can anyone try to hack those $$$O(200nlogn)$$$ solutions in D2?
I can only hack some slower ones in them, and I think the others should also be hacked.

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

How can I hack my code after the Open Hack Phase ended? The 'CUSTOM INVOCATION' doesn't allow me to upload my input (file size:781KB) or gerneration code.

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

    It's impossible to hack after the hacking phase unless you are in div.1

    Also, the size of manual input cannot exceed 256KB.

    You can test it locally.

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

      Oh, I got it. Actually I prefer to do offline test. But there is a huge time difference between the offline and online test, especially when doing some stress tests. I have tried to tune my command line when compiling, but it doesn't help.

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

Hello vovuh, all of my solutions got skipped because of my code coinciding with my own submission for problem D, how is this possible? All I did was slightly alter my code for D and resubmit it because I thought it may be wrong, am I not allowed to do this? Can you please fix this issue, I don't want this round to be unrated for me.

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

    Some participants received an erroneous notification that their code matches their own code, this will be fixed.

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

Hi I received a mail saying that my solution to 1335C significantly coincides with another of my own solutions. Actually, the first time I submitted, it got accepted, but I later noticed that there is a minor mistake in my solution (I started a for loop with Index 0 instead of with Index 1). So I corrected it and submitted again, and it was accepted again. Please look into this.

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

Hey there, This is Abhishek. I am writing this regarding same looking submissions problem. Two of my solutions were copied by someone from internet and were submitted resulting in me being skipped from the contest. It was first time for me to solve five questions and i was really excited as i got a good ranking and my rating would go high. But after this they are likely to sink to bottom for something I am not at full fault. I can prove the originality and proper evidence to support my case. If there could be any help, then please help me out as it would be really discouraging to see a decline in ratings and be labelled as cheater.vovuh

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

What is this ? Why my code is skipped? Comparing with my submission & my submisson system skipped my code,it it joke?

Attention!

Your solution 76599020 for the problem 1335E2 significantly coincides with solutions KamruL_Hasan_/76599020, KamruL_Hasan_/76605786. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

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

Attention!

Your solution 76607973 for the problem 1335E2 significantly coincides with solutions TTMMM/76607973, TTMMM/76608322. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

PLEASE SEE, BOTH CODES ARE SUBMITTED BY TTMMM DURING THE CONTEST. KINDLY RECTIFY THE BUG. **** MikeMirzayanov vovuh

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

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

When will rating change MikeMirzayanov vovuh

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

My rating didn't increase till now?? Any one whose rating changed?? till now?

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

    Rating are not likely to be updated until the self-coinciding issue is fixed

    Please be patient.

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

Your solution 76579396 for the problem 1335D significantly coincides with solutions Joshua_Ali/76579396, Joshua_Ali/76592334. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

I've just received 2 emails saying that my submission looks like another solution on the same problem, but the real problem here is that the other code is also mine.

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

vovuh mistakenly I sent my solution for E1 twice and now I get message from system that my submission [submission:Ebiarat/76592056], [submission:Ebiarat/76592646] is the same so it’s was blocked. What should I do ?

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

为什么还没更新rating啊orz

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

Can I know when does the rating change in result of this contest?

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

Today I've got an interesting masage from codeforces: Attention!

Your solution 76548547 for the problem 1335E2 significantly coincides with solutions oleh1421/76548547, oleh1421/76549567. Such a coincidence is a clear rules violation.

Well,as you can see, both of those solutions are my, so... does this realy violates the rules?

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

hey!! is there any way I could get test case 50 of the problem F. I am getting a wrong answer there and its really irritating. Cant figure out where i am wrong.

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

why are ratings still not updated???

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

I have participated in this contest but this is not appearing in my contests list. And my rating is also unchanged. Why is this happening?

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

Why my rating still does not change?

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

I have participated in this contest ..but my ratings are unchanged. Also there is no data available about the participation in this contest on my profile

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

    yes the ratings are not updated yet! just wait they'll update the ratings in some time then it will also be displayed in your rating graph. :)

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

I am getting TLE on different test cases on the same solution for E2. The only difference was just a white space. How is this possible?.. The test cases were 55 and 34

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

    Running time is not absolutely the same for different runs.

    Your solution spent almost 2000ms for each run.It's natural to have TLE on different tests.

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

    Try to reduce your code's time complexity. I took a peak into your code, saw a lot of nested loops.

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

When will the rating changes?

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

Getting Runtime Error on Test Case 9 on this submission 76695733. Please someone point out the error

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

Hello.

As I am new to competitive programming and was coding in python so picked the same language for competitions. Can anyone recommend me good resources which helped you to learn ds and algo in (PYTHON) so that I can start learning it on the go?

Thanks in advance.

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

    Here are 2 steps to success :-

    STEP 1: Switch to CPP.(Otherwise, you will regret later)

    STEP 2: Google your problem.(There is an ocean of resources out there).

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

      Okay so I will learn C++ and yes for ds and algo in c++ there are good resources as compared to Python. Thanks

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

        As you said using python will make me regret later can you tell why?

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

          It is slower and you may get TLE in python with the same code you wrote in CPP. It is rare but frustrating.

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

I am new on code forces and my rating is 0 and in Codeforces Round #634 (Div. 3) I successfully solved 2 ques does my rating will increased #ma_da_fa_ka , #infinitepro

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

I have been sent a message that my solution overlaps with another account's solution. I want to note that I am the owner of both accounts. I am not sure if this is the right place to post tho.

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

    @MikeMirzayanov Hoping for both his accounts to be banned. It's clearly against the rules. No point trying to delete your message either now.

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

      The email that was sent to me was concerned with the fact that my solution was shared among other people. If both the accounts were my accounts and if I have proof that they're both my accounts and not someone else's, which I do by the way, I don't really believe that it's a "violation of the rules". The solutions were written by me and submitted by me. No one other than myself was involved in the process. If this still is a violation of the rules, then I apologize for it and I'll gladly accept a penalty.

      On the other hand, why don't we try to stay professional instead of throwing baseless accusations.

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

        You're stupid if you think having two accounts is not against the rules. I don't need to prove it to you because you clearly haven't been through them.

        EDIT: Read Q6 point 1

        EDIT: Actually, read the entire thing. Because once both your accounts are banned, you'll make a new one anyway. To not have that banned too, knowing the rules would be helpful so that people like me don't make the so-called "baseless accusations". Besides, read the message you see while registering for a contest first, and understand the fact that it's against the rules to participate with more than one account, and then come and tell me about my "baseless accusations".

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

          I guess it's my bad then. You are right, I will make sure to reread the rules again. Thank you for sharing this!

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

            It's not that people strictly follow the rules tho. You can find fake accounts every now and then with blogs being posted asking some question, or reporting cheaters, etc. Even if you have more than one account, make sure that you're secretive in not letting your real account identity being known. LanceTheDragonTrainer is an example, and many many more.

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

              The thing is, I made a second account just for practice and my real account for contests. My intentions were really not to violate the rules. I am happy you pointed it out though, I'll make sure to be more careful. Thanks again!

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

Will this contest be rated or not?

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

For problem E2 this code_1 got TLE but this code_2 got AC. The only difference in them is that in the second code the vector 'te' is declared globally. Can anyone please tell what is causing such a huge time difference?

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

Hi all, As I was not regular,I became unrated. But I did last div3 contest with just A. But not rated yet. How can I become rated again?

Thanks.

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

    Just submit a solution in any contest and get AC, you will be rated.

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

    First of all this is your first contest(Nobody becomes unrated).

    The only contest you participated has some issues therefore rating is not updated yet.Once they fix the problem you will be rated for the first time.

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

Did anyone hack the unordered_map solutions used in the contest? If so, what was the testcase used?

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

hey i am new to this i solved 3 ques in this earlier my rating was 1266 now its reduced to 1239 how?

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

    it does not matter how many ques you solved! the total time taken and obviously your rank matters.