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

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

Привет, Codeforces!

Мы рады пригласить вас принять участие в Codeforces Round 1099 (Div. 2), который состоится 21.05.2026 17:35 (Московское время). Вам будет предложено 6 задач и 2 часа на их решение. Раунд будет рейтинговым для участников с рейтингом ниже 2100.

Раунд для вас подготовили: xoxo, Kuyan, FairyWinx, sunkuangzheng, TheScrasse и Vladithur. Также мы хотим выразить искреннюю благодарность людям, без которых этот раунд был бы невозможен:

Распределение баллов будет опубликовано позже.

Надеемся, вам понравится этот раунд. Ни пуха, ни пера!

UPD: Распределение баллов за задачи будет следующее: $$$500 – 1000 – 1250 – 2000 – 2500 – 2750$$$

UPD: Разбор

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

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

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

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

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

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

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

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

As a linger fan, I will sleep early this round.

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

Wow unexpectedly short announcement.

Hope the contest proceeds well!

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

very excitedd

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

Excited for the contest! All the best everyone!

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

As a newbie, I hope my code is shorter than this announcement.

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

xoxo i think you have wrote help in the announcement by mistake it should be held right ??

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

As a participant, how to be a tester?

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

How clever of Makka-Pakka

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

hope to have some good conceptual questions not like the edu round 190

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

hope to have some good conceptual questions not like previous edu round 190

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

Thank you for this round.

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

Hope that the statements will be as short as the announcement

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

I love participating in DIV. 2

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

My first Div2 Send luck

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

Hope reach CM

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

help or held //

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

к чёрту

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

xoxo Could you add the score distribution?

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

Please add the score distribution.

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

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

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

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

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

The rise in points from C to D is (+750), crazy!!

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

This is my first CP contest ever, wish me luck folks!

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

Why do I have to complete a CAPTCHA for every submission I make, and it keeps failing to verify?

Isn't this a bit unreasonable? It will make me lose a lot of points for nothing.

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

$$$D$$$ was a good problem, thanks for the round!

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

Why 2231B - Another Sorting Problem is a problem B and 2231C - Chipmunk Theo and Equality appears in Codeforces round.

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

why my sol in c get time limit

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

Hints

A. Construct an Array

Hint 1
Hint 2
Solution

B. Another Sorting Problem

Hint 1
Hint 2
Hint 3
Hint 3
Hint 3
Hint 3
Hint 3

C. Chipmunk Theo and Equality

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
»
3 месяца назад, скрыть # |
 
Проголосовать: нравится +40 Проголосовать: не нравится

In problem C, why it is a[i] <= 1e9 not a[i] <= n

Getting TLE because of map doesn't make sense to me

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

i loved this round thank you!

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

On the problem statement of E.

He became interested in how many different such subgraphs he can cut out. Subgraphs are considered different if the chosen triples of vertices are different.

Even though the second sentence adds a clarification, I think these two sentences are completely contradictory. I believe it would have been better to state this accurately from the beginning, for example: "Count the number of triples such that ..."

I do not think an inaccurate problem statement should be considered acceptable merely because a clarification is added afterward. At the very least, a problem statement should be written so that most readers can understand it naturally in the intended way.

For example, I think everyone would agree that a statement such as "Find the sum of A_i. Here, in this problem, sum means product" is clearly inappropriate. This problem statement felt similar to that to me.

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

    100% Agree. Not only that, but the samples also don't clarify that. I had to write stress-tests for my WA2 solution, pass stress tests, get wrong answer and only then see that the problem asks for something clearly different. And the triplet part doesn't even contribute to the problem in a meaningful way, it's effectively the same with the subgraphs.

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

https://codeshare.io/5OYxBr

which test break would break for D? Thanks in advance

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

Feedback:

  • A: nice
  • B: nice
  • C: I don't understand why the TL is so low (assuming that the intended solution is O(n * 60 * hashmap)). OK problem.
  • D: I don't like this problem at all, the idea is simple and yet the implementation can be terrible if one isn't careful.
  • E: I like it, but it is perhaps a bit too standard for a non-edu round in 2026?
»
3 месяца назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

solved

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

bad C

Why does it force me to write a discretization?

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

dudes I use java BufferedReader and PrintWriter but the problem C was giving TLE I had to rewrite the same logic in C++ for it to be accepted this is not fair.

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

Just tried to brute force C and it passed Is that the optimal solution?

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

