hugopm's blog

By hugopm, 9 months ago, In English

Hello Codeforces!

We are glad to invite you to Codeforces Round 1039 (Div. 2), which will take place on Jul/27/2025 17:35 (Moscow time).

The problems were created by I_love_Michel_Sardou, Richem, bestial-42-centroids, Yuuuuuuuuuuuuuuuuu and me.

We would like to thank:

You will have 2 hours to solve 6 problems.

Good luck!

UPD: The score distribution is 500 — 1000 — 1250 — 1750 — (1750+1750) — 4000.

UPD2: The editorial is out!

UPD3: Congratulations to the winners!

Div.1

  1. 244mhq
  2. StarSilk
  3. platter
  4. arvindf232
  5. TKT_YI

Div.2

  1. HusseinFarhat
  2. tianbincheng
  3. tw20000807
  4. Grok
  5. Ar1hara_Nanami
  • Vote: I like it
  • +385
  • Vote: I do not like it

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

as a tester and fan of bestial-42-centroids, i encourage everyone to participate!

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

It feels illegal to be this early

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

Might be my favorite Div2 this year! Recommend everyone to participate!

»
9 months ago, hide # |
Rev. 2  
Vote: I like it -11 Vote: I do not like it

As not a tester, I think I'm gonna enjoy this round!

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

ok so I got big negative delta last div2 round, hoping to get good news after this round.

and I hope problem statements are short and sweet like this announcement

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

short and to the point announcement 💚

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

Having a LGM tester is how you know the contest is going to be good

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

Hope getting out Newbie !!!!! and hope for short problem's statements like the announcement

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

As a tester, I think you might want to check out this round!

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

"Yuuuuuuuuuuuuuuuuu and me"

Pun intended?

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

Score distribution??

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

Hoping to get one step closer to Expert or even reach it!

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

Note that this Codeforces round is 100% french (even the coordinator now lives in France :D). We tried to write problems that represent our vision of what problemsolving should feel like. We hope that you will enjoy them :))

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

I wish for myself and all Codeforcers to do well in this contest

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

I haven't done much for the round but I still hope everyone will enjoy it :)

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

Let's hope this first contest on the first day in college is rewarding and hope to get a specialist soon!!!

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

Please allow unrated participation for everyone

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

I hope that in this contest, there shouldn’t be any question which I solve during the contest and it gets accepted, but later during testing it gives TLE. This has already happened in the first two contests — I don’t want it to happen again this time.

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

2h, 6 problem, I think hard contest......

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

I hope the problem statement will be as short as the announcement :)

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

As a participant, orz -firefly-!

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

As a participant, i hope to participate

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

hmm, will my rating plus up?

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

hope not to see newbies or pupils winning this contest

»
9 months ago, hide # |
Rev. 2  
Vote: I like it -11 Vote: I do not like it

looking forward to great problems and my brilliant solutions.(I am scared of falling back to specialist.)

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

I hope that problem statements will be short, simple and sweet like the announcement.

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

Is the French team ioi-25 the creator of this round?

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

WTF? Why G is 4000 pts!

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

Gonna participate then.

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

I hope that the problem statements are also short and simple like the announcement.

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

good luck!

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

Since F is 4000 points: new strat = first solve F, then A-E

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

What's the penalty of a wrong submission? 10 minutes or -50 points?

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

Which scoring system hugopm?? Standard or extended ICPC?

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

good luck !

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

Is div4 no longer happening? This contest gives me a sense of power.

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

score distribution augur well

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

good luck, brothers and sisters!

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

Speedforces ABC yay

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

As a participant, i think i will get: 1) Downwotes to this comment 2) — Rating(because in other Div. 2 i do only 2 tasks)

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

Hope to reach specialist

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

