awoo's blog

By awoo, history, 12 months ago, translation, In English

Neapolis University Pafos

Hello Codeforces!

The series of Educational Rounds continues thanks to the support of the Neapolis University Pafos. They offer a BSc in Computer Science and AI with JetBrains Scholarships. Gain cutting-edge skills in AI and machine learning, preparing you for high-demand tech careers. Limited scholarships available — don't miss your chance to study in Europe for free!

On Sep/15/2025 17:35 (Moscow time) Educational Codeforces Round 182 (Rated for Div. 2) will start.

This round will be rated for the participants with rating lower than 2100. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest, you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally.

You will be given 6 or 7 problems and 2 hours to solve them.

The problems were invented and prepared by Adilbek adedalic Dalabaev, Ivan BledDest Androsov, Maksim Neon Mescheryakov, Roman Roms Glazov and me. Also, huge thanks to Mike MikeMirzayanov Mirzayanov for great systems Polygon and Codeforces.

Good luck to all the participants!

Our friends at Neapolis University Pafos also have a message for you:

🚀 Free Math, AI, and Coding Clubs
Neapolis University Pafos, in collaboration with JetBrains, invites school students (ages 13–19) to join the Math, AI, and Coding Clubs — weekly programmes designed to build your problem-solving skills through curated challenges and live sessions.

Don't miss the chance to sharpen your skills (and enjoy some fun mashup contests, curated by pashka).

🔹 Math Club
Build a strong mathematical foundation to improve your programming skills. You’ll receive 10–15 progressively challenging problems each week, along with a 90-minute live session every Saturday. Two difficulty levels are available, so you can choose the path that suits you best.
💡 Top performers will be awarded 5 bonus points on the entrance test for the BSc in Computer Science and Artificial Intelligence at Neapolis University Pafos — a fully funded programme supported by JetBrains Foundation Scholarships.
👉Join the Math Club

🔹 AI Club
Explore the world of Artificial Intelligence — from beginner concepts to olympiad-level topics (e.g. IOAI). Attend live sessions every Wednesday and complete weekly homework assignments to keep progressing.
👉Join the AI Club

🔹 Coding Club
Ideal for students with some experience in competitive programming who want to take their skills further. Each week features a mashup of problems from past Codeforces contests, curated by Pavel Mavrin (2004 ICPC World Champion, 2002 IOI Silver Medalist, and JetBrains Academy instructor).
👉Join the Coding Club

🎯 Show off your skills:
Take part in the third edition of the JetBrains Youth Coding Challenge — open to school students aged 13–19. Top participants will be invited to the fourth Algorithm and Code Training Camp (ACTS) 2026.1 in Romania or to ACTS Online in January 2026.

UPD: Editorial is out

  • Vote: I like it
  • +128
  • Vote: I do not like it

»
12 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

expert now?

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

All the best everyone!

»
12 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Math, AI, Coding clubs sound like an amazing chance for beginners to grow their skills

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Guys why so many contest are coming?

»
12 months ago, hide # |
 
Vote: I like it -8 Vote: I do not like it

Is this a rated contest? Can someone kindly answer?

»
12 months ago, hide # |
Rev. 3  
Vote: I like it +16 Vote: I do not like it

Hi awoo,

Anything you can do to help with the crawling bans for hacking? These crawling bans have three key disadvantages:

  1. Weaker test cases.
  2. Weaker cheat detection.
  3. Worse user experience.

On other platforms (such as leetcode), I can freely click through submissions which is valuable for additional test cases and cheat detection. On codeforces it seems like there’s a unique technical constraint that currently results in broad bans on anyone clicking through submissions at a normal pace.

Anything you can do to improve the experience for people who enjoy contributing to hacking rounds would be greatly appreciated.

Thanks,

DarkTemplarDrop

»
12 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

I hope I can reach Cyan in this contest

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

will i return to expert? we are waiting :)

»
12 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

I am newbie. Will I reach to pupil :)

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

no unrated participation?

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    why unrated? trust yourself

    • »
      »
      »
      12 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Sometimes there are occupancies during the contest timings, its better to participate unrated than to use an alt account.

      • »
        »
        »
        »
        12 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Maybe you can wait for another day and do virtual participant.

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    click to see all of the contest registrants, and there is a button for changing to unrated

