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

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

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

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

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

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

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

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

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

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

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

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

  2. imirdy за красное тестирование раунда.

  3. Be_dos, KseniaShk, pengin_2000, Eugene312 за жёлтое тестирование раунда.

  4. Kmes за фиолетовое тестирование раунда.

  5. RobinFromTheHood, AlphaMale06, Kosya, itz_pabloo, umezo, donovilia2007, l-_-l за синее тестирование раунда.

  6. rcht, zoro2000, ne_justlm, IceHydra за бирюзовое тестирование раунда.

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

Всем удачи!

UPD: Разбор выложен!

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

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

First unrated Div3 :D

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

Finally after 2 years on cf, i am able to post this picture!

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

Interactive problems.. Where?

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

Overlaps with NAC :(

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

Yeaaaah! Vladosiya Div3 rounds are back <3

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

Have we stopped the authors snap trend? I don't see it anymore in recent blogs.

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

Is there any interactive problem jn the today contest

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

I wish we could have a

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

Thanking everyone working behind the scene to make these contests possible. Hoping for a positive delta ♥

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

Good luck! And get postive $$$\Delta$$$.

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

Please tell me I'm not the only one who found the B problem harder than the C problem.

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

submitted F 10s before and still Wrong answer :(((

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

I enjoyed the contest, especially problem $$$F$$$

Thank you for this contest ^_^

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

C and E were nice, B and D were gay. Thanks for the round.

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

The lesson I learned from this is not to participate in contest when I have a fever :(

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

can someone confirm if there is a way to solve F like this?

let the prime factorization of $$$ x = {p_1}^a * {p_2}^b * ..... * {p_n}^c $$$

and $$$ y = {q_1}^m * {q_2}^n * .... * {q_l}^o $$$

Then suppose that none of the prime factor $$$ \gt k $$$, then we need to divide $$$ x $$$ by some factors and multiply by some. Let those be $$$ div$$$ and $$$mul$$$. Now, the problem is just to find minimum number of subsets of both these new variables such that in such subset $$$ product \lt = k $$$ but idk how to do this step. can someone help me?

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

Man, idk why i am getting wrong answer on test3 in F. wasted 10mins on debugging D where i was forgetting to take max with last index which was outside loop. I think i will be on edge of becoming expert :(.😭😔😫

Nice round though

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

    Me too, but then I realize that greedy was imcorrect, you should implement dynamic programming.

    My submission 321571955 here.

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

      can you explain your dp solution..thnkx

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

        We want to make $$$x$$$ by mul and div operations to $$$y$$$, so reduce the problem to make $$$x, \, y$$$ to an identical integer by only div operations.

        So let's precalculte the factors of integers not exceed $$$10^6$$$, $$$d(10^6) = 240$$$ (here $$$d(n)$$$ means number of factors of the number with the most factors which not exceed $$$n$$$). We only try to use factors of $$$x$$$ to reduce it.

        I use a dynamic programing which is like BFS, that can be convenient to finish dp. And at last, we only need to enumerate all the factors of $$$x$$$ to see if $$$y$$$ can be reached.

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

Why was this contest not rated for me?

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

What is the intended solution for problem F? My solution takes a bit too long to run.

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

For problem F, I reduced it to: 'Given a list of numbers, find the minimum number of groups such that the product of every number in each group is less than k.' But I found this problem hard any hints?

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

    these were the possibilities I thought of, and one of them ended up AC: dp, shortest paths, greedy. Think about it.

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

    https://cses.fi/problemset/task/1653

    But there is a way easier solution.

    Since I didn't come up with it myself, I won't explain it. Instead I'll just ping ludo. and tell him to explain it instead.

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

    It's funny because this problem is NP-hard. I also thought of this but the case $$$2^{26}$$$ made me rethink my approach. Anyway, the idea is basically

    $$$dp(i) = 1 + min(dp(i / d))$$$

    Where $$$d$$$ is a divisor of $$$i$$$ that is not 1 and is ≤ $$$k$$$. Also the base case $$$dp(1) = 0$$$.

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

      Btw the reason why this problem has an easier solution is because there is a small number of distinct states. For example, consider the bin-packing variation where we take the sum of elements (instead of product). You can encode the state of the problem as a frequency table of the numbers we have (using a hash map, for example). Then the number of distinct states are $$$\prod_i freq_i + 1$$$. As all numbers may be distinct we have up to $$$2 ^ n$$$ states. In the multiplication case we have exact same scenario, but as the product of everyone $$$\leq 10^8$$$ it follows that we can't have a very large value of $$$\prod_i freq_i + 1$$$. In fact, for this particular problem, the elements you want to separate in bins are the prime factors of some number $$$n \leq 10^8$$$, so it follows that the number of distinct states is exactly equal to the number of divisors of $$$n$$$, which is $$$\leq n$$$.

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

      how is it NP hard? i think the time complexity of the dp solution with the states and transition you mentioned is nlogn

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

    You can also solve it by DP on divisors in O(divisors ^ 2) my submission

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

problem c was easier than b

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

ugh, in F for 40-50 minutes i thought we have to do SOS DP :(

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

    same bro istg

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

    Pls tell your approach for F

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

      my solution is kinda different first i do what everybody does ->>>

      Say gcd(x, y) = g, Then the problem reduces to finding the same answer for (x/g, y/g), say x1, y1

      Additionally, since x1 and y1 are co-prime, we just need to find a way to remove all of x1 by division and multiply all of y1 by multiplication.

      So if we define a function, f(x) => minimum moves to make x from 1 through repeated multiplication by a number <=k, we just need to find f(x1) + f(y1)

      now calculation of f(x) is different for me ->>>>

      first thing to note is that, we can do something greedy here, we can always choose such subsets of prime factors of x which when multiplied is <=k basically over all subsets, choose that subset which gives maximum product less than k. subtract that subset from total prime factors and repeat this process till factors are empty. this process will run atmost 20 times.

      but choosing a subset is 2^20, so this will be slow as sum of x can be up to 10^8

      but if we choose subsets recursively we can return early and not all 2^20 subsets will be checked,

      basically if k is large i.e., big subsets are created then we will repeat the process way less than 20 times and if k is small then we will return early not all 2^20 operations will be done. i don't have proof for this though. it might so happen someone create a test which would TLE idk.

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

    Glad to know I wasn't the only one to try it, ended up spending way too long on it :(

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

    How are you sure that 'F' will pass? I was thinking the same, but not sure it will pass or not.

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

    wait, that isnt the intended solutions? we could have up to log2(1e6) numbers that we need to multiply and divide with so that's at most 20 numbers and we can do bitmask dp on that? Is this not the solution?

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

      but sum of x is upto 10^8 over all test cases.. it won't pass, also, i don't think there is any solution for SOS DP, if try that way, it will become set-covering problem, which is NP HARD. (though i am not so sure.)

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

F is basically https://cses.fi/problemset/task/1653 but instead of addition, it's multiplication

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

I can see three 'greedy' tags on 2114C - Need More Arrays's tags lol

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

Thanks, the problems were really fun!!

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

First rated contest.. Solved A and C but didn't pass test case 2 in problem B. Waiting for the tutorials..

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

    Maximum amount of good pairs we can make is cnt_zeros/2 + cnt_ones/2. This should make sense.

    Minimum amount of good pairs we can make is abs(cnt_zeros — cnt_ones)/2. Why? Every bad pair is a 1 and a 0, so if cnt_ones > cnt_zeros, we will have cnt_ones-cnt_zeros left over, and we will have cnt_ones/2 good pairs.

    So, if k < minimum or k > maximum, the answer is NO.

    But, not all numbers of good pairs in [minimum, maximum] are possible. If we have the maximum amount of good pairs, we can only reduce it by multiples of 2. Why?

    To eliminate a good pair (say, two zeros), we need to find another good pair (of two ones) so the two zeros and two ones can be matched up. So, we can only eliminate good pairs 2 at a time, minimum and maximum always have the same parity.

    So, we need minimum <= k && k <= maximum && (k%2) == (maximum%2).

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

Guys how MyBrainGotTLE able to hack codes so easily and fast of div 3 contests

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

Hello! Thanks for the nice contest, I really liked the problems.

Anyways, I was wondering if somebody could hack my solution for problem F cause I figure it's just of the verge of not passing due to TLE: 321498835

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

    Hi, your solution and mine (at the contest) are similar. It was some modify from adding to multiplying from a classic dynamic programming bitmask problem (minimum rides for lift) in the very popular book, competitive programming handbook. I pretty confidence that I will not be the only one using this solution alone :D. Sadly, this solution is not fast enough due to the sum of $$$N$$$ can reach $$$10^8$$$. Log constant will not let it pass.

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

Hey there! I saw quite a few comments regarding the solution for F... infact I was also pinged here.

I had a different solution:

Firstly, note that for going from x->y it is equivalent to go from x->gcd and gcd->y Which is further equivalent to go from gcd -> x and from gcd -> y and thus from 1->x/gcd, 1->y/gcd

Now I will process the testcases offline. I go in increasing order of k. And a dp solution suffices, because the answer for a given number changes iff it is a multiple of k

Reading the code will give a better understanding Code : 321493342

Hope I was able to explain well and that this solution gave you a clearer understanding. But if you still have any doubts, do feel free to ask them!

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

can someone tell how to achieve y = 982800, x = 1 for k = 13 in just 6 ops. in problem F

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

I was going through submissions to hack, and I received this warning:

"Recently, your account was used to crawl. Please change your password to prevent your account from being used for unauthorized activities."

I can't view submissions anymore. Is there a way I can get this permission back?

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

Got stuck on F :(

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

What is the indeed solution to F, i got hardstuck for so long.

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

    There are a lot of variants, but most stem from the fact that it's optimal to go from $$$x$$$ to $$$\text{gcd}(x, y)$$$ to $$$y$$$. This then involves somehow grouping up the prime divisors of $$$\frac{x}{\text{gcd}(x, y)}$$$ (and vice-versa with $$$\text{gcd}(x, y)$$$ to $$$y$$$, as, due to the available operations, it's symmetric) into groups such that the internal product of each formed group $$$\leq k$$$. Thus, what we end up trying to minimize is the number of such groups.

    I couldn't find a trivial way to do this, and one of the reasons why this packing problem isn't as straightforward is because of cases such as the following:

    $$$a = [2, 2, 2, 5, 5, 5],\, k = 10$$$

    (In this case, $$$a$$$ is the multiset of prime factors that compose $$$\frac{x}{\text{gcd}(x, y)}$$$). In this case, using a very greedy approach you'd get the following groups:

    $$$ [ (2, 2, 2), (5), (5), (5) ] $$$

    with a cardinality of 4. This is not optimal, as $$$ [ (2, 5), (2, 5), (2, 5) ] $$$ has a lower cardinality. Anyways, after trying a different greedy approach and failing miserably, I figured that some kind dp idea would work. The most obvious being bin-packing dp (see CSES dynamic programming section). However, I believe this is by far one of the slower approaches.

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

How do I solve proble? F,are there some similar problems of the same type?

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

Can someone tell me what is wrong with my solution to Problem E?


#include <bits/stdc++.h> #define ll long long #define vi vector<int> #define vb vector<bool> #define pii pair<int,int> using namespace std; void solve() { int N,x,y; cin >> N; vi v(N + 1), parent(N +1), m(N+ 1), M(N+ 1); vb visited(N+1, false); vector<vi> adj(N+1); for(int i = 1; i<= N; ++i){ cin >> v[i]; } for(int i = 1; i<N;++i){ cin >> x >> y; adj[x].push_back(y); adj[y].push_back(x); } queue<int> q; q.push(1); visited[1] = true; M[1] =m[1] = v[1]; while(!q.empty()){ int n = q.front(); q.pop(); for(const int& neighbor : adj[n]){ if(!visited[neighbor]){ visited[neighbor] = true; q.push(neighbor); m[neighbor] = min(v[neighbor], v[neighbor] - M[n]); M[neighbor] = max(v[neighbor], v[neighbor] - m[n]); } } } for(int i = 1; i<= N; ++i){ cout << M[i] << " "; } cout << endl; return; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { solve(); } return 0; }
»
15 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Video editorial I made for D and E in case anyone is interested (will upload A-C later if I am motivated enough):

Problem D

Problem E

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

Is $$$F$$$ SOS DP ?

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

What's the idea behind G? Would appreciate some hints.

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

    Basically, it's a matter of "what´s the maximum number of values I can use to create a value $$$v$$$ in the array?"

    Well, let's look at 8: ok, we could put 4 then 2 then 1 then 1. This would give us 8: but wait a second, just putting 1 1 1 1 1 1 1 1 would automatically give us 8. This happens because the following transformations occurs:

    1. $$$[1, 1, 1, 1, 1, 1, 1, 1]$$$
    2. $$$[2, 1, 1, 1, 1, 1, 1]$$$
    3. $$$[2, 2, 1, 1, 1, 1]$$$
    4. $$$[4, 1, 1, 1, 1]$$$
    5. etc

    Ok, could we use the same idea with 9? Well, we'd have to combine two equal values, but since 9 isn't divisible by 2, we can't do it! From this, we get the intuition that the answer (for each position) is related to how many times we can split the number $$$a_i$$$ into equal parts.

    Also, notice that the general construction that we have used basically implies that if for a certain value I have to use at least $$$l_i$$$ and at most $$$r_i$$$ operations to create it, then all the values in between should also be possible.

    There are a number of edge cases, but this is the main intuition. Hope this helps!

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

      Yeah, I was thinking along the same lines, and I tried to code it out. But I got wa on tc4. It seems like I am not handling the case properly when two adjacent indices have same bases (base is that number which we eventually get from equal parts division).

      In that case, if I am adding on the front/left, and let's say $$$a_{i-1}$$$ is greater than $$$a_i$$$, then what I assume is that I'll add $$$a_i$$$ from the base, and then I'll start from $$$a_i \times 2$$$ and add equal parts until it becomes $$$a_{i-1}$$$. Is my thinking on track?

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

        Well, I think the easier way to understand it would be by looking at the following case: let's say we have already set a 16 as $$$a_{i - 1}$$$ and we're not allowed to change it. Then, suppose the next position $$$a_i$$$ has to be 64. In this case, what happens is that we can't use the following pattern: $$$gen(64) = gen(32) + gen(16) + gen(8) + gen(4) + gen(2) + gen(1) + gen(1)$$$ (where $$$gen$$$ is the operation that generates the given value through some number of recursive calls). Specifically, we can't generate the 32 as our leftmost position because generating 32 involves generating 16 and 16, placing a 16 next to our previous 16 would mess it up (notice that reordering the generators wouldn't help). Thus, we just have to place a 32 there. So, it's equivalent to doing $$$r_i := r_i - gen(32) + 1$$$. Does that reasoning make sense?

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

          Yeah, this is more optimal. I was just adding $$$32, 32, 64, 128...$$$ and so on. I didn't realize we can just put a $$$32$$$ first to prevent merging with $$$16$$$, and then just continue with our $$$gen(32), gen(64), gen(128)...$$$ and so on.

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

difficulty estimations

A — 800

B- 900

C — 900

D — 1300

E — 1500

F — 1900

G — 2200

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

is it just me or was this div3 pretty easy? i managed to solve till E in an hour. cant get rid of the TLE on F tho ~

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

I learned the hard way that Python sucks at recursion. I got runtime error doing DFS in E. Had to do it iteratively.

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

I hope to become expert

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

https://codeforces.me/contest/2114/problem/E I want to ask in 2114E - Кирей атакует поместье how will we proceed if they ask us about any alternating path starting from that vertices like the path is not necessary to be retracted to parents everytime

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

Hey I am new to contests in general, will I receive rating? I solved 1 question in this round. Is this Div 3 unrated?

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

    yes you will get rating if you participated rating, in div 3 after the hacking phase is over in which people challenge each other's solutions, a system testing will be there after which you will get you rating.

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

can someone hint simulation proof of problem B
thanks in advance

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

The questions were very interesting and I enjoyed the competition. My favorite question was D.

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

Guys first my program of question D was accepted and now in system testing it is showing TLE it is not fair

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

I solved 3 questions but now it shows I've solved only 1. Also my rating hasn't changed. Someone please help me understand what happened. Could it have been hacked? If yes then where do I check it? Thank You! :)

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

    It is still in the system testing phase.

    The testing system grades your submissions in chronological order, which means the later you submit, the later you will get your results. So when you have solved 3 problems and it only shows 1, it means that the system is still grading your submissions on your other 2 problems

    After a few hours after system testing, your rating will change

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

Hi everyone, I participated in Codeforces Round 1027 (Div. 3) with username VSS303311_Ashalina. I solved 4 problems, and the contest was rated for me. My previous rating was 556, but I didn’t receive any rating update after the contest. Could you please check if there was any issue? plz reply me_

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

In problem F , is not the best option to try to divide a number by it greatest divisor that is less or equal than k , i tried it but it didnt work .

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

What is up with the judge? My 321615531 is in queue for last 10 minutes.

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

Hi Guys, I am solving problem F in yesterdays contest. Here is my approach for x, y k:

  1. 1. do prime factorization for x, y

  2. if (x*(mul)/(div)) = y, the from above step, we can get prime factorization of mul,div. i.e. x = 20, y = 15, then x's prime factorization: = [2,2,5], y's prime factorization: = [3,5], mul: =[3], div: = [2,2]

  3. now reduce the size of mul and div. i.e. if any elements product is less than k, then remove them by replacing them with their product. make sure size of arr is as small as possible.

  4. final ans is sum of size of mul and div.

I am getting TLE with step 3. I used subsets dp approach as in https://cses.fi/problemset/task/1653 Could you please help me with this. my submission: https://codeforces.me/contest/2114/submission/321619523

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

    I think you are using a greedy approach, which doesn't work. You can try for example with the last but one test case, if you take any elements to replace them with their product, you can end having more steps than the solution. I don't know why you are getting TLE, it should be WA.

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

    Let's go for worst case, say no. is 10^6 approximated to 2^20, giving factors up to 20 and it would cost us a O(x*2^x) = 20 * 2^20 which is fine, but we do dp mask twice and also we have 10000 test cases, implying our T.C shoots over 1e9. This would fail. Even I did same and got TLE coz I didn't calculated this earlier and recalled that factors till 20 should be k, but that was for just 1 testcase.

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

      i believe if you instead do this DP with the optimization of not counting duplicate combinations (as prime factorizations are high in multiplicity), you get a much better bound...

      instead of up to 19 (some duplicated) factors,

      you have up to 9 distinct factors (prod(range(2,11)) > 1e6), (each with an associated count, where the total counts still does not exceed 19).
      This greatly reduces the worst case from $$$2^{19} \simeq 5 \times 10^5$$$ to (i think) $$$240$$$ in the case of 720720: $$$720720 = 2^4 \times 3^2 \times 5^1 \times 7^1 \times 11^1 \times 13^1$$$

      note that $$$(4+1)(2+1)(1+1)(1+1)(1+1)(1+1) = 5 \times 3 \times 2 \times 2 \times 2 \times 2 = 240$$$ distinct subsets, where in general the number of distinct subsets of a multiset is prod(cnt + 1 for cnt in set.counts())

      edit: i realize we're actually just counting the number of divisors here

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

how much more time before editorial comes in?

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

Can Someone please tell how to optimize my E 321650903

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

    I think this alone has complexity $$$O(N^2)$$$, by creating a vector of size n — n times:

    for(int i=1;i<n;i++)
        vector<int> vis(n,0);
    

    I didn't quite understand what function recurse do but it seems it has linear complexity, let alone the map which adds another $$$log$$$ factor. Regardless, think of another approach with better complexity and doesn't do dfs-similar for each node.

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

One of the best G I have seen in a div3.

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

the fate reference on E lol

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

My first time solving 6 problems in Div. 3

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

I love this contest:)

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

I just used topological sorting and then traversing each vertex in that order , it was basically just using the all known graph algorithms.

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

Hey @Vladosiya , @myav , @Gornak40, @KwisatzCoderach

I received a Mail today, stating that my Solution to D in Codeforces 1027 Round bearing ID 321481547 had matched with quite a many other users. Kindly note that, it was a simple question, having the same approach and code co-incidentally is not at all unrealistic. I had not used any public IDE or sourced through any public illicit source during the contest and the match is purely co-incidental (as to the best of my knowledge).

I request you to kindly look into the matter and act accordinly

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

@Vladosiya @myav @Gornak40 @KwisatzCoderach

I received a Mail today from Codeforces stating that my Solution to D (Submission ID : 321481547) in Codeforces Round 1027 matched with quite a many other users. Note here, that the question D was an easy question having a simple straight-forward approach and having the similar logic for D is not at all difficult.

The match that has occurred, I believe, is purely co-incidental because I have not used any public IDE, neither have I resorted to cheating from Pirated Sources. Also note that, I have not shared my code to anybody. I have appeared for the contest and solved the questions in legal manners.

I request you earnestly to kindly look into the matter.

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

Dear Codeforces Team,

I received a warning that my solution 321490662 for Problem 2114E significantly coincides with another participant’s code. I want to clarify that I did not intentionally share or copy code.

It’s possible that my code was unintentionally leaked — I may have discussed logic with someone casually without realizing our final implementations would end up this similar.

I understand that even unintentional sharing is considered a violation. I sincerely apologize and assure you that I will be more cautious in the future to avoid such issues. I respectfully request that my situation be reviewed, and I am willing to accept a penalty if required.

Thank you for maintaining the integrity of the platform.

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

    This is a standard DFS + DP on trees template that I’ve learned through previous practice, tutorial blogs (like cp-algorithms), and contests. The transformation formulas (max(a[v], a[v] — smin[parent])) follow logically from trying to maximize gain by optionally subtracting parent paths. I wrote the code myself during the contest based on my understanding. Someone else might have use the same source as well

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

I want to clarify that I did not copy any code from another participant. I wrote my solution independently before my friend. I can provide evidence, such as timestamps or version history, to confirm that my version was created first. I fully understand and respect the competition rules and would never engage in dishonest practices. Any similarities between our submissions are due to the fact that we use the same template. I would request the admin to include my rating for this contest

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

Hi Codeforces Team, I recently got a message saying my submission (321467772) for problem 2114F was flagged for being similar to someone else’s. I just wanted to clarify that I only use this account (The_Sambhav) and I wrote the solution completely on my own during the contest. The method I used was building a graph of divisors and doing BFS to reach the target number which is something I learned from common tutorials. The idea of checking if all prime factors are within a certain range also came from standard number theory problems. I didn’t share my code with anyone or work with anyone else, but I now realize that since this approach is quite standard, maybe someone else used the same method, which led to the similarity. Just for reference, here are some of the resources I studied these techniques from: GeeksforGeeks – BFS in Graphs, GeeksforGeeks – Finding All Divisors, CP-Algorithms – BFS, CP-Algorithms – Primality Tests, Errichto’s YouTube Playlist I respect the rules of the platform. I’ll be more careful going forward to make sure there’s no accidental overlap like this again. I hope you can review the case again and consider not penalizing my account. Thanks a lot for your time and for running such a great platform.

-The_Sambhav

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

hii

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

Dear Codeforces team,

I recently received a plagiarism notice concerning my submission for Problem 2114D in the recent Div. 3 contest (Submission ID: 321441614). The notice indicates a significant similarity with another user's submission (User: nortox_2144, Submission ID: 321486683).

I would like to clarify that I participated in unrated mode and submitted only this one problem before leaving due to personal commitments. The other user's submission was made over an hour later, and also all his submissions have been skipped.

I suspect the similarity may be due to using a public online compiler, as I'm currently facing issues updating my local C++ compiler beyond version C++11.

I assure you that I did not engage in any dishonest activity and take the Codeforces rules seriously. I kindly request a review of this issue or guidance on how to proceed.

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

Dear Codeforces team,

I recently received a plagiarism notice concerning my submission for Problem 2114D in the recent Div. 3 contest (Submission ID: 321441614). The notice indicates a significant similarity with another user's submission (User: nortox_2144, Submission ID: 321486683).

I would like to clarify that I participated in unrated mode and submitted only this one problem before leaving due to personal commitments. The other user's submission was made over an hour later, and it appears all their submissions have been skipped.

I suspect the similarity may be due to using a public online compiler, as I'm currently facing issues updating my local C++ compiler beyond version C++11.

I assure you that I did not engage in any dishonest activity and take the Codeforces rules seriously. I kindly request a review of this issue or guidance on how to proceed.

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

While I cant bring any evidence that this was just a coincidence.

I can see how both submissions are very similar to mine 321494024 , 321453033

so kinda interesting I guess.

it is a good opportunity to start recording me doing contests again.

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

Hello Codeforces Team,

I have received a message regarding a similarity between my solution to Question F of this contest and that of another participant. I would like to clarify that I have neither cheated nor shared my code with anyone. I solved the problem entirely on my own and it is just a coincidence.

However, I would like to point out that a similar question — involving interchanging numbers through division and multiplication — was previously asked in a contest hosted by the Coding Club of my college. Link to the contest's questions. It was Question 1 in that contest, and its solution had been discussed at the time. Therefore, it is possible that my solution resembles others due to that prior exposure.

That said, I cannot view the other participant's submission and hence cannot comment on it. But I am confident that I have not engaged in any form of malpractice or cheating, which I understand is strictly against the contest regulations.

Moreover, the structure of my solution to this problem is consistent with my other submissions, which can be verified. I respectfully request the admin to review this conclusive explanation and the provided evidence and kindly remove the allegation from my account.

Thank you.

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

Hi Codeforces Team,

I received a message concerning plagiarism for problem 2114D of this contest on my submission 321509477 with user P1KACHUUU for their submission 321458826.

I completely understand that plagiarism and colluding is against the codeforces guidelines; however, I believe the similarity between our code is completely by coincidence. I developed my solution approach by considering that it would be optimal to remove the point that is at the smallest or largest x-y positions. I then considered the cases where the smallest / largest x and y are the same point and adjusted for that. Finally, I considered the case where the remaining area is equal to n — 1, in which case we must add the removed point back to the shortest side.

Although our code is very similar, I think it is reasonable for two random contestants to have the same intuition regarding this problem and implement our solutions in the same manner. Looking at other solutions for 2114D, if participants only consider using arrays rather than multi-sets or other ordered data structures to find the remaining max and min, their solutions would be very similar to mine and P1KACHUUU's. Secondly, our code differs in the fact that to create a list of points sorted by the y values, P1KACHUUU uses a list with points stored as {y, x} along with the list of points stored as {x, y}. On the other hand, my solution creates two lists, but stores both as {x, y} points and simply uses a custom comparator to sort the second list into non-descending order by y-value. This slight difference causes distinct problems for sharing code as it requires the re-ordering of every line involving the second list of points sorted by y-values.

I also think that considering P1KACHUUU is over 1600 rated and was thus not able to compete as a rated participant in a Div 3, it is highly unlikely that they decided to collude and submit plagiarized code. I did not plagiarize, and I believe that neither did P1KACHUUU. Although I can only claim that our code is similar due to random coincidence, I do not believe that this similarity is completely improbable.

Please look into this, and thank you for your time.

-Andelupe

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

Hello Gornak40, KwisatzCoderach, Vladosiya, myav, and Codeforces team, I received a notification that my solution 321514179 for problem 2114D coincides with others. I want to clarify that my solution uses a common and standard approach with prefix and suffix arrays to compute min/max values, which is widely known in competitive programming. Though the approach is common, I implemented it using a custom struct point that others didn’t use, and my variable names and function structure are different. My solution was developed independently, based on these well-documented methods (e.g., Codeforces blog: https://codeforces.me/blog/entry/133828, GeeksforGeeks article: https://www.geeksforgeeks.org/prefix-sum-array-implementation-applications-competitive-programming/).

Thank you for your understanding. I’m happy to provide further details if needed.

– ashok4

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

Hello Gornak40, KwisatzCoderach, Vladosiya, myav, and Codeforces team,

I received a notification that my solution 321514179 for problem 2114D coincides with others. I want to clarify that my solution uses a common and standard approach with prefix and suffix arrays to compute min/max values, which is widely known in competitive programming.

Though the approach is common, I implemented it using a custom struct point that others didn’t use, and my variable names and function structure are different.

My solution was developed independently, based on these well-documented methods (e.g., Codeforces blog: https://codeforces.me/blog/entry/133828, GeeksforGeeks article: https://www.geeksforgeeks.org/prefix-sum-array-implementation-applications-competitive-programming/).

Thank you for your understanding. I’m happy to provide further details if needed. "I only used CodeChef's online IDE to write my code, and I never shared the link or the code with anyone. I believe this must have been an unintentional coincidence or an unauthorized copy."

– ashok4

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

Hello, I recently received a notification stating that my solution (ID: 321479165) for problem 2114D coincides significantly with another user’s solution (Slumio/321472983). I would like to clarify that I do not know this user and did not share my code with anyone. This was purely a coincidence. The only similarity between our solutions is the use of prefix and suffix arrays, which is a common idea in competitive programming. The idea is also available prior to the contest on the website: https://www.geeksforgeeks.org/precomputation-techniques-for-competitive-programming/. I implemented my solution independently using these well-established strategies. I kindly request the moderators and the head of Codeforces, Mike Mirzayanov, to carefully consider this explanation and remove the allegations against me. Thank you very much for your understanding and support.

– charanteja001

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

Subject: Clarification Regarding Submission Coincidence in Problem 2114D (Submission ID: 321472983)

Dear Codeforces Team,

I would like to firmly state that I have not engaged in any form of cheating or rule violation during the contest in which I submitted solution 321472983 for Problem 2114D.

I do not know the users charanteja001, and I have never communicated or shared any code with them. My submission was made before the other mentioned users, which is clearly visible in the submission timestamps. I fully understand and respect the rules of Codeforces and competitive programming ethics, and I take them very seriously. I am ready to provide any additional clarification or information that might help in resolving this issue fairly.

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

Same thing, I'm sorry I appologise for my mistake. I used iodine as public and from now I won't do that

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

Hi All, I recently received a message that my code significantly matches with another person whom I don't even know (https://codeforces.me/contest/2114/submission/321530468).

I would like to clarify that my submission was made much earlier than the concerned person and I have not shared my code to anyone and have written the code in my own VS Code. My code involves a basic BFS traversal using queue using visited array. I dont know how I got flagged even though I have not copied from anyone or anywhere. I would request to reconsider my code and my contest submissions are not skipped.

Thanks!