Hope to get back to Expert :(

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

wish no longer to solve fake problem

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

I shall take this contest from my pillow fort

edit: bad contest, I should have just slept

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

gressforces

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

Loved the contest, but I messed up on both A and B.

Clutched(somewhat) soon after ¯_(ツ)_/¯

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

Adityadahiya went from being ranked 16k+ in last div3 to top 100 in this div2. Good stuff.

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

E1 is too classic

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

hint for c?

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

    I don't have proof, but if for any element we have an element on the right which is greater than or equal to twice, then the answer is NO.

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

      so i think it's guesswork during contest?

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

        I am not proud but I guessed it so not sure if system test will pass..

      • »
        »
        »
        »
        9 months ago, hide # ^ |
        Rev. 2  
        Vote: I like it +3 Vote: I do not like it

        bro its not guess work, very easy to prove. suppose any i<j arr[i]<=arr[j] then, for any valid x, we will choose to increase arr[i], thus, arr[j] will only be increased if arr[i]>arr[j]. now, for by how much can we increase arr[j], i.e., what x can we choose, x<=arr[i], because if x>arr[i], then i will be choosen instead of j. thus, arr[j]<arr[i] && x<=arr[i], arr[j]+x<2*arr[i] (sum both equations).

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

        I thought of setting each value from left to right. If we're simulating the process, we can set each value in 2 operations. The sample 5 6 1 1 would have the operations (0,5), (1, 5), (0, 1), (0,1). Since the max you can add in one operation is the largest element on the left(otherwise we're editing that), the max would be 2*largest element. However, for a value x, we can't add x onto x(it has to be strictly greater) so the largest operation is (prefix max-1, prefix max).

  • »
    »
    9 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it +1 Vote: I do not like it

    arr[i] <= max(0, prefix_min[i — 1] + prefix_min[i] — 1) should be true for all i>1

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

    I took the idea that, for a given ith index (expect the first one), You need to construct the a[i] using the minimum of all the elements that occured till now. So Based on that you can maintain a set till the ith element. and then see if ~~~~~ // this is code auto it = *(s.begin()); if( a[i]<=2*it-1){ s.insert(a[i]); } else{ // failed as we cannot construct this element } ~~~~~

    . Basically what we are doing is taht , for 5 6 1 1, we want to see for 5 0 0 0 , can we construct 6 or not , and given our set minimum is just 5, so we can construct next element up to 2*5 — 1 (till 11) . So , ussing this you can do this problem in O(1) per element, and overall O(n)

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

how does one find the actual ranges in E2? I know how to find the medians but not the corresponding ranges

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

    I think we can work on all subarrays of size k and k+1. Then for each such sub array we would have a range of l to r. I think this would work but wasn’t able to implement until end

    • »
      »
      »
      9 months ago, hide # ^ |
      Rev. 2  
      Vote: I like it +5 Vote: I do not like it

      This is wrong. For $$$a = [1, 1, 2, 2, 2, 2, 1, 1]$$$ and $$$k = 6$$$, then $$$1$$$ is not a median of any subarray of length $$$k = 6$$$ or $$$k+1 = 7$$$, but it is a median of the whole array.

      More generally if you consider $$$a = [2^x, 1^x, 2^{2x}, 1^x, 2^x]$$$ where $$$y^x$$$ is $$$y$$$ repeated $$$x$$$ times, then the length of the array is $$$6x$$$.

      If you put $$$k = 2x+1$$$, $$$1$$$ is a median of a single subarray which has length $$$4x$$$ and this is close neither to $$$k$$$ or $$$n$$$ (so heuristics like trying a lot of random lengths wouldn't work).

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

        Yes got that. Had no time to think more. Anyways very cool problem. I hope to upsolve it

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

    For some (multi)set S with a range [l r] or medians, any set S' formed by adding or removing an element to/from S has a range of medians that intersects [l r], so if you find the minimum and maximum medians and their intervals [lmin rmin] and [lmax rmax], just walking from one interval to the other will give you a set of O(n) intervals whose union of ranges of medians is the entire range from the minimum to the maximum median achievable.

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

    Read the editorial. I tried to make it as clear as possible but it's probably still not very clear, you can ask questions :)

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

how come i always get messed up on A

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

Mental torture simulator contest

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

time to touch grass

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

MOTHER OF GUESSFORCES

guessed C,D,E1 without much proper analysis, hoping for a positive system test run.

also even after solving 5 questions, rank is around 1000 .. that doesn't make me happy.

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

E2 is wonderful, thank you!

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

nice div3

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

b>=c

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

haizzz, i hate this contest

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

brain cancer inducing C

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

Permutations of [1 to n] forces...

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

Unfortunately, I found E1<D and even E1<C for me when the contest almost end.

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

    How did u solve E1? I had no clue. Just wrong guesses

    • »
      »
      »
      9 months ago, hide # ^ |
      Rev. 4  
      Vote: I like it 0 Vote: I do not like it
      Clues
»
9 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hoping to reach Specialist with this contest :)

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

