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

Автор ezraft, 2 месяца назад, По-английски

Hello, Codeforces!

We are glad to announce that Codeforces Round 1108 (Div. 2) will take place on Jul/12/2026 17:35 (Moscow time). The round will be rated for participants with rating below $$$2100$$$. You will be offered $$$6$$$ problems, with $$$2$$$ hours and $$$15$$$ minutes to solve them. At least one problem will be interactive, so please make sure to read the guide for interactive problems before the contest.

The problemset was created and prepared by 0mar, countful, diss_quack, farmpiggie, lce4113, Whoname, and me. We are all members of the UCSB ICPC community.

Thank you to the following people who made the round possible:

We hope you will enjoy the round!

Left/Top: ezraft, Whoname, 0mar, lce4113, countful, diss_quack at the ICPC Southern California Regional.

Right/Bottom: diss_quack, ezraft, lce4113, farmpiggie at the ICPC North American Championship.

UPD: The scoring distribution is $$$500-750-1500-1750-2250-2750.$$$

UPD2: Editorial

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

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

oars sirs

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

ok

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

as a tester, make sure to smash that register button

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

woah

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

as a tester

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

As not a tester i hope i become pupil in this contest

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

:)

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

As a tester, front forget, back forget.

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

At least one problem will be interactive

yes yes yes yse finally

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

Finally an interactive problem....

Excited!

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

I LOVE YOU COUNTFUL! I LOVE YOU COUNTFUL! I LOVE YOU COUNTFUL! I LOVE YOU COUNTF

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

As a tester, UCSB is next to a beach

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

As a participant, .

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

my #99 rated contest! good luck every participant!

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

I hope there will be 6 interactive problems

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

As a taster, countful gave me his burritos

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

oof, i read ucsb as usb-c somehow

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

Has anyone tested the solvability of the problems using AI?

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

Hope i am able to solve till D or E . glhf

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

Thanks for the round , Wishing everyone the best of luck

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

.

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

As a participant I hope to reach expert this round pls pls pls

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

hello **everyone ** how are you all??

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

OK

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

ezraft lce4113 Thanks for organizing.

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

Excited to see yg again at NAC next year

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

As not a tester i hope i become candidate in this contest

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

First half of time: solved ABCD.

Second half of time: stared at the screen to see my rank dropping.

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

I'm asking myself where did my comments go:

Before:
After:

PS: How can the author write the checker for A?

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

hint for C.

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

$$$C$$$ is a hard counting problem man. It's not very easy, coming up with the observation is hard, and implementing the counting carefully is also hard. How did 5k people manage to solve it?

Didn't really like $$$B$$$ too. Took too long to get that $$$1, 2, 3, sum,...$$$ pattern.

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

Got humbled by C terribly :(

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

Is there a deterministic solution for E?

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

    What's the random solution. I've been thinking that since adaptive the grader can always defeat us

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

      Simply generate $$$m_0$$$, $$$m_1$$$ randomly will hopefully distinct $$$b$$$. $$$x$$$ may be relevant to $$$v$$$, but $$$m_0$$$, $$$m_1$$$ is not relevant to $$$v$$$ according to the description. Choose an $$$x$$$ with $$$15$$$ bits of $$$1$$$ and $$$15$$$ bits of $$$0$$$ will pass with a high probability, I think.

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

    I think you can prove its not possible: if you query 0..{a times}1..{b times}. WLOG (u can reorder bits) , and you get the same number back, then no matter what two numbers X and Y u give they could return {first a bits of X}{last b bits of Y toggled}.

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

    My E sol doesn't use any random element and passed, I might be missing some case though but don't see it for now.

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

    Depends on exactly what you mean by deterministic.

    Is there one where you can just hardcode in values? Yes, you just take the probabilistic solution and do your rng() calls outside the code and then hard code it in. However, this makes it so a strong adversary has probability 1 of hacking your code; they can just check what your values for m0/m1 are to make your m0 look like m1 (or vice versa) and trick you into assuming the wrong one. Luckily, hacks are disabled on E so nobody can be said strong adversary.

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

Problem A and B are like, if you're able to figure out the pattern, its cakewalk otherwise you keep staring at the screen for hours, no luck. I love mathematics.

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

C is a great problem :-)

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

I've submitted A twice (since I'm not sure that if the first submission is correct), if the first one is correct, will I get -50 for resubmitting?

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

