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

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

2144A - Разрежь массив

Идея: BledDest

Разбор
Решение (BledDest)

2144B - Перестановка максимальной стоимости

Идея: BledDest

Разбор
Решение (BledDest)

2144C - Неубывающие массивы

Идея: BledDest

Разбор
Решение (Neon)

2144D - Ценники

Идея: BledDest

Разбор
Решение (adedalic)

2144E1 - Смотрим на башни (простая версия)

Идея: Roms

Разбор

2144E2 - Смотрим на башни (сложная версия)

Идея: Roms

Разбор
Решение (BledDest)

2144F - Группы скобок

Идея: BledDest

Разбор
Решение 1 (awoo)
Решение 2 (awoo)
  • Проголосовать: нравится
  • +50
  • Проголосовать: не нравится

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

is there any way to solve problem D in $$$O(n \sqrt{n})$$$, no right?

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

Problem E2 can be solved without any data structure more advanced than Fenwick tree (which supports increasing some value by $$$1$$$ and get a prefix sum of values).

$$$dp_i$$$ is the number of subsequences on prefix till $$$i$$$ such that the last element picked is $$$a_i$$$ and it's a record. Then $$$dp_i = \sum_{j \lt i: a_j = previousRecord} dp_j 2^{no. \ k: j \lt k \lt i, a_k \le a_j}$$$.

Let's introduce two arrays $$$le_i$$$ and $$$pr_i$$$. $$$le_i$$$ is the number of positions $$$j \le i: a_j \le a_i$$$ for $$$pr_i$$$ we would replace $$$a_i$$$ with the previous record.

Then $$$dp_i = \sum_{j \lt i: a_j = previousRecord} dp_j 2^{pr_i - le_j}$$$

$$$\frac{dp_i}{2^{pr_i}} = \sum_{j \lt i: a_j = previousRecord} \frac{dp_j}{2^{le_j}}$$$

So one can just maintain the sum of $$$\frac{dp_j}{2^{le_j}}$$$ for all records.

$$$le_i$$$ and $$$pr_i$$$ can be calculated with Fenwick tree.

338782926

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

For D:

First attempts. After fixing a value of x I tried to get the answer “almost in O(1)” — somehow compute the total new prices and the printing penalty in one go. In practice, without grouping items by their target price p, you keep losing track of what you’re adding to revenue vs. what you’re paying for extra labels. A full rescan over all items costs O(n) per x, which is too slow.

Think like a sieve. I remembered the Sieve of Eratosthenes: the work on step i is about N/i, so the total is N log N. Same philosophy here: on step x you process buckets — contiguous price ranges of width x. There are about A/x buckets. If you pre-aggregate once (prefix sums) so each bucket costs O(1), then the total over all x is A * (1/2 + 1/3 + …) = A log A. The analogy is simple: the sieve marks multiples; we “mark” contiguous ranges. In both cases, organizing work by natural groups gives you a harmonic series instead of chasing impossible O(1) per step.

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

$$$\log n$$$ is not real, it can't hurt you.

Got bit by it cause my solution for D was $$$O(n \cdot \log n \cdot \log n)$$$.

»
14 месяцев назад, скрыть # |
← Rev. 2  
Проголосовать: нравится -30 Проголосовать: не нравится

