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

Автор Vladosiya, история, 7 месяцев назад, По-русски

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

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

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

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

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

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

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

Задачи были придуманы и написаны нашей командой: myav, Gornak40, senjougaharin и Vladosiya.

Также большое спасибо:

  1. MikeMirzayanov за системы Polygon и Codeforces.

  2. SomethingNew, rniya, zwezdinv за красное тестирование раунда.

  3. makrav, snowysecret, AlexanderL, KseniaShk, pavlekn за жёлтое тестирование раунда.

  4. gigabuffoon, EgorUlin, KerakTelor, Pa_sha, I_love_geom, petyb, MinaRagy06, toniskrijelj, FynjyBath за фиолетовое тестирование раунда.

  5. Abo_Samrah, dan_dolmatov, pedrosorio, ezdp, azureglow, Chrisedyong, Apachee, arseny2606 за синее тестирование раунда.

  6. t0rtik, Sergey140146659, hader239, Modern за бирюзовое тестирование раунда.

  7. mkshh, petertromso за зелёное тестирование раунда.

Всем удачи!

UPD: Разбор

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

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

Waiting for that round. Hopefully, It will be a great round for me. Best of luck to all contestants :)

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

I hope This contest to be my promotion contest, I wish (:

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

Hoping for this contest to be easier than the last one.

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

As a green tester I can ensure green participants that they will enjoy this round!

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

Why's this not on the home page yet?

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

As a tester I hope, that contest will be very interesting for all participants!

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

good luck! >.<

remember to read all problem statements

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

As a tester, I hope that this contest will be enjoyed by all participants. Read all problems and good luck! ฅ^•ﻌ•^ฅ

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

Oh finally, it will be my first unofficial div3 round, I think I will enjoy it!!

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

Deleted

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

sory i can`t get a think in line 11 you sed"do not have a point of 1900 or higher in the rating." but in line below it you say "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 is that contest rated for experts or not ?

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

Ez Expert for me

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

At least we know that there will be no bitset problems :)

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

Waiting eagerly. Best of luck to everyone :)

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

I'm not welcome for Div.4 anymore so I must bring out my best in Div.3!

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

is this contest postponed??

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

Hoping to become an expert this round.

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

Waiting for this round...! Best of luck for everyone >_<

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

Good luck guys, Never give up......

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

what is the open hacks/hacking phase? pls explain

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

Need more div.2 rounds

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

As a tester, I hope the problems will be enjoyable for you!

»
7 месяцев назад, # |
  Проголосовать: нравится -8 Проголосовать: не нравится

For the life of me, I will never understand why a Div3 contest has 4 times the Expert+ testers as cyan/green testers. Who are these contests even aimed for?

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

    Probably because someone who consistently solves ABCDE in Div 3. will be an expert. I am guessing a candidate who performs at a performance that lets them stay in the upper end of Div 3. will only solve ABCD (fairly quickly), and solve E occasionally, so that leaves the hardest 3 problems not testable by people who are below experts.

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

Anyone else who just saw a message that the contest has started right now?

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

Good luck everyone!

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

As a late "as a tester comment", I beg for contribution

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

Hope it will be a great contest!

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

i'm not a tester :'0

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

Going to become Expert.

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

Never felt dumber with a div3C.

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

First time to solve till F, my best performance in div3 :)

Guess which problem took my time most
»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How to solve D ?

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

No promotion in sight again this time.

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

How to solve D ?

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

    Prime factorize every number and count all the primes. if all the prime count is divisible by n then yes

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

      How did u come up with this? Is there any reference?

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

        You can see that if we do the operation a[i] /= x and a[j]*=x then we are just moving one prime number to another number. so if we want to make all of the number same we have to have prime number count that are multiples of n.

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

        Think in such a way that every prime factor can be distributed over n blocks(size of array) and that too equally.

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

        Note that over any operation, product of all numbers is invariant. Thus, if the final state of all numbers is $$$g$$$, then $$$\prod_{i=1}^na_i = g^n$$$. Thus, for the final state to be achieved, product of all numbers must be a perfect $$$n$$$-th power. Turns out this is sufficient as well. (Why? Hint: Think of how primes will be distributed)

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

      would clarify the relation between N and number of all primes ?

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

    Find the prime factors of each element and count the total number of occurrences of each prime factor. If all the total number can be divisible by n, then output YES.

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

operation codeforces

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

Anyone found the A,B,C much annoying problems.. this div3 contest must have focussed on the problems D,E,F ... rather than keeping the participants to got stuck at A,B,C these days...!

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

C was so annoying , D < C

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

D, E, F were interesting but i found A a little difficult for div3 A unless there is a trick that i couldn't see. Edit: Thanks got it.

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

    A was just bruteforce, that is usually the case, you can just add s to itself a few times until you get to a fairly big size where you are sure the substr won't appear again and use .find() to check if m is a substring. The strings can only get to like 100 so checking till 200 does the trick.

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

    You could just naively check for at most $$$12$$$ operations or so. Time complexity would be $$$O(2^{12}nm)$$$ which is definitely not optimal, but anyways there are not too many testcases so it can't hurt to try too much

    UPD: $$$k=12$$$ got hacked, maybe try something smaller like $$$k=6$$$

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

    I only checked for 5 steps thats it.

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

Any Hints for F? I was finding max and smax ( max and smax will be maximum and second maximun marked node from children ) and considering maximum distance from a node will be max( max distance from children (max) , distance from parent + 1 (max+1 or smax+1) ).

  • »
    »
    7 месяцев назад, # ^ |
    Rev. 27   Проголосовать: нравится +8 Проголосовать: не нравится

    Problem F

    Hint

    Claim

    You don't need to calculate distance from every marked vertex. Just calculate distance from the two marked vertices x and y, such that distance(x, y) >= distance(i, j) for all pairs i and j where 1 <= i, j <= n' and 'i ≠ j. This is sufficient.

    Proof

    Let's assume that x and y are the two marked vertices with the maximum distance between them.

    Now, suppose there exists pair of vertices v and z in the tree such that distance(v, z) > max{distance(v, x), distance(v, y)}.

    We can claim that: max{distance(z, y), distance(z, x)} == distance(z, v) + max{distance(v, x), distance(v, y)} > distance(x, y).

    However, this statement contradicts the fact that x and y are the pair of marked vertices with the maximum distance between them. That means there's no such z and v.

    So, you only need to calculate distances from vertices x and y to satisfy the given condition.

    Formula

    $$$f(i) = max(distance(i, x), distance(i, y))$$$ where $$$(1 \le i \le n)$$$ and $$$(x, y)$$$ are the two marked vertices with the maximum distance between them.

    Time complexity: O(n) at most 4 tree traversal. two for finding (x, y). two for calculating distances.

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

What is the level of complexity of problem E in terms of rating? Is it like the 1600 problem?

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

in B taking GCD is giving wrong answer on 3 test case whereas taking min is accepted. Can any one please explain why gcd is not working

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    a %= b;
    return gcd(b, a);
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t;
    while (t--)
    {
        ll a, b, c;
        cin >> a >> b >> c;
        int hola = 0;
        int x = gcd(gcd(a, c), b);
        hola = (a / x - 1) + (b / x - 1) + (c / x - 1);

        if (hola <= 3)
            cout << "YES\n";
        else
            cout << "NO\n";
    }
    return 0;
}
»
7 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I feel A, B and C were problems from div2.

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

Many of F solutions have been done using some segtree, or dp....
But mine i just did tree trimming....

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

i feel E tests are weak (check my solution)

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

Can someone please explain what's wrong with this submission for question C — perfect square?

for 3rd test case I am getting 179 (instead of 181) as the minimum number of operations but the 90-degrees clockwise rotation of the changed matrix is giving true, can someone please tell me what is wrong with my code?

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

    You got the basic idea right, but you failed to account for the fact that the increase operation might be cyclic. Try doing the 2*2 case by hand to get the idea.

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

    I had similar solution and for elif case you may change traversed elements, so try to repeat the cycle and it worked out for me

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

      Ya, same thought just crossed my mind, "for how may times should we cycle through it?"

      I mean time complexity wise, how should we calculate the upper bound, mathematically?

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

        2 times will be enough, so complexity is the same

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

          but how did you decide that 2 times will be enough, like how do we know that there's no third order alphabet lingering around?

          I mean, I am looking for more concrete approach or proof then just hit and try method.

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

            you cant change from B->A, so you reverse all cases like that on first cycle and on second cycle it will become A->B problem

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

Hi can anyone help me check my solution for D why it WA3? I had to change the loop to a get prime factorial function but I don't see where this one goes wrong. Thanks in advance https://codeforces.com/contest/1881/submission/227896125

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

    you should write clear code and use different variables , your loop conditions might get altered because of value of n.

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

    You're only storing the factors which are <=1000. But there maybe factors >1000 for the given constraints. Try as an example [2182, 2186], the output should be NO, but your code gives YES.

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

It is very sad to say that I have solved B and C, which is normal for a 'pupil', BUT I couldn't pass A :(

Can someone tell me which test case can spoil my code ? 227915244

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

    most probably try larger value of i, like 5 or 10.

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

      I have tried after the contest and got wrong answer. 227927816

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

      Can you try this?

      My Code

      Also please note, it's a logarithmic function.

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

        Yeah! I replaced my check function with

        bool check(string s1, string s2) {
            if (s1.find(s2) != string::npos)
                return true;
            return false;
        }
        

        And I got accepted. Thank you

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

    If x="abc", s="cabcab", your code will get a wrong answer.

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

      Isn't the answer 2 ?

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

        Sorry, I gave a wrong example. I think you should modify your check function. Once s1[i]!=s2[j] and j!=0, maybe you should change i to i-j+1.

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

          I tried to use this:

          bool check(string s1, string s2) {
              if (s1.find(s2) != string::npos)
                  return true;
              return false;
          }
          

          And it works. I am so sad for what I did. It is a silly mistake :( I hope I don't turn to grey again.

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

        For example, if x="abcabcabd", s="abcabd", your check will fail when i=5, j=5, and then you only change j to 0, but i is still 5, which makes you can't find the right match: i=3.

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

    How did you solve B >_<

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

      Your goal is to make all values similar to the smallest value in the given array. This makes you use less steps otherwise, you need to use more than 3 steps for sure. Let's call the smallest value in the array ('mn'). Also you have to make sure that all values in the array are divisible by 'mn'

      Check my code 227853520

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

        Can you please explain this test case 4 4 12

        How can we break 12 into {4,4,4}? If we are dividing into equal parts 12 should be broke into {6,6} not {8,4}.

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

          I got it; they never told we have to divide it into equal parts. I just got confused by the first example 5 into {2,3}, hence was doing {n/2, (n+1)/2}.

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

    I usually solve problems in order, but I couldn't solve A at first too, solved B and C first, then in the last 10 minutes, I made some changes and was able to submit A. It completely fucked up my penalty time though. More than triple of what it usually is.

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

is the contest not rated for div4? made account on cf few weeks back and still a newbie, though i solved 2 problems but my rating didn't change

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

    ratings update is tmrw

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

    It doesn't change instantly, you should wait for the testing phase firstly, and hacking phase secondly, then you should wait for some while maybe for 0 to 72 hours to get the rank updated.

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

Can't you speak English?Is your questions translated by AI?

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

A — Annoying.

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

balanced contest overall. it's disappointing i wasn't able to solve E because i haven't learned dp yet :(

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

Can problem F using bfs many source?. I can't implement it during the contest

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

I felt that today's E was similar (in terms of statement, not solution) to 1798E.

Also, great problemset!

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

Is there a more elegant way to solve F than some very annoying-to-implement tree DP? (Check my submission for my details)

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

How to solve C?

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

    let ip= n-i-1 , jp = n-j-1. cells with indices (i,j) , (j,ip) , (ip,jp) , (jp,i) should be equal for each 0 <= i, j < n

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

      can you tell what is wrong is here:

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

        Update, solved the issue:

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

Can anyone tell me the 371st test for test case 2 in Problem G?

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

If someone prefers video explanations or interested in knowing how to think in a live contest or reach to a particular solution.
Here is my live Screencast of solving problems [A -> E] (with detailed commentary in Hindi language).

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

Why are there so many hacks on A? What is the hack?

Also: https://codeforces.com/contest/1881/submission/227851818

This looks kinda sus, to escape plagiarism checker?

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

      tried random tests using that logic but it hit file size limit and smaller tests aren't hitting time limit but had 3 hacks using the smaller one

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

    He's definitely a cheater, I see no point int having an infinite while loop with a break statement.

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

Is my solution for problem A hackable

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

Nice ProblemSet :)

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

The maximum possible answer in problem A will be log2(m)+1 . Isn't it?

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

Maximum possible answer in problem A can be log2(m)+1 . Isn't it?

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

A,B,C,D were tougher than usual div3.

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

Code for generating a testcase to check TLE for problem A

https://ideone.com/c8Rs0m

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

Is using unordered_map in D correct? Shouldn't it give tle? https://codeforces.com/contest/1881/submission/227902139

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

    It's fine. Input constraints guarantee there are at most $$$10^4$$$ values, each less than or equal to $$$10^6$$$, which means up to 20 factors per value ($$$2^{20} > 10^6$$$), so a total of ~200,000 prime factors to add to the map.

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

does hacking reduce points in this round?

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

I think problem F is to find the spanning tree connecting the selected vertices and then get the diameter r->(r+1)/2 as the result but I don't know how to code it. is my idea correct??

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

    Yes, the idea is correct. Maybe you can use the fact that on the smallest tree spanning the marked vertices, every leaf node MUST be a marked vertex. So, root the tree on some arbitrary marked vertex, and trim the leaf nodes until all leaf nodes are marked vertices.

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

I had the idea for the problem F but ran into a bug and ended up wasting my time :3

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

A friendly contest to beginners! Although my B FST... :|

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

nvm i got it

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

everyone seems to be overcomplicating B observation: we can divide a, b, c each into threads of size equal to the greatest common divisor of a, b, c. this will always be optimal therefore, the number of operations would be equal to: ceil((a + b + c) / gcd(a, gcd(b, c)) / 2) (it only takes 1 operations to split into 2 equal threads

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

Hello everyone, I am in bit trouble, I have tried to solve the first question of the contest but I am unable to debug it up. If anyone can help me, I will be very thankful. Thanks My submission

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

Why this code always work for Problem D?


void solve() { double n; cin >> n; double m = 1; double s = 1.0 / n; f(i, 0, n) { int x; cin >> x; m *= pow(x, s); } // cnl(m); double a = ceil(m), b = floor(m); if (abs(m - a) < 1e-6 || abs(m - b) < 1e-6) cnl("YES"); else cnl("NO"); }
  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    It's doing the same thing as other's have mentioned above. If the answer is yes, m will be an integer the way it is being calculated

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

Question A: What data can be used for hack

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

Question A: What data can be used for hack

  • »
    »
    7 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    cout<<10000<<"\n";
      for(int i=1;i<=10000;i++)
      { cout<<"5 5\n";
        cout<<"abcde\nabcdr\n";
    
      }
    

    ^ This could TLE the ones with already high execution times because they concatenate "abcde" with itself a large number of times along with using a string.find() for a substring with lots of partial matches.

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

Hello, how do I solve 1881G - Anya and the Mysterious String with Segment tree using Lazy propogation? This is what I've done 227967016, I haven't used Lazy propogation and it's TLE.

Thank you in advance.

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

Hackforces again ;)

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

problem A was very bad for div3.

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

Can anyone check this i am getting wrong answer in test case 4 for Problem G

here's my submission : 227971449

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

Problem C was interesting.

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

My rating is 369 and i participated in round903div3 contest. i solved question A but it didnt increased my ratings also the contest history is showing me in unrated section of my profile. Why this round was not rated for me?

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

    Its a bug, it will be updated in a few hours.

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

      Its not updated yet?!! What to do now! My rating is remaining unaffected.

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

        Usually its not this late. Just check the contest tab of other participants, If they got rating for the contest but you didnt, then you should make a new thread about it.

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

My solution was hacked yesterday, again I submitted the same solution and it got accepted. Do the test cases used in hacking not get added to the main test-case?

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

problem F is really beautiful and educational; Approach : 1) run dfs from any arbitrary node to find node(say node1) which is marked + at max depth; 2) run dfs considering node1 as root and find max possible depth(say d) for a marked node; 3) ans = ceil(d/2) or simply (d + 1) / 2

227980372

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

can anyone tell me was this contest rated for newbies too , bcoz i don't see any change in my ratings ???

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

    Yes it is rated for people with rating under 1600. 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.

    By the way I am also waiting for the rating changes(not my best div3).

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

Can someone explain Problem E as dp state transitions in detail and also suggest similar problem please

Thanks.

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

Can someone please explain E. Block Sequence as dp states please and also suggest similar problems

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

    Let $$$dp[i]$$$ denote the minimum number of deletions for the suffix starting on the $$$i$$$-th element: $$$a[i..n]$$$. Base case will be $$$dp[n + 1] = 0$$$.

    For $$$dp[i]$$$, we can either delete or take it. If we delete it then $$$dp[i] = dp[i + 1] + 1$$$. If we take it, then the problem reduces to the suffix starting on the $$$j = (i + a[i] + 1)$$$-th element: $$$a[j..n]$$$. So $$$dp[i] = dp[i + a[i] + 1]$$$. We take the minimum.

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

Can anybody help me figure out why there is TLE in this solution (Problem D)?

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

    you're re-intitialising your 'facts' array for every test case. it would be the same every time.

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

      Why so? The prime factors would be different for every test case(In 'facts' I am storing the count of every prime factor, which has to be different for every test case). However, the prime factors would be the same up to 1e6 which I have already pre-computed.

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

    Ignoring TLE, your solution is wrong. For the test case $$$[7, 13]$$$, it outputs "YES" when it should be "NO".

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

      Yes, I figured out the reason for the wrong solution. I am checking up to n(size of the input array), while I should be doing it up to 1e6. However, still, I am getting TLE solution

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

        You're going to be doing that for every testcase though. So it'll require at least $$$2e9$$$ operations when $$$t = 2000$$$. You can use map/hashmap to keep count of the primes factors.

        Ignore below, it does work.

        Though even then, I'm not convinced you won't TLE in later testcases.

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

It's too hard.

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

THIS CONTEST REALLY MADE ME TERRIFIED TO CONTINUE COMPETITVE PROGRAMMING

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

Your prayers for Gaza :(

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

It was a nice contest , i have a lot of silly mistakes , but still it was a quality contest

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

Where is my rating? How could you ignore a beautiful oily man with avatar girl!

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

What's up with the rating? System testing got completed hours ago?

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

why this round is unrated but the annnouncement said it's rated?

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

My current rating is 656, I participated in this round and solved 3 problems, as my rating is below 1600 this round should be rated for me, but when I check the graph in profile, it shows as unrated, can someone please explain why it is so, Am I missing some condition here?

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

    From my point of view and experience with codeforces I would say that the ratings are not ready yet.

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

    For every rated contest, until the ratings are given, the contest shows up in unrated tab.

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

why it's not rated yet?

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

when the results will be out??

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

I realised there can be only one or none prime factors greater than sqrt of that number!

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

I became expert :)

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

Эх, чаль что я не поучаствовал!!!

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

The problem F of this round was a subproblem of this problem https://lightoj.com/problem/farthest-nodes-in-a-tree-ii. So finding diameter is a common problem and many of us know the solution for finding diameter. It was just finding the minimum distance among the maximum distances from those colored vertices. So if a diameter finding solution coincides with another person's solution how this will called a plag?

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

    Please check the above circumstances and reconsider the issue of plagiarism. It was not my fault.

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

Hello Codeforces, I had a message few minutes ago which says that "Your solution 227917247 for the problem 1881C significantly coincides with solutions 2020331050/227912904, dingD0ng/227917247" & "Your solution 227916835 for the problem 1881B significantly coincides with solutions 2020331050/227869923, dingD0ng/227916835" & "Your solution 227916500 for the problem 1881A significantly coincides with solutions 2020331050/227872918, dingD0ng/227916500". First of all I want to apologize as I was completely unaware of the rules and guidelines. I confirm that both of the accounts are mine and I made the same submissions during the "Codeforces Round #903(Div. 3)" contest for both of the accounts. Sorry for my action. This kind of act will never happen again in the upcoming days.

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

Hello Codeforces, I had a message few minutes ago which says that "Your solution 227917247 for the problem 1881C significantly coincides with solutions 2020331050/227912904, dingD0ng/227917247" & "Your solution 227916835 for the problem 1881B significantly coincides with solutions 2020331050/227869923, dingD0ng/227916835" & "Your solution 227916500 for the problem 1881A significantly coincides with solutions 2020331050/227872918, dingD0ng/227916500". First of all I want to apologize as I was completely unaware of the rules and guidelines. I confirm that both of the accounts are mine and I made the same submissions during the "Codeforces Round #903(Div. 3)" contest for both of the accounts. Sorry for my action. This kind of act will never happen again in the upcoming days.

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

Dear Codeforces Support Team,

I hope this message finds you well. I am writing to address a matter regarding my Codeforces account, specifically concerning the alleged code matching with multiple accounts. I would like to request a reevaluation of the situation and kindly ask for your understanding in this matter.

I understand that my solutions to certain problems have coincidentally matched with the following accounts: gjbbezzatihaiyaar/227857690, under_coverR/227890206, ambrosedean351/227901106, tester70/227901152, omarAsem/227902674, aman30/227902964, Xeroc/227905146, Sandi03/227905202, gaurav_4859/227905957, baburao_apte/227907553, aswer03/227910416, realshady105/227911556, mastercheif/227913841, jamesbonr123/227914312, abhi_0804/227918471, zozozrabbit/227921240, Bkapil1234/227922870, soumasingh41/227923532, legolas12/227924461.

I wish to clarify that the code matching with the account zozozrabbit/227921240 is due to a mistake on my part. This is alternative account that I use for practice, and I inadvertently submitted the same code from my original account, kumar.adit456/227921671, during a contest to avoid penalties. The matching of the code with these accounts was not intended and is purely coincidental.

I would like to emphasize that the similarity in the code is mere coincidental as i have a unique boilerplate that I commonly use for problem-solving. I did not engage in any form of plagiarism or misconduct intentionally. My intention has always been to uphold the integrity of the Codeforces platform and to learn and grow as a programmer.

I kindly request that you reconsider the situation and, if possible, reevaluate the matching of my code with the other accounts mentioned above. I hope you will understand that this was an unintended error and allow me to continue participating in contests and maintain my original rating on my main account, kumar.adit456/227921671.

I am committed to adhering to the rules and guidelines of Codeforces and ensuring such errors do not happen in the future. Your understanding and support in this matter would be greatly appreciated.

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

Dear Codeforces Team

I am writing to address a recent issue that has arisen on the Codeforces platform. My username on Codeforces is "Basecat," and I would like to clarify that I am also the owner of the account with the username "Bkapil1234."

During a recent contest, I made an unfortunate mistake where I accidentally submitted the same code on both my accounts, "Basecat" and "Bkapil1234." This has led to an accusation of code plagiarism from the account "Basecat." However, I want to emphasize that both accounts belong to me, and there was no intention to copy or plagiarize any code from other participants.

The match of solution to problem E with other users is a coincidence and i didn't intentionally copy the code from any other user.

I understand that the Codeforces community takes plagiarism and cheating very seriously, and I, as a Codeforces user, fully support the principles of fair competition and integrity. I would like to apologize for this accidental double submission, which has led to confusion and concern within the community.

I kindly request that you review the situation and consider my explanation. I hope that you can clear any misunderstandings and confirm that there was no malicious intent involved. I assure you that I am committed to upholding the highest standards of fairness and ethics on the Codeforces platform.

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

Hello Codeforces Suppot, Yesterday I got a message for the support team which goes:- Attention!

Your solution 227918471 for the problem 1881E significantly coincides with solutions gjbbezzatihaiyaar/227857690, under_coverR/227890206, ambrosedean351/227901106, tester70/227901152, omarAsem/227902674, aman30/227902964, Xeroc/227905146, Sandi03/227905202, gaurav_4859/227905957, baburao_apte/227907553, aswer03/227910416, realshady105/227911556, mastercheif/227913841, jamesbonr123/227914312, abhi_0804/227918471, zozozrabbit/227921240, kumar.adit456/227921671, Bkapil1234/227922870, soumasingh41/227923532, legolas12/227924461.

Firstly I want to apologize that such thing got up , but is a clear coincidence of code matching since the implementation of the E problem based on DP was so short and merely of 15 lines code having standard approach hence having a high probability of the approach being followed by others too And that too if the approach may closely ressemble with those of others the style of writing the code of mine is different(cna be clearly seen by seeing the submissions of the other account mentioned int the message above)

i know codeforces is a platform/community of coders which is against plagrism and I too support that the contest must be fair . hence I plea the codeforces support to kindly consider the plea(as a mere coincidence) . Hoping for a positive revert

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

@MikeMirzayanov

I received this message yesterday.

Attention!

Your solution 227895218 for the problem 1881F significantly coincides with solutions ShattajiT_/227895218, slim_vai/227902843. 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.

The problem F of this round was a subproblem of this problem https://lightoj.com/problem/farthest-nodes-in-a-tree-ii. Here is the solution of this problem https://pastebin.com/gQGWF7kG . My solution for this contest's problem F is quite similar, I just changed some conditions and took minimum of those maximum calculated distances. Here is the solution: https://codeforces.com/contest/1881/submission/227895218. So finding diameter is a common problem and many of us know the solution for finding diameter. It was just finding the minimum distance among the maximum distances from those colored vertices. So if a diameter finding solution coincides with another person's solution how this will called a plag? I participated in so many Codeforces's contests. I know the rules of violation. I didn't use ideone in contest time. Please check the above circumstances and reconsider the issue of plagiarism. I have been trying for so many days to improve my ratings and it will be frustrating for me if you revoke my rating for this contest. Count on it.

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

Waiting