Its so hard :(

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

A huge thank you to the contest authors and testers for putting together such a fun and well-crafted Codeforces round! It's easy to forget how much thought, debugging, balancing, and testing goes on behind the scenes to make these contests enjoyable for everyone. I had a great time solving the problems, and I really appreciate all the hard work that made it possible. Looking forward to the next one!

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

Thanks for the contest, it was my favorite div2 in a while! I feel a bit bad for using an alt, but I felt like it'd make me a lot happier than basically never having the motivation to do another contest again, and this contest was definitely evidence for that.

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

Can someone explain solution of c and d, I'm absolutely cooked

  • »
    »
    7 недель назад, скрыть # ^ |
     
    Проголосовать: нравится +1 Проголосовать: не нравится
    soln for C
  • »
    »
    7 недель назад, скрыть # ^ |
     
    Проголосовать: нравится +1 Проголосовать: не нравится

    the initial -1s allow us to fudge with the target sum. if we take even-many -1s, then our target sum among regular numbers is 0. Otherwise our target among regular numbers is -1.

    • selecting odd-many regular numbers results in sum > 0: b1 + (b3-b2) + (b5-b4) .... This doesn't work for us.

    To obtain sum=0 with even-many regular numbers: consecutive selected pairs (b1,b2), (b3,b4)... have nonpositive sums. Hence resulting total sum is <=0 and is equal to 0 Only if each consecutive pair has equal elements. Then num_ways to obtain total=0 using even-many regular numbers is easy counting problem.

    To obtain sum=-1 with even-many regular numbers: similar case. code is easier than explaining:


    int n; cin >> n; int negones = 0; vii grps; for (int i = 0; i < n; i++) { int x; cin >> x; if (x == -1) { negones++; } else if (grps.empty() || grps.back().first != x) { grps.push_back({x, 1}); } else { grps.back().second++; } } ll z = 1; // num_ways to select total = 0 among regular numbers ll no = 0; // num_ways to select total = -1 among regular numbers ll ans = 0; for (auto [x, f] : grps) { z *= modpow(2,f-1); z %= MOD; } for (int i = 1;i<grps.size();i++){ if (grps[i].first == grps[i-1].first + 1) {no += z; no %= MOD;} // odd number from each of the two groups. this nets the same as even_from_all_grps } if (negones == 0) ans = z; else{ ll even_neg = modpow(2,negones -1); ll odd_neg = even_neg; ans = (z * even_neg)%MOD + (no * odd_neg)%MOD; ans %= MOD; } cout << ans << endl; }
»
7 недель назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hi all! Did someone try D?If yes please drop some hint.

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

in C to avoid tricky combinatorics you can just do knapsack dp with a map and only store sums which are <eps away from 0 and <eps away from the current number, where eps is some small integer (i have 10 in my code)

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

B is classical and too hard for the position.

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

Somehow the queue is so good today

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

Crazy Contest , It just Fu#k me

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

I wrote the following code in E: 382296469

I have a few questions:

1) why does it work?

2) why does it stop working if K is increased (there are always two bad values ​​of v)?

3) how does the ``standard'' solution differ from mine?

Apparently, the probability of my solution getting an AC is many times lower than what the authors expected.

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

for problem E, x=1 directly gives 'ty' and also the parity of 'v'. Tbh I wasnt even thinking to come close to intended solution. Solving other problems seemed kinda boring compared to this. The setters must have felt |cinema|.

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

My solution is coinciding with one more contestant though I didn't share my code not i usw any platform to publicize my code also the contestant is unknown to me. This is a total coincidence of same solution.

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

I have been flagged for cheating on problem C. However, I did not cheat in any way. The message I received said my submission, 382266816 was found to be similar with cindu_1402/382277909, Kiruthika_10/382279819, Sarmi_18/382281148, Saha_.na/382282080, Boomi_07/382282494, bu_xiang_qu_ming/382285591, Dharsh_30/382288493, LioHein/382290058.

First of all, my submission only shares the same idea with LioHein's one, 382290058, while the others do exactly what is explained in the editorial (I overcomplicated things in my solution). Therefore, I believe that this excludes any accusation having to do with everyone but the last contestant listed above, LioHein.

Now, even though me and LioHein do basically the same thing, I must say that our codes are as different as two can be, while still doing conceptually the same thing (treat even and odd length cases separately, and when dealing with the odd length case, fix the values that are going to appear on odd number of times (besides -1), and we calculate the number of ways for each of these using some prefix and suffix precalculations). Not only do I precompute the powers of 2 while he uses fast exponentiation (i have fast exponentiation as a function in my code as a template but i do not use it), but he keeps an additional array with each unique value and its frequency and solves the problem on that array, which is smarter and easier than what I do (I just manually traverse each block of equal values each time I need to). I believe anyone could look at our 2 codes and say that nobody cheated. It was just a coincidence that we both did not see the easier solution explained in the editorial and came up with this.

Is there anything else I can do to prove my innocence? I actually did well in this contest and it would be a shame if I wouldn't receive rating for it (I will assume that if I get flagged for cheating the round doesn't count for me, I don't know for sure). Do you guys know anything else I can do, maybe I should contact someone else? I thought this would be the right place to write this message but maybe there is somewhere else better, idk.

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

    Oh, this is the first time I've been mentioned in a comment. I just found out that an article accusing me of cheating was sent to my email. Now I know what "skip" means. But I'm probably not from the same country as the blogger, and I watched the solution. For a classification discussion question, isn't it normal to have a fixed discussion mode and approach? Thank you again for the blogger's mention, which made me notice this strange email, even though I didn't perform very well in that competition.

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

Problem C was interesting good job bros

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

Hello. I recently received an automatic plagiarism warning for my submission to Problem 2246D. I would like to request a manual review of my solution, as I solved the problem independently during the contest and did not copy or share my code with anyone. After comparing my solution, I do not believe it has significant similarity with the submissions mentioned in the warning. If the system has produced a false positive, I would sincerely appreciate a manual verification of my submission. Thank you for your time and consideration.