If I wanted to guess, I'd play Guess Who?, not give Codeforces contests.

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

hint for c?

i couldn't guess its logic

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

    you cant go past any element with a value greater than or equal to twice its value

    • »
      »
      »
      9 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it
      for(int i = 0; i<n; i+=2){
      		if(i+1 >=n){
      			NO;
      			return;
      		}
      		if(v[i] <= v[i+1] && v[i+1]/v[i]<=1){
      			// ok
      		}
      		else{
      			NO;
      			return;
      		}
      	}
      
      	YES;
      	return;
      

      does this work?

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

    initiate a curmin that stores the minimum value seen in array so far . initialise it to a[0]. now note you can always make any element to its value if it is <2*curmin . if not you just output no Eg: to make 5 9 you do 5 0 -> 5 4->5 9 try making 5 10 ; you wont be able to

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

    hint: start traversal from the end

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

felt more like a div 2.5 edit: how did me and many more got system testing failed in A?!

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

Newbies first contest (at 24:00), got A for 444 point before immediately choked on B twice by TLE and one failed hack QAQ Great Game, will learn C++ tmr, python got me TLE thrice

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

E2 is Mo's Algorithm

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

is there a use for property given in problem D ie max(a1, a2) > a3, my solution didn't use it but passed pretest.

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

    because of that constraint the LDS ending at ith element will always include one or both of $$$ a_{i-1}, a_{i-2} $$$

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

      ok my solution felt simple enough .. but maybe this will simplify something more.. hope to understand better in editorial..

      also hoping that my solution doesn't fail system test lmao.

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

    yeap

    let's look at p[i] < p[i + 1]

    it obviously reduces the answer for the subsegment by at least 1

    but since max(p[i — 1], p[i]) > p[i + 1] => p[i — 1] > p[i + 1], the answer will decrease by exactly 1

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

wtf was wrong with D? I'm still not sure where does the max(p1, p2) > p3 comes in play

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

Fiddling with the stupid transition dp on D for the last 40 minutes, only to solve it 5 mins after the contest over.

if arr[i] < arr[i — 1] -> dp[i] = dp[i — 1] + (i + 1).

else dp[i] = dp[i — 1] + 1

yikes

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

    yeah I did the same and this doesn't use the property given in the question, so I Was not sure if it is correct

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

      Actually it does

      The property gives the array a specific form that makes either i-1 or i-2 the best candidate for the last term of the decreasing subsequence otherwise you would have to look behind i-2 to see if you can find something better

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

    long long ans = (long long)n * (n + 1) / 2; for (int i = 0; i + 1 < n; ++i) { if (v[i] > v[i + 1]) { long long left = i + 1; long long right = n - i - 1; ans += left * right; } } cout << ans << "\n";

    I did something like this, like it is similar logic without dp

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

