zltzlt's blog

By zltzlt, history, 17 months ago, In English

Hi, Codeforces!

We are pleased to invite you to Teza Round 1 (Codeforces Round 1015, Div. 1 + Div. 2), which will be held on Apr/05/2025 17:35 (Moscow time)

The problems are authored and prepared by CharlieV and me. You will be given 8 problems, one of which is divided into two subtasks, and 3 hours to solve them. The round will be rated for everyone.

I would like to thank everyone who has helped prepare for this round:

The score distribution is $$$750 - 1000 - 1500 - 1750 - 2250 - 3000 - (2500 - 1750) - 3750$$$.

Good luck, have fun!

And now, a few words from today's sponsor!

Greetings, Codeforces Talents!

We are thrilled to invite you to Teza’s first Codeforces competition!

Participants will have a chance to win Teza sticker packs and T-shirts:

  • The top 25 ranked competitors.
  • 25 randomly selected from places 26-100.

As a systematic quantitative hedge fund, we know that exceptional talent drives success—so seeing this community come together is truly exciting.

Good luck to all participants! And for those not competing, thank you for stopping by—if you're passionate about technical and algorithmic challenges, solving Olympiad-style problems, and diving into data-driven research, we’d love to connect.

Check out our career opportunities here and explore where your skills can take you. To join our team, please fill out the form.

Enjoy the competition and happy coding!

UPD 1: Score distribution changed.

UPD 2: Editorial is released.

UPD 3: Congratulations to the winners!

  1. zhoukangyang (Congratulations on solving all problems!)
  2. Ormlis
  3. ecnerwala
  4. Benq
  5. maroonrk
  6. LJC00118
  7. Kevin114514
  8. tourist
  9. 0tesmem
  10. jiangly
  • Vote: I like it
  • +200
  • Vote: I do not like it

| Write comment?
»
17 months ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

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

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

Turtle is back :)

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

As a tester,I've tested three Div. 1+2 rounds in two months : )

Hope you enjoy the problems in this round!

»
17 months ago, hide # |
 
Vote: I like it -49 Vote: I do not like it

As a participant

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

As a tester, I want upvotes :)

Problems are interesting, and wish you all GL & HF!

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

As a tester, this is my first time becoming a tester. Wish u all GL & HF !!!!!

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

As a tester, the problems are challenging and, of course, Turtle is sooooooo orz.

Wish you all have fun with this contest!

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

I hope I get high rating and Teza sticker packs

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

Expecting increase

»
17 months ago, hide # |
 
Vote: I like it -16 Vote: I do not like it

chance to win stickers u say?

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

Contests with Turtle are always challenging! Let's go!

»
17 months ago, hide # |
 
Vote: I like it -13 Vote: I do not like it

yeah very excited about relocation to yerevan (no)

»
17 months ago, hide # |
 
Vote: I like it -20 Vote: I do not like it

is this means that G1 is easier than E?

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

As an EST tz participant I am excited to do my quarterly rated contest.

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

Hello zltzlt are there any penalty for wrong submissions?

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

GLHF Guys!

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

SpeedForces till D ?? This is what Score Distribution is implying..

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

I hope I reach pupil again

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

permutation forces

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

next_permutation(round.begin(), round.end());

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

No wonder CF's recent rating increase has been so difficult.

We are actually competing with Artificial Intelligence.

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

I loved this contest

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

Can't enjoy permutation rounds :(

while (1)
{
	next_permutation(round.begin(), round.end());
	for (int i : round)
	{
		cout << "I can't enjoy problem " << (char)('A' + i - 1) << endl;
	}
}
»
17 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Has there always been a penalty for wrong submission on test 1?

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

A missing permutation Round~

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

Fun Contest! Apparently i'm not ready to "blossum" into a Candidate Master at this time

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

How do you make D's checker?

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

    Check if, in the output, there's a set of at least m+1 0s that are all at least k+1 away from each other, then the same for 1s, 2s, etc. The first number that the condition doesn't hold for should be the answer.

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

