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

Автор yunetive29, история, 7 часов назад, По-русски

Спасибо за участие в раунде! Надеемся, что задачи вам понравились!

Автор и разработчик yunetive29

2059A - Миля и два массива

Решение
Реализация

2059B - Стоимость массива

Автор и разработчик yunetive29

Решение
Реализация

2059C - Обслуживание клиентов

Автор и разработчик yunetive29

Решение
Реализация

2059D - Граф и граф

Автор и разработчик yunetive29

Решение
Реализация

2059E1 - Хватит гамать (простая версия)

Автор shfs и разработчик yunetive29

Хинт 1
Хинт 2
Хинт 3
Решение
Реализация

2059E2 - Хватит гамать (сложная версия)

Автор shfs и разработчик yunetive29

Решение
Реализация
Разбор задач Codeforces Round 1002 (Div. 2)
  • Проголосовать: нравится
  • +48
  • Проголосовать: не нравится

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

Автокомментарий: текст был обновлен пользователем yunetive29 (предыдущая версия, новая версия, сравнить).

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

Auto comment: topic has been updated by yunetive29 (previous revision, new revision, compare).

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

Wait your released the editorial with code 30 minutes before round ended? That's absurd!?

EDIT: My apologies. I had a gap in my knowledge.

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

Skill Issue. I only solved AD lmao

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

    creative issue? Codeforces usually have some creative problem.

    First time i joined Codeforces also struggled with these "creative problem"s

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

      If you mean that I'm creative to solve AD then no because D is standard asf

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

        I mean B,C require some creativity or just familiarity with codeforces problem.

        Yeah D is standard, just scary at first read.

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

        Hey can you tell me how is it standard?

        Are there any similar problems or blogs on this approach?

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

          Cause it uses djikstra algorithm as the main solution.

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

            Just because a solution uses an algorithm doesn't mean the problem is standard. With that said problem D is pretty standard.

            • »
              »
              »
              »
              »
              »
              »
              4 часа назад, # ^ |
                Проголосовать: нравится 0 Проголосовать: не нравится
              1. My argument would be djikstra appear frequently in many contests.

              2. I'll also add the solution only differs a little bit from a well known algorithm. bonus points if it doesn't require modification.

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

          I am not sure but I mean it's just a no brainer I guess I can't use the right words

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

            I guess I got it, it's easy.

            the Djikstra with a 2D state was just a bit confusing to visualize to me.

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

      Any suggestions on how to solve or atleast approach those creative problems?

      • »
        »
        »
        »
        5 часов назад, # ^ |
        Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится
        1. Try solving easier cases first, usually starts with n=1 after you're comfortable then generalize the solution. If you check my submission you can see how i worked from easier case, though it's not a beautiful submission. 304090629

        2. Try learning some quirks of certain problem, like "n is even", bitwise XOR/AND/OR, MEX. They usually share some similarity in approach.

        3. Practice alot of codeforces problem, if you plan to stay.

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

          Thanks for your suggestions. I cannot understand your quirks point. Do you mean to say that if "n is even", then we can use bitwise XOR/AND/OR, MEX somehow or anything else?

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

            no, many of the creative problem usually have some constraint that may contain hint to solving it.

            if n is even:

            usually i try to divide the array into 2 parts

            or maybe in different question, divide the array into n/2 2-sized sub-array

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

    Spend 1 hours to find a case of ans 3 in B :(

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

    how did you manage to go from 2100 to 1600! concerning.. any advice?

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

Автокомментарий: текст был обновлен пользователем yunetive29 (предыдущая версия, новая версия, сравнить).

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

I personally felt problem B and C were nice! (even though problem B ruined my contest lol) Simple ideas, yet tricky!

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

304115975,304141983,304098763 Can someone hack them

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

I am quite shocked how my B passed the system tests. I was checking for min max in a range but forgot to sort the vector d. I realised this mid contest and was pretty sure it would fail the system tests because I myself can think of countless test cases to hack it. Or is it because of some mathematical property I am missing? Could someone explain?

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

Дисбаланс задачи

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

Is it just me or B is unexpectedly hard today?

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

    I found it very tricky to find an error in my solution. The problem isn't hard, but you need to carefully check your output.

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

good contest , bad contest

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

    Why do people think it was a bad contest? Because D was GPT-able? That is not the problemsetters' fault...

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

      Why do you think it was a good contest? because you performed well?

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

        I didn't perform well. A was acceptable, B was also acceptable, C was good, and D was a bit standard but I enjoyed arriving at the conclusion. E1 was solved by a hundred people and E2 was unsolvable for Div. 2. What exactly is bad about this round?

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

      I think it's because b is harder than c to many people.

      And also too few question? (makes my hand sweaty)

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

Was stuck in reading B for a long time, Couldnt understand what

""such that each element of the array a belongs to exactly one subarray.""

meant Back to Pupil :(

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

my E1 Solution is much simpler than Tutorial : 304156702

just track the numbers you must push in next array by using queue

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

    I like your template.

    Unlike some other template that has 1000 lines just for unused code.

    Also smart solution.

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

For B, I spent 1hour to find a case of which the ans is 3 to hack my wa submisson then I reallized it's impossible :( (I have no enough time to finish C)

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

Just found out my mistake in E1.

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

Just found out my mistake in E1 :(

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

I wanna become an expert. I have come close quite a few times but missed the mark by inches. Please suggest some resources so that I'll be able to do Codeforces Div 2 Problem D in upcoming contests.

Thanks in advance!!

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

    Solve a lot of 1700-2000 problems, it's the only way. Use the filter in codeforces.

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

Everyone enjoyed the contest, but i am not. My contest was very bad. I have been feeling very bad for two days. :((

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

When I saw D and thought about Dijkstra with $$$V = E = 1000000$$$, I thought about doing some kind of "BFS0/1" instead. Then I guessed the distance couldn't be greater than $$$n\times n$$$ (guessed any reachable vertex can be reached in less than n steps, now I think it's actually 2n steps.) and did a BFS with $$$(n+1)\times (n+1) + 1$$$ queues. Hack here if it's wrong -> 304106582

Anyway, $$$O(n\ log\ n)$$$ for $$$n = 1000000$$$ and TL = 2s is the new standard?

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

A much simpler implementation of E1 304178286

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

can anyone explain the last sample testcase of E1.

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

can someone explain how the answer can be 3 for this test (for c problem):
4
4 2 2 17
1 9 3 1
5 5 5 11
1 2 1 1

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

i was thinking of trying e1 before D because of the score distribution,, glad i looked at the number of submissions ,,

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

In D. Graph and Graph
tutorial: "the number of edges in the new state graph will not exceed m1.m2"
I must be stupid, but please correct me.

The number of edges (E) in the new state graph will be of order 10^3(m1)*10^3(m2) i.e 10^6
The number of vertices (V) will be order n^2((10^3)^2) i.e 10^6.... though we may not visit all vertices here.

But the time complexity of Dijkstra with binary heap is
O(V*(Extract_Min) + E*Decrease_Key) = O(V logV + E log(V))
which here results to (10^6 * log2(10^6) + 10^6 * log2(10^6)) = 2*(10^6 * 20) = 4*10^7

Questions ?
- What am I missing here ?
- How many operations are allowed in 1sec ? if am not wrong is 10^6 simple operations(not %, /)
- How do we calculate time complexity here?
- How many operations are performed here ?

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

for the first problem, a = [2,2,3] => set of a has {2,3}, size=2; b= [2,2,3] => set of b has {2,3}, size=2; so total size >=4. But the answer is 'NO' only 2+2,2+3 or 2+2, 3+3 are possible. Am I wrong or the solution is wrong