»
12 months ago, hide # |
 
Vote: I like it -14 Vote: I do not like it

watch me win

»
12 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

It would be great to have the unrated participation option available for all the contests, always, MikeMirzayanov ❤️

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Will grind Hard to become Pupil, This time .

»
12 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

6 or 7 problems?

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Not able to participate as unrated ;-;

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    click to see all of the contest registrants, and there is a button for changing to unrated

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

wish to be a pupil

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

all the best!

wishing for +ve delta for everyone

»
12 months ago, hide # |
 
Vote: I like it -8 Vote: I do not like it

For some reason I have a button to register unrated, and it does not show me that I am out of competition, and I'm definitely over 2100 rating.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As dumb a question as this might be, but are all the Educational rounds hosted by Neapolis University Pafos?

If yes, then what are they for exactly? Honestly, I join for rating.

»
12 months ago, hide # |
 
Vote: I like it +34 Vote: I do not like it

Is it normal for so many submissions for a problem like D. It doesn't felt that easy.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How did so many solve E1????

»
12 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Yet another time I feel E<D. Got stuck on D for one hour and do not have time to implement E2 :(

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Can u give me some hints for E1? I don't know I made some observations but feel stuck now.

    • »
      »
      »
      12 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      L is strictly increasing, and R is strictly decreasing. Therefore, L and R have only one item in common, which is the end of L and the beginning of R. So we consider enumerating these positions and calculate the sum.

      • »
        »
        »
        »
        12 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Consider using dynamic programming to calculate the number of ways each position can be the end of a subsequence. The final answer is obtained by choosing an endpoint for L and a starting point for R, and then multiplying by the number of ways to select arbitrarily from the middle.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

what rating range of question should I solve if I am stuck at C always for Div2?

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    Looks like I found you again mate while scrolling, keep trying man you will make it to green. Also try to solve problems in an organized matter like do usaco they have cf problems and ones from other sites organized in every category. Like for example c was just dp nothing else as simple as that you just have to do some for a long time in the usaco

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

speedforces

»
12 months ago, hide # |
 
Vote: I like it +30 Vote: I do not like it

well well well , good D. Don't know how people solved it, stared screen for 1:30 Hour

»
12 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Can someone tell how did they solve D?

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    you need to check for all x [2 , max(ai)] , just think how you can optimize division get the sum quickly.

    and answer for division will be same for a range of elements

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Hi there, this is my solution for D. So you will try all X, if you have X, there 200000/X value that you can potentially keep. Now let say one of these value you can keep as J.If you divide all C[i] by X.All C[i] that has value from (J-1)*X+1 to J*X will become J.And the number of sign you can save is MIN(C[J],Number of sign from (J-1)*X+1 to J*X. Now that we have a solution, how do we know this can run in allowed time constraint. Let's say our complexity is 2e5/1 + 2e5/2 +...+2e5/2e5. This sum shall be equal to 2e5LOG. Hope this help.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why does Writing code in java gives TLE in D wheras CPP code works

»
12 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Logic for C ?

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it
    hint
  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    There is always a solution, so the minimum answer is 2. First, create a valid solution for both arrays, then see if you can swap any position. If you can, just multiply by 2 each time. 338832246

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

can someone explain whats wrong in my code

  dp[0][1] = 0;
    dp[0][0] = 1;
    
    for(int i = 1; i <= n; i++)
    {
         // same 
         if(a[i] >= a[i-1] && b[i] >= b[i-1] )
         {
             dp[i][0] += dp[i-1][0]%m;
         }
         if(a[i] >= b[i-1] && b[i] >= a[i-1])
         {
             dp[i][0] = (dp[i][0]%m + dp[i-1][1]%m)%m;
         }
         
         
          if(a[i] >= a[i-1] && b[i] >= b[i-1] )
         {
             dp[i][1] += dp[i-1][1]%m;
         }
         if(a[i] >= b[i-1] && b[i] >= a[i-1])
         {
             dp[i][1] = (dp[i][1]%m + dp[i-1][0]%m)%m;
         }
         
         
    }
    
    int ans = dp[n][0]%m + dp[n][1]%m;
»
12 months ago, hide # |
 
Vote: I like it -9 Vote: I do not like it
PS C:\Users\total\Desktop\prep\cf> g++ -o E.cpp E
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find E: No such file or directory
collect2.exe: error: ld returned 1 exit status

Bruh minGW straight up deleted my files instead of compiling and then said "oh whoopsie I can't find the file :D"

I was able to even recover E once somehow and then it happened again sadge

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    NOOOOOOOOOOOOOOOOOOO (it's so over I can't even write the compilation command right)

    • »
      »
      »
      12 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Sad. I think you should look into less tedious ways. Also, you will only be working on one problem at a time so why not just use g++ E.cpp and use the a.out executable?

      • »
        »
        »
        »
        12 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Yeah good point. I like having all the .exes in the same place so when I get stuck I can switch problems, but ig it won't hurt to just recompile. Also might be time to finally use a macro.

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I think changing the position of -o will fix the problem: g++ E.cpp -o E

»
12 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

got MLE on PD...
time: $$$O(n \sqrt {n})$$$
space: $$$O(n \sqrt {n})$$$
I forgot that $$$O(n \sqrt{n})$$$ is too large for space complexity...

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

D was really good problem. Any hints ?

  • »
    »
    12 months ago, hide # ^ |
    Rev. 3  
    Vote: I like it 0 Vote: I do not like it

    Consider some final price, p. Now for some i, p = ceil(c[i] / x). Now, it's easy to see that we will get the same price p for not only c[i] costs but for a range of costs. Suppose x = 5, then ceil(50 / 5) = ceil(49 / 5) = ceil(48 / 5) = ceil(47 / 5) = ceil(46 / 5) = 10. So, a good idea is : we can find the range and work on how many times the elements in that range will appear in the original array.

    p — 1 < c[i] / x <= p -> c[i] ∈ [(p — 1) * x, p * x]; x ∈ [2, max_cost]

    We can simply store the frequency of each cost in a frq array and make another prefix sum array called pref such that pref[j] — pref[i — 1] = Number of occurrences of elements from the range i to j. Then iterate over all x and get the new sum of the array of costs. For each value of x, we'll get a result = sum — y * (n — cnt); where cnt = Number of elements in the range [x * (p — 1) + 1, p * x], p is calculated for the corresponding x. Finally maximize the ans. ans = max(ans, result); Time Complexity = O(max * log(max));

    • »
      »
      »
      12 months ago, hide # ^ |
      Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      Time Complexity is not $$$O(n^2)$$$ you can optimize by fixing a MAX value till which the old array elements are and now for each $$$x$$$ the range of $$$p$$$ you have to check is such that $$$(p-1)x + 1 \leq MAX$$$ so $$$p \approx \frac{MAX}{x}$$$.So total time is

      $$$\sum \dfrac{MAX}{x} \approx MAX \times log(MAX_X) $$$
    • »
      »
      »
      12 months ago, hide # ^ |
      Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      Hey I got same idea to find the frequency quickly but unable to get the Idea of frequency array pref can you give a little bit more detail

      • »
        »
        »
        »
        12 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Umm it's quite straightforward. U just make a frequency array, vectorfrq(max_cost + 5, 0) and store the frequency of the elements of the original array there. Then to calculate the frequency of the elements in a range efficiently, use another array as the prefix sum array, vector pref(mx + 5, 0) where pref[i] = pref[i — 1] + frq[i], for all i ∈ [1, mx]. Now, we can calculate the frequency of a range of elements in O(1). ∑frq(l, r) = pref[r] — pref[l — 1];

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

couldn't even solve A. Problem A was definitely higher than 800, or maybe I'm too dumb.

»
12 months ago, hide # |
 
Vote: I like it +30 Vote: I do not like it
»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

My solution for C. Idk what is wrong in this. Plz help

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll pow(ll a,ll b, ll c)
{
  ll res=1; 
  while(b>0)
   { if(b&1)  { res=((res%c)*(a%c))%c;} 
   a=((a)*(a))%c; b/=2;}
   return res%c;
   
}
int main()
{
   int t;ll mod=998244353;
   cin>>t;
   while(t--)
   {
       ll n;
       cin>>n;
       ll a[n],b[n];
       for(ll i=0;i<n;i++)
         cin>>a[i];
      for(ll i=0;i<n;i++)
         cin>>b[i];
      vector<ll>dp(n+1,0);
      //dp[i] all good subset ending at index i
      for(ll i=0;i<n;i++)
      {
         ll r=a[i],s=b[i];
         if(r>s)swap(r,s);
         for(ll j=0;j<i;j++)
         {
            ll c=a[j],d=b[j];
            if(c>d)swap(c,d);
            if(c>r && d>s)
            {
              dp[i]= (dp[i]+pow(2,dp[j],mod))%mod;
            }

         }
      } ll ans=0;
      for(ll i=0;i<=n;i++)
         ans=(ans+dp[i])%mod;
       cout<<ans<<endl;
   }

}

Why is this wrong someone explain plz

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    try to solve the problem in O(n)

    very simple

    for each ai , bi or there is either 1 way or there are 2 ways (you can swap)

    try greedy

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    What does $$$2^{dp[j]}$$$ mean here? It seems too big.

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it +2 Vote: I do not like it
    • For each position i, we have two choices:
    1. Do not swap: Keep (a[i], b[i]) as is.
    2. Swap: Make it (b[i], a[i]).
    • We must ensure that after all decisions, both arrays are sorted.

    • We need a DP-based solution since trying all 2^n subsets explicitly is too slow.

    dp[i][0] = number of valid ways to reach index i where we do NOT swap a[i], b[i]

    dp[i][1] = number of valid ways to reach index i where we DO swap a[i], b[i]

    dp[1][0] = dp[1][1] = 1; At the first position, both swap and no-swap are allowed.

    Transition for each i = 2 to n:

    - if (a[i] >= a[i - 1] && b[i] >= b[i - 1])
        dp[i][0] += dp[i - 1][0];
    
    - if (a[i] >= b[i - 1] && b[i] >= a[i - 1])
        dp[i][0] += dp[i - 1][1];
    
    - if (b[i] >= a[i - 1] && a[i] >= b[i - 1])
        dp[i][1] += dp[i - 1][0];
    
    - if (b[i] >= b[i - 1] && a[i] >= a[i - 1])
        dp[i][1] += dp[i - 1][1];
    
    

    Each transition checks if the current pair (either swapped or not) can maintain sorted order from the previous state (either swapped or not).

    After processing all indices, the answer is dp[n][0] + dp[n][1].

    Submission : 338809665

»
12 months ago, hide # |
 
Vote: I like it +36 Vote: I do not like it

Stuck in D for an whole hour getting both MLE and TLE because I thought the intended solution is $$$O(N\sqrt{N})$$$. sad.

»
12 months ago, hide # |
Rev. 2  
Vote: I like it +32 Vote: I do not like it

E1<<<D

»
12 months ago, hide # |
Rev. 3  
Vote: I like it +1 Vote: I do not like it

I felt like time limit was too tight for D :/

My nlogn solution in cpp TLEed

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it +7 Vote: I do not like it

    Also, i didnt get the point of having 10 test cases per test without any limit on the sum of n. That can allow 2e6 input elements with 2 sec limit

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Use fast I/O. ios_base::sync_with_stdio(false); cin.tie(NULL); add this at the beginning of the main function and it should pass.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

The current time limit for Python on problem E1 seems too strict. My solution, which is clearly O(n^2), times out on test 20 even though this complexity should be acceptable for the given constraints. Could you please consider raising the Python time limit and rejudging all Python submissions for this task? Here is my code for reference (it’s straightforwardly O(n^2), submitted on PyPy 3.10) : 338820099

»
12 months ago, hide # |
 
Vote: I like it -10 Vote: I do not like it

.

»
12 months ago, hide # |
 
Vote: I like it +17 Vote: I do not like it

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can anyone please tell what is error in this code?? https://pastebin.com/kacZJB1A

»
12 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

Sat like a fish out of water after seeing D :(

»
12 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Straightforward for D:

  • Prices: c1,…,cn. Let C = max(ci) ≤ 200000.
  • New prices: ceil(ci / x). Printing cost: y.
  • Let t be the number of new prices that coincide with existing tags (some cj).
  • Objective: f(x) = sum_i ceil(ci / x) − y*(n − t) = (sum_i ceil(ci / x)) − y*n + y*t.

When an old tag cj “covers” a new price ceil(ci / x):

  • Condition: cj = ceil(ci / x) ⇔ (cj − 1)*x < ci ≤ cj*x.
  • For fixed x, all ci fall into buckets ((cj−1)*x, cj*x] and produce new price cj.

Range of cj for fixed x:

  • From ci ≤ C we get cj ≤ C/x + 1.
  • Hence iterate cj = 1..V(x), where V(x) = ceil(C / x).

Frequencies and prefix sums over original prices:

  • freq[v] = #{i : ci = v}.
  • P[t] = sum_{v ≤ t} freq[v], with P[0] = 0.

How many ci produce the new price cj:

  • new_x[cj] = P(min(cj*x, C)) − P(min((cj−1)*x, C)).

How many tags are reused:

  • t(x) = sum_{cj=1..V(x)} min(new_x[cj], freq[cj]).

Enumeration:

  • x = 2, 3, …, C (for x ≥ C we have ceil(ci / x) = 1 for all i, same value as x = C).
  • Take the maximum f(x).

Complexity:

  • Total over all x: sum_x ceil(C / x) = O(C log C).
»
12 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

I think it was a decent Edu round.

  • A. An observation (divisibility of the sum by 3) could've made life easier, but I just implemented the brute force solution.
  • B. Decent B with a small corner case, which can be dealt with without much struggle.
  • C. Share spirit with A, and here an observation (make A < B first, then count good pairs) could've also sped up AC, but I again used the first idea I had, which was dp
  • D. So sad that I couldn't figure how to use the harmonic series $$$O(n \log n)$$$ thing here during the contest. The problem is great.
»
12 months ago, hide # |
Rev. 4  
Vote: I like it +1 Vote: I do not like it

To solve problem C, I used this O(n) approach.

Let dp[i] be the number of good subsets that use elements from positions 1 to i.

If a[i] ≥ a[i-1],
a[i] ≥ b[i-1],
b[i] ≥ b[i-1],
b[i] ≥ a[i-1]

then adding index i+1 is optional. For every existing good subset, we can either keep it as is or include i+1, which doubles the count: dp[i+1] = 2 * dp[i]

Otherwise, adding index i+1 is required to maintain validity, so the count stays the same: dp[i+1] = dp[i]

My Code
»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

C can be solved without dp.

idea: at first swap each pair so that $$$a[i] \geq b[i]$$$

Then both sequences are sorted. It’s not hard to see that the entire set of indices now splits into disjoint segments, where we can either swap all elements or not swap them at all. The answer is $$$2^{numberOfSuchSegments}$$$.

code: 338797210

»
12 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it
»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I don't understand my D solution. I calculated prefix sums until 2e5, wrong answer on test case 5. But when i changed it to 3e5, it ACed? Why's that happening? shouldn't we check only until max value?

https://codeforces.me/contest/2144/submission/338844703

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Your inner for loop looks like for(ll j=i;j<=200001;j+=i). You derive r = j, l = j - i + 1 from it. Ideally, we will only need to check till 2e5, not 2e5 + 1.

    Now consider the case where j > 2e5, but j-i+1 <= 2e5. Your j <= 2e5 condition will evaluate to false, but you end up missing the elements in the range [j-i+1, 2e5]. So, what you should do is check for j-i+1 <= 2e5 and set l = min(j, 2e5) instead.

    AC with these changes: https://codeforces.me/contest/2144/submission/338884584

»
12 months ago, hide # |
 
Vote: I like it +23 Vote: I do not like it

These questions are all very interesting and I really like them.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

sadly, don't solve problem D in contest, i realized that I needed to enumerate over the value domain, but in the end, I still didn’t figure it out clearly.

»
12 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it
»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Problem B. Maximum Cost Permutation

Video Editorial Link: https://youtu.be/f3RfU-lfuH0?si=Ge5mszVMB8SH-5Zs

Thanks for watching!

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

The testcases for C are so weak that my dp code passes only just MODing the final answer.

Code

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

When the contest being,Chinese students are sleeping.I am not happy,because I can't take part in this contest,I have to go to sleep.:(

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I have reached home from office nearly one hour after the contest began… yet that didn’t stop me from scoring 3 problems on the very first attempt within 50 minutes, Siuuu...

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I think it turned unrated.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I think peaple's feedbacks with D is interesting. Seems $$$O(n + \frac{n}{2} + \frac{n}{3} + \dots + \frac{n}{n}) = O(n \log n)$$$ is a well known trick. But after some simple transformations, it did confuse many people, including me :)

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What's the difference between educational rounds and normal div2 rounds?

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Different scoring style and the problems are more of educational kind(they teach u some concept)

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

When the tutorial will be released ?

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why is there no score for this contest?

»
12 months ago, hide # |
 
Vote: I like it -8 Vote: I do not like it
  • »
    »
    12 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    That is not O(n^2). If you see he is terminating the 2nd loop if j*i<=3e5 which reduces the time complexity to O(nlogn).

    • »
      »
      »
      12 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      it’s my code lol. Thats not the part thats n^2. Look at the next part of the code.

      • »
        »
        »
        »
        12 months ago, hide # ^ |
        Rev. 2  
        Vote: I like it 0 Vote: I do not like it

        You have a big fat if statement before that second loop It ensures that the loop for j 0->n is not run everytime.

        • »
          »
          »
          »
          »
          12 months ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          Sure, but there’s no reason to believe that that heuristic should prevent it from being O(n^2).

»
12 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

where is rating?

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

My first rated match. Solved Problem B. In problem A, printed arr[i] and arr[j] instead of I and j. But timer got over. Friends,can you tell if div 2 regular round is tougher than educational round div 2.

»
12 months ago, hide # |
 
Vote: I like it -8 Vote: I do not like it

It's my first time to participate the contest, why does my interface display "unallowed rated"? :(

»
12 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

can somebody tell me where i am going wrong ? submission for D

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Please Give me My rating updates, T_T

»
12 months ago, hide # |
 
Vote: I like it -11 Vote: I do not like it

Anyone got the ratings for this ?? I haven’t got it yet it’s been 12+hrs

»
12 months ago, hide # |
 
Vote: I like it -11 Vote: I do not like it

Why the rating does not gets updated for the contest Educational Codeforces Round 182 ?

»
12 months ago, hide # |
 
Vote: I like it -11 Vote: I do not like it

why is it unrated?

»
12 months ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

Where is the editorial?

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

ANY HINTS FOR 'C' ??

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    there are 4 types of element in it : 1. fixed: if a[i]<=a[i+1] && a[i]>b[i+1] and vice versa 2. essential change: if a[i]>a[i+1] && a[i]<=b[i+1] ...

    in these cases we have no other choice. 3. free: if a[i]<=a[i+1] && a[i]<=b[i+1] ... this one can change.

    4th is not possible as per question. so we will take continious ones with no choice as 1 element, count all element(say k) calculate and print 2^k.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Thanks to this contest because after this contest I'm out of newbie now.

»
12 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

In the recent Educational Codeforces Round 182 (Rated for Div. 2), I noticed that the code of this user kzhi shows signs of code plagiarism (338807618). He obfuscated his code, and I feel like he might have taken the solution from AI. I sincerely hope that the admins MikeMirzayanov and the contest organizers awoo can permanently ban this case.

»
12 months ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

please upload the editorial

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I have received a plagiarism warning for my submission, but I do not know the other participant whose solution coincided with mine. I did not share my code with anyone, nor did I use any external/public sources. My work was done independently on my local machine, and I have no connection with the flagged user. Please review my case. I am happy to provide any additional information or logs to help clarify the situation.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hi to the moderators and admin. My solution submitted for 2144C was given to be matching with uno_20/338781348. I would like the moderators to once again take a note of the question. In a general 2DDP we have a fixed way of writing the code, I have been doing the same types of questions in same format for last 2-3 months. Now you have flagged it as plagiarised and removed me out of competition what do I do? Will you mark the contestants for writing the same response for "Hello World" too? In the question we had to compare the consecutive elements in 2 arrays and I did exactly that and allocated the best answer to the DP matrix and initialized the dp matrix before hand with 1s. Now how can you all say that my answer is matching with someone even when I do not even know the person. I request you all to please take this into consideration and put me back into the competition because I had outperformed my expectations in that contest and It had be a good achievement for me rather it became something else due to this negligence. It is not fair. I am not wrong here, you need to correct it. 338770485 MikeMirzayanov awoo.

»
12 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Dear organizers,awoo and MikeMirzayanov,

I received a notification about my solution (338804979) for problem 2144E1 - Looking at Towers (easy version) and (338785110) for 2144D - Price Tags coinciding with other participants' solutions. I want to emphasize that I solved the problem independently during the contest using USACO IDE (a private IDE), and I did not share my code with anyone or access external sources.

The similarity in solutions might be due to:

The problem having a common solution approach (e.g., greedy, DP, or standard algorithm) that leads to similar code structures.

Small constraints or obvious implementations that result in identical code segments.

I assure you that I strictly follow Codeforces rules and value the integrity of the platform. I kindly request you to re-evaluate my submission and remove the skip penalty if deemed appropriate.

Thank you for your hard work and fairness.

Best regards,Chillprogammer.

»
12 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Editorial????

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Title: Appeal: False Plagiarism Flag for Submission 338775909 (Problem 2144D) Hello Codeforces team, 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. Thank you for your time and understanding.
@MikeMirzayanov @awoo

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Title: Appeal: False Plagiarism Flag for Submission 338775909 (Problem 2144D) Hello Codeforces team,MikeMirzayanov awoo 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. Thank you for your time and understanding.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hi awoo and MikeMirzayanov,

I received a plagiarism warning regarding my submission 338766379 for problem 2144C, which was marked as coinciding with submission 338804878 by user Chervinko.

I would like to clarify the following:

  1. I submitted earlier.

My submission was made before the compared one.

  1. I did not leak my code. I worked only on my local machine, without sharing my code through pastebins, repositories, or public IDEs.

  2. My solution idea came from a known LeetCode problem. While solving, I recalled the LeetCode problem “Minimum Swaps to Make Sequences Increasing”. That problem also uses a 2-state DP (swap / no swap) with four transition checks. I adapted this idea for the Codeforces problem, but here the task is different. I wrote the solution independently during the contest.

  3. Reason for similarity between participants. Since this DP formulation is a well-known standard approach, independently written solutions naturally end up very similar. The similarity with another participant’s code is coincidental, not due to copying.

Given these points, I kindly ask you to reconsider the skipped verdict on my solution. I respect the rules and take plagiarism very seriously. I assure you this was an independent solution that I developed myself.

Thank you for your time and for organizing the contest.

»
12 months ago, hide # |
Rev. 7  
Vote: I like it 0 Vote: I do not like it

Hello awoo and MikeMirzayanov

I am appealing my plagiarism flag for Educational Round 182, submission [338801217] (problem 2144C).

I want to clarify:

I do not know the other users mentioned (falakejaz2004), and I did not copy their code.

I wrote my own solution during the contest. The problem 2144C – Non-decreasing Array is a straightforward DP problem with a common pattern. Once you identify the condition, many people will naturally write very similar code. That is why my solution might look close to others, even without any copying.

The only external help I sometimes use is AI tools, and only for syntax correction (like fixing semicolons or braces), not for solving problems.

If needed, I can provide proof that I submitted my code earlier and that it was my own work.

It is possible that another participant used AI as well, which generated code that looks similar to mine.

I kindly request that you review this case again. Please restore my rating and ensure my account is not banned. I respect the Codeforces community and I want to continue participating fairly.

Thank you for your understanding.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hello, I received a warning for submission 338795126 for problem 2144F regarding significant similarity with other submissions. I would like to clarify that I wrote this solution independently without copying from anyone else. I may have used common templates or standard approaches that are widely known in competitive programming, which could explain the similarity. I did not use any public code-sharing sites during the contest. All my code was written in my personal environment.

If needed, I am happy to provide a detailed explanation of my approach and the reasoning behind my solution to prove its originality.

»
12 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

[Regarding plagiarism warning for submission 338811303]:

Hello, I received a coincidence warning for my solution (submission ID: 338811303) for problem 2144D. I have posted a detailed clarification on my blog here: https://codeforces.me/blog/Sumits_0803

Please review the explanation there. Thank you for your time.

»
11 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

:/