In C, if we take only the first 2 numbers in the operation sequence of least element which also are in the operation sequence of all numbers, why won't testing them be sufficient to find the minimum answer?

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

    Sounds like it should work.

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

      void solve() { int n ; cin>>n; iv(v,n); sort(all(v)); ll a=v[0]; ll b=v[0]+1; ll c=v[0]-1; ll ans=0; ll ans2=0; ll ans3=0; f(i,n){ ll h=v[i]; map<ll,ll>mpp; while(h>=a-1&&h>0){ mpp[h]=1; if(h==a){ break; } if(h%2==0){ h=h/2; if(mpp.find(h)!=mpp.end()){ break; ans=INF; } } else{ h=h+1; if(mpp.find(h)!=mpp.end()){ break; ans=INF; } } ans++; } } f(i,n){ ll h=v[i]; map<ll,ll>mpp; while(h>=b-1&&h>0){ mpp[h]=1; if(h==b){ break; } if(h%2==0){ h=h/2; if(mpp.find(h)!=mpp.end()){ break; ans2=INF; } } else{ h=h+1; if(mpp.find(h)!=mpp.end()){ break; ans2=INF; } } ans2++; } } ll ans4=min(ans,ans2); cout<<ans4<<endl; }

      i did the same thing but it didnt pass 375551055

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

    #include <bits/stdc++.h> using namespace std; #define int long long using ll = long long; using pii = pair<int,int>; using vi = vector<int>; using vll = vector<long long>; #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define rep(i,a,b) for(int i=(a); i<(b); ++i) #define repn(i,n) for(int i=0; i<(n); ++i) const int INF = 1e18; const int MOD = 1e9 + 7; /* ======================================== Problem Statement ======================================== pass hoja pls ======================================== */ /* gx = (x+1)/2 cx = 1 + x mod2 fx< x it converges at t ? commong convergence point for all total cost = sig(i =1 )^n s(ai, k t ) c(s) at the end 1 and 2 ? at 1 min of both 1 and 2 sum > ? x = m.2^v2(x) v2(x/2)=v2(x)-1 v2(x+1)>=1 ???????? */ int f(int tgt,int n , vector<int> &a){ int kl = 0 ; repn(i,n){ int ct = a[i]; if(tgt==2 && ct==1){ kl++; continue ; } while(ct>tgt){ kl+=1 + (ct%2); ct = (ct+1)/2; } } return kl; } void solve() { int n ;cin>>n; vi a(n) ; for(int i =0 ; i <n ;i++)cin>>a[i]; vector<pair<int,int>> cands ; int ct = a[0] , kl = 0 ; while(ct>1){ if(ct%2 ==0 ){ while(ct%2==0){ cands.pb({ct,kl}); ct/=2; kl++; } }else { cands.pb({ct,kl}); ct++; kl++; } } cands.pb({1,kl}); if(a[0] == 1) cands.pb({2,1}); for(int i =1 ;i < n;i++){ vector<pair<int,int>> curr_path; ct = a[i]; kl = 0 ; while(ct>1) { if(ct%2==0) { while (ct % 2 == 0) { curr_path.push_back({ct, kl}); ct/=2; kl++; } } else { curr_path.push_back({ct, kl}); ct++; kl++; } } curr_path.pb({1,kl}); if(a[i] == 1) curr_path.pb({2,1}); vector<pair<int,int>> next_cands; for(auto & cand: cands){ for(auto &cp: curr_path){ if(cand.first ==cp.first){ next_cands.pb({cand.first,cand.second+cp.second}); break; } } } cands = next_cands; } int ans = INF; for(auto cand:cands){ ans = min(ans,cand.second); } cout<<ans<<endl; } int32_t main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t = 1; cin >> t; while (t--) solve(); return 0; }

    i did this for c i am not really sure if its optimal tho i am basically tryna simulate paths from every number down to 1

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

tricky B for me ... I got idea for C quickly but you have to code it in fast way.

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

    For problems like $$$B$$$, I always visualize them as mountains with peaks at height $$$a_i$$$, and you can think of the operation as "lifting the mountains up". So when $$$i-1$$$th mountain is taller than $$$i$$$, we need to lift the $$$i$$$ th mountain by atleast $$$a_{i-1} - a_i$$$. This visualization always helps me solve such problems.

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

      I was confused about what happen to next element of the element we pick up, as we add 'k' to all elements... what if that becomes larger than next element ... so I was not sure of correctness.

      although because now pretest = main test, I just submit my random ideas as I can verify it fully

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