permutationforces

»
17 months ago, hide # |
 
Vote: I like it -61 Vote: I do not like it

Tons of permutations and sequences. Are there any other topics besides just math? This contest is designed to give advantage to AI-based cheaters. Poorly done by authors and coordinators. Next time please at least try adding other topics to the contest.

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

    How does this contest give people using AI an advantage?

    • »
      »
      »
      17 months ago, hide # ^ |
       
      Vote: I like it -13 Vote: I do not like it

      I meant problems A to D, which do not involve any implementation. Less code, more simple observations. That's an ideal case for AI-based.

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

        salty clown lol

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

        real, just look at D so many people have similar solution 5 lines of code you cant even say they cheated or not

        • »
          »
          »
          »
          »
          17 months ago, hide # ^ |
           
          Vote: I like it -15 Vote: I do not like it

          Yes, that's basically one of the key examples. Few months ago there was a similar case with Div2 E problem, which required just a formula. This type of problems for high points opens up so many opportunities for cheaters, not only those who use AI actually.

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

          ya just a loop is sufficient to solve D

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

        Less code is not ideal for AI because main advantage of AI on simple tasks is writing code instantly with almost no mistakes, so more straightforward implementation -> greater advantage for AI.

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

    🤡 🤡 🤡

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

man I got 3 WA on C due to silly mistake and was D really that easy?

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

    what is the edge case of C I cant find that case

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

    D is easy to me, I tried to calculate f(a) (maybe the hardest part) then the rest is just printing out...

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

    i got 7 wa on C and wasn't able to clear it, can you please tell what did you do?

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

      I dont know about edge cases I only got wa because I was taking mid as (n+1)/2 even though I am using 0-indexed array

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

        i made the loop run till n for safety, but still not able to pass :(

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

          find out which test case is falling

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

            this is my submission https://codeforces.me/contest/2084/submission/314220160 can you please tell what is wrong? my logic is if a[i], b[i] pair exist, then there must exist j!=i such that a[j]=b[i] and b[j]=a[i] for every i and let count= number of i's such that a[i]=b[i], then count should be 0 for n even and 1 for n odd, else not possible. The rest update part i have written in the code. For updating, for every i, i am finding the index of x =b[i], in array a, and swapping it with n-i-1, its desired position. My submission link is in the message above. I tried to debug it and find out the flaw, but couldn't :( I would be thankful for the help/

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

              maybe u should try including last check funtion that checks again if everything is reversed after all operation and also for n==odd ,(try placing (a[i]==b[i]) pair into mid and do rest of the operation like me ) check my sol

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

PermutationForces.

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

Individually the problems were nice but as a whole problemset the $$$5$$$ permutation problems were annoying.

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

why does this give incorrect answer for D -> https://codeforces.me/contest/2084/submission/314116450

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

    test 9 2 3 your ans: 0 1 2 0 1 2 0 1 2 (mex = 3, correct)

    test 9 2 2 your ans: 0 1 0 1 0 1 2 3 2 (mex = 2, but you could answer with the array above and get 3)

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

    Check this case: 10 1 2 Your solution's output is 0 1 0 1 2 3 2 3 4 5, $$$f(a)=4$$$,

    one correct answer is 0 1 2 3 4 0 1 2 3 4, $$$f(a)=5$$$.

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

How to do D?

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

    Binary search on mex value, for the check fxn greedily create the answer array as $$$0, 1, 2. . x$$$ repeat this till the array size is upto $$$n$$$ where $$$x$$$ is the mid value that you pass in the BS. Check if this array works by segmenting it into $$$k$$$ sized subarrays and finding the mex.

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

Thanks for the contest! The problems were very interesting.

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

Individually the questions were good, but man 5 permutations qs in 1 contest is a lot

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

I find E, F, and G (at least G1) nice, thanks for the round! However I want to comment one thing about statements, as a message to Sugar_fan and other Cf coordinaters :(

Why do you use the wording "permutation of length $$$n$$$"? It is too informal, and the worst case was today's E where the footnote has an important information that it is a permutation of $$$(0, 1, \ldots, n-1)$$$ instead of $$$(1, 2, \ldots, n)$$$. This should no longer be a footnote. I would really like wordings "permutation of $$$(0, 1, \ldots, n-1)$$$" and "permutation of $$$(1, 2, \ldots, n)$$$" to be used.

Discussion at https://codeforces.me/blog/entry/116986 .

  • »
    »
    17 months ago, hide # ^ |
     
    Vote: I like it -26 Vote: I do not like it

    I don't think atleast for E mentioning about permutation is not required because if it is 1,2,..,n, answer is always 0

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

      The problem here is that two different definitions were used in the same contest! (A, C, and G used $$$(1, 2, ..., n)$$$.) It should be clear from the main part of the statement what the definition of "permutation" is, without having to work through the examples or read footnotes.

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

    Currently, in Polygon's rules, it is required to use "permutation of length $$$n$$$" and footnotes to define permutations. So basically it is a rule to do so, and we are not really able to change.

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

      Thanks for the information (I had only heard it was "default" or something). For me the "rule" just seems to spread a bad habit... I don't know who to contact, but I hope coordinators are aware of this and could take some consideration.

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

        Indeed, the footnotes should only be used for standard definitions, which in this case is 1..n. I'll update the rules to make them clearer.

        I don't know who to contact

        me.

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

I solved four problems with A, B, C and D. I think they are really interesting. But this round seems to have a higher proportion of constructional questions in the earlier part(not positive or negative but subjective).

Good round because I will become candidate master after this round(if I will not be hacked or fst).

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

    How to get permutation sequence in C? I got the fact to check if it exists, i.e if the grid has a reversed column corresponding to each column.

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

      You are right but don't forget to consider that if n is odd, a column won't have its reverse just like:

      1 2 3 5 4
      4 5 3 2 1
      

      So before your idea, you should check it if n is odd.

      If you can pass the following sample, I think you can pass this problem.

      Input:
      3
      5
      1 2 3 4 5
      5 4 3 2 1
      6
      1 2 3 3 4 5
      5 4 3 3 2 1
      7
      1 2 6 3 3 4 5
      5 6 2 3 3 4 1
      Output:
      0
      -1
      -1
      

      More detail about it is in my code(26-th line to 56-th line)

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

        Right, got the odd even part.

        Can you explain how you implemented the swapping sequence? The first loop is for setting the equal ones that is understood, for the rest the swaps should be {index of the current column, n — (index of the reverse column) + 1} but what is the idx variable doing there?

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

          The general idea of this part is to scan from $$$1$$$ to $$$n$$$ in sequence. If there is a matching $$$(b_i, a_i)$$$ for the current $$$(a_i, b_i)$$$, then the position where this $$$(a_i, b_i)$$$ "should" be is fixed, and I need to move it to its correct position; otherwise, we only need to record the current position of this $$$(a_i, b_i)$$$, so that when the current $$$(b_i, a_i)$$$ appears, we can operate as mentioned above. This is the general idea of my code.

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

        can you look at my code that cases are working actually and I cant find the corner case.my code EDIT:I found the mistake in my code

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

how to solve E?

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

If a single problem between E/F/G would have not been permutation based this would have been an amazing round. As it stands I enjoyed the problems but the theme was getting a bit repetitive :)

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

    There are 5 questions about permutation in this round. Notice that these kinds of questions make up half of the total number of questions (T_T)

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

Can someone tell me how E?

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

No graph problem appears in this round.

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

What is the point of restricting FFT solutions in E? (because of time constraints)

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

I appreciate the problems individually, but I'd like to urge the problemsetters (including the future ones) to diversify the problems' topics and their types. This one problemset consisted of a total of $$$5$$$ permutation problems and $$$2$$$ MEX problems in a row, and $$$4$$$ of the problems were constructive. There's nothing wrong with each problem by itself, but I'd prefer not seeing them altogether in a single contest.

Problem solving has a lot more of other topics than just these, and I'd like the contests to test if the contestants can handle a wide range of these topics, not just a very few of them. Not just this contest alone, but during the past $$$1.5$$$ years I could only feel that Codeforces' problems have been too biased to a few topics, some of them being XOR, MEX, and permutations.

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

    On another note, I feel problem A should have limited $$$n$$$ to odd numbers. It's easy enough to construct a permutation when $$$n$$$ is odd, but it's hard to prove that there is no solution for even $$$n$$$. It's obvious that the problem wants us to just guess it because otherwise the problem can't be an A problem, so this problem basically tests our ability to guess and not to construct the answer or prove the impossibility for even $$$n$$$.

»
17 months ago, hide # |
 
Vote: I like it -15 Vote: I do not like it

Not a good contest . As a D question , there should be something like greedy , dp , graph , etc.

also C was also an implementation part only . Plzz make the contest well balanced . (like include good topics).

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

In my opnion, ABCDFG were great. Maybe A required a little proof by ac, but I liked all 6 problems.

But C why? 0 ideas, heavy implementation, I have no idea why the problem exists. I just don't get it.

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

Though the topic of the round was biased to permutations, looking back, I was amazed there are so various approach to solve permutation problems.

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

Can I request for a rerun of my solution in E? My code that passed pretests got RE 10 however after resubmitting the same code it got accepted idk why

»
17 months ago, hide # |
 
Vote: I like it -37 Vote: I do not like it

GreedyForces, CheatersForces.

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

orz zhoukangyang, insane performance! Congrats on Rank 1!

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

PermutationButWeReplacedSomeWith0Forces

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

Huge unbalanced round. Problem E — G has estimated difficulty at least 2300 and A-D is at most 1500 (from clist.by). I get stuck at problem C, which completely ruined my contest.

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

It's very hard and i felt in E

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

Congratuation GOAT orzdevinwang.

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

Congratulations to the winners of the Teza sticker packs and T-shirts! You will be contacted via private message soon with instructions on how to claim your prize.

List place Contest Rank Name
1 2084 1 zhoukangyang
2 2084 2 Ormlis
3 2084 3 ecnerwala
4 2084 4 Benq
5 2084 5 maroonrk
6 2084 6 LJC00118
7 2084 7 Kevin114514
8 2084 8 tourist
9 2084 9 0tesmem
10 2084 10 jiangly
11 2084 11 maspy
12 2084 12 Otomachi_Una
13 2084 13 xuanxuan001
14 2084 14 Um_nik
15 2084 15 NetSpeed1
16 2084 16 cmk666
17 2084 17 peti1234
18 2084 18 Z-301
19 2084 19 dog_of_Nesraychan
20 2084 20 EnofTaiPeople
21 2084 21 allvik66
22 2084 22 taeyeon_ss
23 2084 23 Mapakaka
24 2084 23 Nachia
25 2084 25 yosupo
28 2084 28 tute7627
32 2084 32 penguinman
38 2084 38 QwertyPi
44 2084 44 Potassium
45 2084 45 YuukiS
47 2084 47 EasonTAO
48 2084 48 shiomusubi496
49 2084 49 Shui_Dream
56 2084 56 Fysty
59 2084 59 umbrella-leaf
64 2084 64 Petr
65 2084 65 ko_osaga
68 2084 68 afuafu
71 2084 71 Sana
72 2084 72 Little_Bunny
78 2084 78 xuyifei1
79 2084 79 Endagorion
80 2084 80 LeoPro
81 2084 81 TKT_YI
84 2084 84 hitonanode
85 2084 85 Golovanov399
88 2084 88 bashkort
89 2084 89 kotatsugame
98 2084 98 wind_cross
99 2084 99 cn449