Title: Appeal: False Plagiarism Flag for Submission 338775909 (Problem 2144D) Hey MikeMirzayanov awoo adedalic Neon Roms BledDest, My handle is ishowguts. Submission 338775909 for problem 2144D was flagged as coinciding with submission 338766632, but I wrote all the code myself offline in VS Code with no collaboration. Development timeline & evidence: * First save: September 15, 2025 at 9:03 PM IST * Last save: September 15, 2025 at 9:54 PM IST * All file “last modified” timestamps in my local workspace reflect this period * I never uploaded or shared my code on any public IDE or platform during development * I implemented each function and logic block manually in this session 
Please manually review both my code and the other submission. If you need any more evidence, I am ready to provide it.awoo Thank you for your time and understanding.


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

    You are not fooling anyone. And, file stats can be spoofed. Your account is too new, and rising too fast. You submissions from previous contests are skipped too. So, stop spamming in each thread.

    P.S. I think CF should, optionally, allow linking to IDs on other CP platforms to prove authenticity.

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

      This is my 2nd I'd and for the authenticity part just check my codes and if you notice that something is fishy you can dm me or in the next contest maybe we can hop on discord call and solve the questions in front of you, so please don't comment without knowing the full picture and for the last skipped question i submitted the same code of my main account in this account as unrated at that time I didn't knew that even unrated contest also gets skipped, and when u check for official submissions ull not see any skipped submissions. Thank u.

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

        bro just quit it your code for E1 is basically unreadable almost no one other than some insanely high rated people write code like that, how hard is it learn some basics of CP and then give the contests honestly?

      • »
        »
        »
        »
        14 месяцев назад, скрыть # ^ |
         
        Проголосовать: нравится +4 Проголосовать: не нравится
        1. Alts are against the CF rules. Refer to https://codeforces.me/blog/entry/124418

        2. Really, dude? Did you look at both the submissions? All you did was rename some variables and make the formatting worse, somehow, and replaced '\n' with an endl.

        3. if(!(cin >> T)) return 0; what does this even do?

        4. The other account is clearly a temp account, probably made just to help others cheat.

        5. I see you have dabbled in several different programming languages. Python, C, Go, Rust, C++, etc.

        Why are you trying so hard on this lost cause? Did you want that Expert so bad?

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

Am I the only one who eventually came up with an O(N) solution for C, but doubted its correctness because N <= 100?

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

Why it take yall so long to post the editorial bruh im tryna get educated its an eeucational round twin

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

why c constraints so low if solution is so fast?? I was hoping to see a brute force solution. I like those.

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

I think there is typo in C editorial.. answer is 2^m.. where m tells number of type 1 pairs not number of segment of type 2 pairs.

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

My solution for E1 was slightly different than the one given in the editorial: 339030512

Is it possible to come to an optimization for E2's constraints using this E1 solution?

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

A bruteforce to check F is also OK. code

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

A bruteforce check can also pass F.

code

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

I have a few questions about C editorial. It's stated that "the answer is $$$2^m$$$ , where m is the number of segments of type 2 pairs.", but I think it's misleading as single type 1 pair is independent and can contribute to the result with $$$*2$$$ multiplier, so it's not only about type 2 segments? I don't quite understand the explanation for $$$2^{n-k}$$$ (merges), but the inverted calculation in solution code is more explanatory: $$$2^{k+1}$$$, where extra $$$1$$$ power is for the starting position (we can choose any order) and $$$k$$$ here is the number of such $$$i$$$ such that $$$a_i \geq b_{i - 1}$$$ (we can choose any order for $$$i$$$ position, but subsequent $$$i+1$$$ if it's type 1 pair is dependent on this chosen order and must adapt accordingly, we have no freedom there).

Also, is the following reasoning for "the answer will not change (since the $$$2^n$$$ subsets of indices we are considering will yield the same results after such a transformation, just in a different order)." part correct: we assume that all swaps start from ordered state (all $$$a_i \leq b_i$$$) and answer uniqueness rely on that if there are two swaps for the same position in the end, the result is that there were no swaps performed for $$$i$$$, i.e. the thing that we performed some operations at the beginning doesn't matter because we can revert them and this leads to same answer count?

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

For C, what about the case when a = 4 3 b = 5 7

Then there is no subset of indices after which the array would be in non descending order, but you say a subset would always exist how?

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

can anyone please guide me on how to optimize my code, my code is almost similar to the one in the editorial, but im getting TLE.

https://codeforces.me/problemset/submission/2144/356464257

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