It feels demotivating to not be able to solve anything after Problem A. :((

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

    B in my opinion was much tricker than C. The edge case where the length of the array is odd was funky.

    It was pretty easy to figure out you can just alternate using pairs and just keep removing either (LR) or (RL) depending on if your previous removal was increasing or decreasing. The only issue is when the array is odd, you can get a case where the final element in the middle screws you.

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

can someone explain the idea of c ?

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

    Lets build the array of length 2.

    can we build the array [4, 8]?

    No.

    can we build the array [4, 7]?

    Yes.

    [4, 0] -> [4, 3] -> [4, 7]

    Can you see now why we can't construct [4, 8]?

    Build the array in order A[1]..A[N]. What is the MAX value that A[i] can be?

    min(a[0:i-1]) * 2 — 1

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

Did I dazzle? I saw 11 greedy tags and 3 sorting tags in problem A

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

 why so

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

what the flow is this 331128282

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

4k solves on $$$D$$$ and 1.8k on $$$E1$$$ :skull:

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

great adhoc problems, these are the type of problems where LLMs fail.

But why soo many submissions?

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

what is solution for E1

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

I have some consideration about E2 but I dont know wether it is true,can sb. answer?: just like E1 , we can solve max and min submedians with its segment. guess: submediens is continuous and when change segement with one element insert or delete, the change of median is continuous as well. so we can translate from min-submedian-segment to max-submedian-segement by O(n) and update segement of all median between them. Is this true? I have not participated in this contest.

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

Good contest and clear statements. I'm glad that I eventually ended up solving D.

  • A. Decent A problem. I was quite slow in figuring out and initially thought about ascending order.
  • B. One of those a bit tricky problems with excessive details (we don't really need 5-chains I think) that can mislead.
  • C. Cute and short mathy problem. I just wrote couple formulas for the iteration and got the answer.
  • D. I was long stuck thinking in a wrong direction. It turned out I was missing a small observation (just compare $$$a_i$$$ and $$$a_{i+1}$$$ to compute how much we should substract from the sum of lengths from the previous step) which made the problem straightforward.
  • E. I had 30 minutes and unfortunately was unable to finish implementation of a probably wrong idea anyway.

Decent and balanced contest, the participation was engaging. GJ.

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

contest ended right before I submit E1 :(

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

Thx for not having pretests for equality case in A (T.T)

Now 16+ pages of wa5 during system tests(

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

i gave up on first problem

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

We are extremely sorry for the hacks due to the equality case on problem A. This is so painfully obvious once we saw it, but for some reason it was unnoticed despite all our efforts in the preparation of the problems and the extensive testing we did :( We hope you still enjoyed the problems and we will do better next time!

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

1486D - Max Median and E1 are basically the same

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

I failed on pretest 2 for C, and I don't get how it could be wrong. Can anyone help me?

#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  
  int tcase;
  cin >> tcase;
  for(int i=0;i<tcase;i++) {
    int n,minimum=1000000001;
    bool possible=true;
    cin >> n;
    for(int j=0;j<n;j++) {
      int x;
      cin >> x;
      if(x<minimum) {
        minimum=x;
      }else if(x>=minimum*2) {
        possible=false;
        break;
      }
    }
    if(possible) {
      cout << "YES";
    }else cout << "NO";
    cout << '\n';
  }
}

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

    You're idea is correct, but you're breaking the loop as soon as you get x >= 2 * minimum, and it causes wrong inputs for next test cases. Remove the break statement, it will work.

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

    Try long long instead of int. The problem is if minimum equals 1e9, then 2 * minimum occurs int overflow.

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

In the Question B for test case: 7 1 2 3 4 5 6 7 Output can be any of the following LLLLLLL , RRRRRRR , RLLLLLL , .... But I get wrong answer for all of them. Anyone please give me proper explanation for that.

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

Nice tags on A, B, E1, and F lol

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

my first A,B,C best contest I have ever seen THANKS

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

did anyone solve D while ignoring the max(pi,p_(i+1))>p_(i+2) condtion?

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

Why is there no test in the first four tests that contains wrong forgetting the =?[problem:A]

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

Fast tests, fast editorial releases, great race. Except for the fact that A's pre-test data is not comprehensive enough, everything is so perfect.♪(・ω・)ノ

(Please forgive me for writing reviews using the translation plugin, my English is not good QAQ)

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

    I'm glad you enjoyed the problems :) Sorry about the pretests of A, we'll do our best to not repeat this mistake!

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

no test for whether a number is strictly greater than c..... ;(

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

E1's idea is similar to 1486D - Max Median.

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

Somehow I solved 4 problems and only got +27 rating :(

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

Here, are my two submission [submission — 1 & Submission 2] for the below testcase both not giving same ans but both are accepted! In second submission my idea was deleting same value coin by cost one. According the problem statement **First, you must choose a trash bag and destroy it. It will cost 1 coin if the weight of the trash bag is strictly greater than c, and it will cost 0 coins otherwise. **. which is wrong but giving AC in the judge!

Testcase: 1 5 10 40 60 20 10 10

Output: 4

»
9 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
// this is code

#include <iostream>
using namespace std;

int main () {
    int t;
    cin >> t;

    while (t--)
    {
        int n, c;
        cin >> n >> c;

        int a[n];
        for (int i = 0; i < n; i++)
        {
            cin >> a[i];
        }

        int cnt = 0, temp;

        for (int i = 0; i < n - 1; i++)
        {
            for (int j = 0; j < n - i - 1; j++)
            {
                if (a[j] < a[j+1])
                {
                    temp = a[j];
                    a[j] = a[j+1];
                    a[j+1] = temp;
                }
                
            }
            
        }
        
        int mult = 1;
        for (int i = 0; i < n; i++)
        {
            if (mult * a[i] > c) {
                cnt++;
            } else {
                mult *= 2;
            }
        }
       
        cout << cnt << endl;
        
    }

    return 0;
}

In the contest time, what I did till the sorting was right. But then my logic was, for (int i = 0; i < n; i++) { if (a[i] > c) { cnt++; } a[i] *= 2;

}

After that I saw one of the solutions in where mult var was used to solve and there was an else while making mult 2 times each time. Now, my questions are- 1. Why we need to use mult as in the problem it's sated that each item/bag a[i] will get multiplied by two ? 2. If though using mult, then why the mult *= 2; will go into else statement ? As it's stated that two actions will happen 'successively' NOT 'if or else' !

  • Thanks in advance.
»
9 months ago, hide # |
 
Vote: I like it -25 Vote: I do not like it

The tests in problem A is week, what is the benefit of getting WA on Test 5 in problem A !!

This div shouldn't be rated :(

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

Thank you for such a weak pretest, I went from positive delta to -16

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

Problem D — Sum of LDS

Is the answer to the following test case 15? Why is the answer of all the passed codes 16? 4 4 2 3 1

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

@zeyd123

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

@sirkim21

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

this contest was too challenging and q3 also.

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

____-___

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

Hello Codeforces Team,

I received a message that my solution for problem 2128E1 (submission ID: 331147743) coincided with others. I want to clarify that I solved the problem entirely on the Codeforces website, without using any local IDE or online editor, and I did not share or copy code from anywhere.

I wrote the code myself during the contest and did not make it public in any way. If many users have similar code, it may be due to common logic or structure for the problem.

I respect Codeforces and its rules, and I kindly request you to review my case. I assure you there was no dishonest intent on my part.

Thank you for your time and consideration.

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

Twenty minutes ago, I received an email regarding code duplication. My submission for Problem D: [331148990][https://mirror.codeforces.com/contest/2128/submission/331148990]

was flagged as duplicate, even though I only needed less than 10 minutes to figure out the solution and solve it.

I was furious that code I wrote entirely on my own was flagged as duplicate. I reviewed some of the submissions mentioned in the email and found that most used the same variable names and nearly identical structure. My code is similar in structure and concept to the others.

But I don't understand: can these alone be used as a criterion for cheating? Remember, this problem only has three parts:

  1. Input
  2. Monotone Stack Template
  3. Calculate the answer and output

So, similar code is almost inevitable. Just like most div2A and div2B problems, everyone's code is very similar, with just a few lines of code.

So, I filed an appeal, hoping to have the erroneous flagged.

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

Dear Codeforces Team,

I received a code similarity notification for my submission in Round 1039. I believe this is a coincidence because:

in problem C: 1. Problem Logic is Straightforward
The problem's solution is based on a simple greedy approach with a min_pref check, which naturally leads to similar implementations. Many participants likely used the same logic: — Check if n == 1 (trivial case). — Iterate through the array while tracking the minimum prefix (min_pref). — Compare b[i] with 2 * min_pref.

in problem E1: 2. Standard Binary Search + Prefix Sum Approach
The problem requires finding the maximum value u such that a subarray of length ≥k meets a condition. This naturally leads to: — Binary search on u. — A prefix sum check (with +1/-1 conversion) to validate the condition.
This is a well-known technique (e.g., discussed in CP-Algorithms or USACO Guide).

  1. No External Code Used
    I did not refer to any external sources during the contest. The similarity is due to the problem's constraints favoring this standard approach.

  2. Variable Naming Differences
    While the logic is similar, my variable names (e.g., min_pref, min_pos) differ from others, indicating independent implementation.

Could you please review my submission? Thank you for your time.

Best regards!

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

missed it bruh :(

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

.

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

Dear Codeforces Team,

I recently received notifications about code similarity issues in my applications for Round 1039. I assure you that I solved these problems on my own during the competition, using only my knowledge and without referring to any external sources, general materials or online platforms.

Regarding task B (2128B): The solution is based on a simple greedy approach.

My logic is natural for the constraints of the task. Given the simplicity, similarities in structure are expected for all participants, which is very similar to common solutions for Div2A/B tasks.

As for the E1 (2128E1) problem: The solution uses a standard methodology

My approach is well documented on competitive programming resources (for example, CP-Algorithms) and is the obvious choice for "maximum value with subarray constraints" tasks.

I understand the need to be vigilant about violations, but it seems to be a case of independent implementations converging due to problematic constraints. I kindly ask you to review my materials.

Thank you for your time.

»
11 days ago, hide # |
 
Vote: I like it -8 Vote: I do not like it