Dude I was so fed up of C I had to rewrite my whole Java code into C++ for it to be accepted.

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

    did it accpeted?

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

    I did lots of optimisation for my java code , i am precomputing min distance still it is getting TLE like why? `int t = sc.nextInt();` ` while (t-- > 0) {` ` int n = sc.nextInt();` long a[]=new long[n]; ` Map<Long, Integer>map=new HashMap<>();` for(int i=0;i<n;i++){ a[i]=sc.nextLong(); } Map<Long, Long>mp=new HashMap<>(); long ans=Long.MAX_VALUE; ` for(int i=0;i<n;i++){` long temp=a[i]; ` Set<Long> set=new HashSet<>();` map.merge(temp, 1, (x, y)->x+y); ` long it=0;` set.add(temp); ` mp.merge(temp, it, (x, y)->x+y);` if(map.get(temp)==n){ ans=Math.min(ans, mp.get(temp)); } while(true){ if(temp%2==0){ temp=temp/2; }else{ temp++; } ` if(set.contains(temp))break;` map.merge(temp, 1, (x, y)->x+y); it++; ` set.add(temp);` mp.merge(temp, it, (x, y)->x+y); ` if(map.get(temp)==n){` ` ans=Math.min(ans, mp.get(temp));` ` }` ` }` ` ` } ``

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

    For C:- I am trying to understand why this Java solution gets TLE.

    Idea:

    For each number, I generate all reachable values using:

    • even → x/2
    • odd → x+1

    I maintain:

    • map[value] = number of elements that can reach value
    • mp[value] = cumulative operations needed to reach value

    So I am not recomputing distances; I accumulate them while traversing.

    Whenever map[value] == n, that value becomes a candidate answer.

    Code:https://codeforces.me/contest/2231/submission/375593971

    Expected complexity:

    • Each number follows a single chain
    • Chain length should be around O(log ai)
    • sum(n) ≤ 1e5

    So I expected roughly O(n log A).

    Is the TLE mainly due to:

    • HashMap.merge() overhead?
    • Creating HashSet for each element?
    • Long boxing/unboxing?
    • Some hidden complexity I am missing?

    I want to understand the exact reason for TLE rather than replacing the approach.

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

what's the approach for problem B :(

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

what's the approach for problem B..? :(

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

`Why does my O(n log^2 n) solution for problem C get TLE on test 4?

`

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

Why does my O(n log^2 n) solution for problem C get TLE on test 4?

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

thank you cf, had a good time.

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

Problem E: Did anyone try small to large optimization with a twist that "small" and "large" is on heights? Did it pass the TL?

I assume it should be $$$O(n)$$$ per DFS, and running from every possible root you get $$$O(n^2)$$$, but it doesn't pass for me, unsure why. 375550780

If that's not the solution, what's the good straightforward alternative? For me the small to large seemed like the most straightforward approach: split answers in two- and three-ways, two-ways are trivial, and for three-ways we need to combine two depths from center vertex => small to large.

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

    "For me the small to large" all this solutions work (that i know) in O(n^2) with naive merge, because you any pair of vertex calculate only in their LCA

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

      The idea is not exactly this one, it's a fair small to large, and the swapping is important.

      The idea is that if for $$$v$$$ you have two subtrees, one of depth $$$A$$$ and another of $$$B \lt A$$$, and you combine them in $$$O(B)$$$, the B becomes hidden in the combinator result that has size A. And because depth B requires B vertices, you can estimate by coin method the amortized $$$O(n)$$$.

      That's a cool technique tht I use once in a while, and I can't understand why it failed me here.

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

    I did do the $$$ O(n) $$$ small to large, but I didn't run it from every root, I did one dfs, with $$$ O(n^2) $$$ dp: 375530382

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

    I had same idea, and my solution pass. 375531942

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

    Hi, I did small to large sort of. My AC implementation is here: https://codeforces.me/contest/2231/submission/375566090

    I broke it down as follows:

    Any group of 3 nodes either forms a simple path, or a Y-shape.

    For simple paths we have two cases: -The LCA of all 3 nodes is one of the three nodes -The LCA of all 3 nodes is a different node

    We could solve these separately or together in many ways.

    The Y-shaped cases are more interesting: For a Y-shape, the LCA of all 3 nodes is not one of the three nodes. call this LCA L.

    We could have all three nodes come from different children's subtrees of L. We could also have two nodes come from one child's subtree of L, and the third node comes from a different child's subtree.

    This is the part I used small to large merging for. For each node we treat it as an L. I want to know how many nodes in L's subtree have a distance of X, and how many pairs of nodes have a distance of X. We can aggregate these together in the merging process to update the result.

    I think I probably did not do it the cleanest way, but I used the standard "offset" trick where each node stores an unordered map and when we bubble up we shift the offset by 1.

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

The "Time limit exceeded on pretest 4" of problem C killed me. Good Bye candidate master and Hello expert !

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

