Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

Автор O--O, история, 19 месяцев назад, По-английски

Hello, Codeforces.

Contest: SpeedForces

Time: [contest_time:418314]

Writer: O--O

Tester: JOIN_GROUP, E404_Not_Found, psychobot

You will have 8 problems in 120 minutes.

Problems are very interesting and problem statements are short.

Problem C and D had little mistakes in statement.

Problem F had mistake in sample.

Winners

1. Kirill22

2. Svyat

3. huangxiaohua

4. Kniaz

5. wery0

6. bitset

Did you like the contest?

Solutions are opened.

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

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

As a tester, nice problems. I recommend to participate.

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

what the problem rate for this contest?

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

I like your contests! (Mathforces was good)

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

What about the score distribution?

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

I will write it.

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

Are you sure that everything is fine with problem F?

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

Thanks for Saturday's workout!

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

I saw D on codeforces

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

Could you share Problem H solution? I thought of a solution involving set, however, seemed too complicated to implement, especially for 1 second execution time.

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

    My solution was to iterate k, and maintain a data structure for the products a[i]*a[j] for j < k. For each k, you can iterate p, and query the data structure for the number of pairs a[i]*a[j] <= x / (a[k]*a[p]). The complexity should be O(N^2 log N).

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

Condition F says that $$$n \ge 1$$$, but in test 4 $$$n=0$$$.

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

Shit of piece, not a contest. Only idiots will give penalty for WA on first test. Testers are also silly noobs — missed obvious bug in checker in F. Author is so lazy, that decided not write validator for tests, resulting $$$0$$$ appeared in fourth test in F.

SHITOFPIECEOFSHIT!

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

    Thanks bro

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

    Why so rude bro? Mashup contests will give penalty for WA on first test by default and the author can't change this setting, Also do not write any comment with alt account, at least be brave for writing your comments with real account. wery0

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

In problem D, does the player have to delete all the substrings or just one? If s = "abababa" and t = "aba", does s become "b" after the 1st move or a player can choose? Why wasn't it specified in the statement or at least in samples?

»
19 месяцев назад, # |
Rev. 2   Проголосовать: нравится +4 Проголосовать: не нравится
ll p = 1000005;
ll dp[p];
for(int i=0;i<p;i++){
  dp[i] = INT_MAX;
}
dp[1] = 0;
for (int i=2; i<p; i++) {
   dp[i] = dp[i-1]+1;
   for (int j=2; j<10; j++) {
       if (i % j == 0) {
            dp[i] = min(dp[i], dp[i/j]+j);
       }
   }
}

Link to sol: Soln

In problem E, just traversing inner loop from 2 to 10 passed the test cases. Just wanted to make sure if there is some logic behind this ? Since in the ideal solution, we should have checked for more than that, as given below

ll p = 1000005;
ll dp[p];
for(int i=0;i<p;i++){
  dp[i] = INT_MAX;
}
dp[1] = 0;
for (int i=2; i<p; i++) {
    dp[i] = min(dp[i], dp[i-1]+1);
    for (int j=2; j*i<p; j++) {
        dp[i*j] = min(dp[i*j], dp[i]+j);
    }
}

Link to sol: Soln

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

    Because we can construct a small answer as the upper bound.

    For example $$$n=131071=(11...11)_2=2^{17}-1$$$,we can construct a scheme:

    $$$*2 \rightarrow +1 \rightarrow...(16 times)$$$

    We can simply see that the upper bound of the answer is $$$3 \lceil log_2(n) \rceil$$$.

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

I used segment tree in problem B, and ACed, but felt it was kinda dumb. Anyone thought of anything smarter?
my submission: [submission:186634062]

Help pls :P
thanks in advance.
  • »
    »
    19 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

    Just keep array elements (let's call each element as $$$a_{i}$$$) and the value of xor of all elements (let's call it $$$X$$$), then after each query do this : Do $$$X$$$ xor $$$a_{i}$$$, after that replace $$$a_{i}$$$ with the integer given in query, and then do $$$X$$$ xor $$$a_{i}$$$ and print the answer. The point is when you xored a number and you want to remove it from xor you should xor with that number again, cuz it's like when you xor even times with a number, it's like you haven't added it to xor.

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

Find smallest $$$k$$$ that $$$\log_x k=\sqrt[x]k$$$.

Wait... when $$$x=4$$$ shouldn't $$$k=16$$$ be smaller?

Did I misunderstand something?

Upd: I didn't see $$$=x$$$.

Upd2: nifek said that there was no $$$x$$$. It seems that O--O your team need better testers!

Upd3: I'm really curious about it is something wrong with the statement or with the solution.

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

    = x as well, that wont be = x

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

      Sorry, I didn't see that.

      Sorry for wasting your time.

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

        The author edited the statement, you were correct, there was no = x

        O--O please at least give credit to those who find mistakes in your problems and dont make them look dumb, stop just silently editing

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

          I think = x made the problem very obvious, so maybe he decided not to include it.

          Although, he should clarify this himself.

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

      didn't see =x at first either.

      but now if consider =x, shouldn't that k be unique? how about smallest

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

Any one better idea for F? Im getting TLE

My solution: https://codeforces.com/submissions/_Aryan_#

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

How do find more updates on these unrated contests?