Failing D on pretest 2, could not figure out at all

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

Can someone please help me with any counterexample to my code for problem B of this contest? I can't see what's wrong here... Please ignore the bad formatting, I've added comments so that I can explain what I'm trying to do

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

Can someone please help me with D??

I was able to find out two conditions that's it —

  1. If value in the c array changes during a forward pass (c[i] < c[i+1]) then b[i+1] = c[i+1]
  2. a[0]=c[0]

How to proceed from here?? Thank You.

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

    So we can maintain a visited array v. For all i, v[i] is set to 1 if we know the value of b[i], otherwise we set it to 0. So using your first condition, we can set v[i+1] to 1, whenever c[i]<c[i+1], since we know what b[i+1] is. Also b[0]=a[0]

    Now we iterate from right to left(i=n-1 to i=1). If for some i, v[i]=1 (which means we know b[i]) and a[i] as well, then b[i-1]=b[i]-a[i-1], and therefore we know the value of b[i-1] as well, and we can set v[i-1] to 1. In the other case, if both v[i-1] and v[i] is 1, then we know both b[i] and b[i-1], and therefore, a[i]=b[i]-b[i-1], and we set set s[i] to '1'. In the case, that we know all a[i],b[i] and b[i-1], we just check if a[i]=b[i-1]-b[i], if this condition does not hold, there exists no valid construction

    So now, we will iterate from left to right. For each i from 1 to n-1, we will make 4 cases:-

    Case-1 s[i]='0', and v[i]=0, we just set a[i] to some negative number of large magnitude, and update b[i]=b[i-1]+a[i]

    Case-2 s[i]='0', and v[i]=1, we know b[i] but not a[i], we set a[i]=b[i]-b[i-1]

    Case-3 s[i]='1' and v[i]=0, we know a[i], but not b[i], so we set b[i]=b[i-1]+a[i]

    Case-4, s[i]='1' and v[i]='1', we don't need to do anything since both a[i] and b[i] are known

    Clearly at any i, we know a[j] and b[j] for all j from 0 to i-1, due to the nature of the construction, hence all updates to a[i] and b[i] will be correct.

    So why is it so important to set a[i] to a large magnitude negative number in case-1. This is because if there are large known a[j], and you use say, a[i]=-1, for some j>i, b[j] could exceed c[j].

    As a final step, you just check if you construction violates any constraints (either a[i] or c[i]). If it does, then there exists no other construction, and if it doesn't you can just print your construction. For more clarity regarding this why this step is required, check sample test case-6

    Of course, the above paragraph also works as proof of correctness of the construction

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

D was a nice implementation problem

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

D was a nice implementation problem.

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

Мне не понравилось

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

MikeMirzayanov Please allow unofficial participation of contest like atcoder. 😭 😭

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

ConstrumentationForces

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

In C , My code 375545444 got accepted without using Hash map. Why using Hash map ? is it creates any big difference here?

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

Pretty good contest, it would be better if the TL of problem C were larger.

Anyway, I'm glad to reach CM again in this round, especially on my birthday.

This is a wonderful birthday gift for me!

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

well, C will come in my nightmares now, thank you very much

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

such a great contest ! is there an editorial .

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

Very good contest!

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

Problem C was really fun! I found an $$$\mathcal{O}(\sum \log a_i)$$$ solution that doesn't use data structures at all: 375569790.

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

FOR C I DID LIKE THIS PLEASE GIVE A LOOK :)

I first sorted the array.

Observation: the final array must become some value lying on the path of the smallest element. Example: for 3,4,5, path of 3 is:

3 -> 4 -> 2 -> 1

So possible final values are {3,4,2,1}.

For every candidate p from this path, I calculate total operations needed to convert every element a into p.

Example for p = 2:

  • 3 -> 4 -> 2 = 2 steps
  • 4 -> 2 = 1 step
  • 5 -> 6 -> 3 -> 4 -> 2 = 4 steps

Total = 7 steps.

To compute steps for one element:

while(a != p){
    if(a & 1) a++, steps++;
    else a /= 2, steps++;
}

Trap: for p = 3 and a = 4:

4 -> 2 -> 1 -> 2 -> 1...

This becomes infinite because after going below p, reaching p again is impossible.

So during division, if p - a >= 2, I return a large value (1e5) so that candidate p is ignored.

Complexity:

  • Candidate generation: O(log Amax)
  • Array traversal: O(n)
  • Conversion per element: O(log Amax)

Overall: O(n * log²(Amax)). WHERE AM I WRONG :)

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

Editorial?

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

I hate TLE on test 4.

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

Where is the editorial ?

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

Editorial please?

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

No editorial even after 12 hours of the contest, bad !!!!

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

for each i perform abi:=abi+k Doesn't it mean that those b subsequence are indexes of array a Or i am interpreting the question wrong?

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

EDITORIAL?

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

where i can see the edutorials,tutorials,solutions ?

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

A good extension of question B is to find the number of valid k

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

has the editorial been released

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

When is the editorial going to be published

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

Where is editorial?

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

Here's my solution for problems A-C (sorry for bad explanation?)

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

I used map in problem C why it takes TLE ?

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

Drop the Editorial please

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

whens the editorial up?

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

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

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

Recieved a mail regarding solution coinciding. I am not sure how do you find those solutions same and from my side no cheating took place. Pl[submission:375526933]ease look into this. This was my submission 375526933 And the violated one has http://contest/2231/submission/375517996

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

editorial pls.

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

I did not intentionally copy any code. I wrote the solution myself during the contest. The approach for this problem was common, so the solutions may look similar. I will be more careful in future contests. Thank you.

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

Just received a notification stating that ratings for the last rounds have been temporarily rolled back. Can anyone educate me on what that means?

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

Dear, organizers.

I would like to clarify the situation regarding my solution (submission:375528371) for problem 2231F.

Near the end of the contest, under time pressure, my friend and I used AI-generated code assistance for problem F and submitted the solution without properly thinking through the consequences or the contest rules. Shortly afterward, we realized that this was inappropriate and violated the competition rules regarding external assistance.

We take full responsibility for this mistake. There was no intention to collaborate with other contestants or deliberately abuse the system, but we understand that using AI-generated code during a rated contest is unfair and against the rules.

We sincerely apologize to the organizers and the community for this behavior. We fully accept any decision regarding disqualification, rating rollback, or other penalties.

This was our mistake, and we will make sure not to repeat it in future contests.

Thank you for your understanding.

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

Dear Organizers,

I am writing to appeal the decision regarding my solution (submission ID: 375501684) for problem 2231C, which was flagged for coinciding with other solutions. I fully respect the integrity of the platform and the necessity of plagiarism detection. However, I believe my case is a false positive caused by the problem's limited solution space and the natural convergence of optimal coding patterns.

I would like to detail my development process, supported by the actual code I wrote, to demonstrate that my solution is the result of independent debugging and optimization.

My first submission(id:375495165) used unordered_map to track the total steps (to) and count (c) for each reachable value. The logic involved simulating the process for each starting number and storing results in hash maps. This approach was intuitive but resulted in a Time Limit Exceeded error due to the overhead of hash operations and the complexity of the simulation.

After identifying the performance bottleneck, I redesigned the algorithm. Instead of using hash maps, I switched to a vector of pairs (value, steps). I collected all reachable states for each starting number, then sorted the vector and aggregated steps for each unique value. This eliminated hash collisions and improved cache efficiency, leading to a successful submission.

Furthermore, this contest is of utmost importance to me — it is, without exaggeration, the best performance I have ever achieved in my entire life. I sincerely hope that it will not be unjustly invalidated due to a false positive in the similarity detection.

I fully support Codeforces' anti-cheating measures and understand the need for automated detection. However, I respectfully request a manual review of my submission history, which clearly shows the evolution from a TLE solution to an optimized one. This pattern is inconsistent with code copying.

I am confident that a thorough review will confirm my innocence. Thank you for your time and for maintaining such a fair and competitive platform.

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

the worst contest ever

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

Hello,

I received a coincidence warning for my submission 375528547 for problem 2231E. I would like to clarify that I solved the problem independently and did not intentionally copy any code.

The solution uses standard competitive programming techniques and common approaches that are widely available in public resources and Codeforces blogs before the contest. Because of this, some structural similarity between solutions may naturally occur.

I did not share my code publicly during the contest and was not involved in any intentional plagiarism or leakage.

I respectfully request you to reconsider my submission.

Thank you.

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

    Dear Codeforces Team,

    I would like to kindly follow up regarding my previous appeal about the coincidence warning issued for my submission 375528547 on problem 2231E.

    I understand that the review process may take time, but I would be grateful if you could reconsider my case when convenient.

    As mentioned in my earlier message, I solved the problem independently and did not intentionally copy any code. The solution is based on standard competitive programming techniques and common approaches that were publicly known before the contest, which may naturally lead to similarities between submissions.

    I did not share my code during the contest and was not involved in any plagiarism or information leakage.

    I respectfully request a review of my submission and would appreciate any update regarding the status of my appeal.

    Thank you for your time and consideration.

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

C was good tbh!!!