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

Автор Igor_Parfenov, история, 2 года назад, перевод, По-русски

Привет!

В 08.12.2024 17:35 (Московское время) состоится Codeforces Round 992 (Div. 2).

Задачи написал и подготовил Igor_Parfenov.

Я хотел бы поблагодарить всех, кто сделал этот раунд возможным:

Этот раунд будет рейтинговым для участников с рейтингом менее 2100.

У вас будет 2 часа для решения 6 задач.

Разбалловка: 500 — 1000 — 1500 — 2000 — 2250 — 2750.

Удачи!

UPD: Разбор

UPD: Поздравления победителям!

Div.2:

  1. daniel6202

  2. younesg

  3. houseof

  4. HUST_USELESS

  5. FatihCihan

Div.1 + Div.2:

  1. jiangly

  2. maspy

  3. Rubikun

  4. BurnedChicken

  5. neal

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

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

Shortest description for a Codeforce Round I've ever seen. Good luck all :)

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

as a non-tester i love playing undertale

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

Hopefully, the problem statements will be short and precise just like the announcement!

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

Can you explain to me why does everyone care about score distribution? I don't get it. Does it correlate with the complexity of the problems? And if so, in what way?

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

I hope to become Expert after this round 0 ^ 0

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

My first unrated Div.2

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

good luck

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

Best of luck to all participants—let's enjoy solving and aim for new personal bests! ᓚᘏᗢ

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

everybody best of luck give your 100% with best wishes

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

I want a rating boost, so should i go with solving problemB first and then problem A?

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

xD

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

Expecting increase in rating

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

As a tester, I hope you get a lot of green in this contest.

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

it will be the rated contest number 100 for me <3

I hope to perform well in this contest ^_^

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

Hoping I could get to expert

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

Hopefully I wont choke on A this time :)

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

i feel so stupid failing c

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

patternforces

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

C is going straight to my suicide note.

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

Is F on Burnside's lemma?

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

can someone explain to me the idea behind b i feel too dumb tbh...

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

D is serious?

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

How to D?

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

C I gave up on observations and just generated $$$n=8$$$ permutations and found patterns

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

    that's the first thing to do for permutation problems

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

    Can you explain further? Did you do this on pen and paper (seems like a daunting task), and if you did this via code — did you calculate S(P) for all of them manually?

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

      Yes, I did this in code and calculated S(P). Python has many nice features that make this pretty straightforward and fast. You can use itertools to generate all the permutations easily and S(P) isn't too hard to code.

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

    what was the pattern I sill didn't get it?

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

    I started by thinking of maximising sum of intervals of each length. Realised you can't really get better than, say, for n = 5, for intervals of length 2 you can get at best 1 + 2 + 3 + 4. Then for length 3 you can get at best 1 + 2 + 3. And so on. And eventually realised that every piece besides the biggest one has to have as neighbors both a bigger and a smaller than it (considering the edges of the permutation to be 0). So essentially this is like going through the numbers in order and putting either smallest position still possible either biggest. So, like this, for example: n = 4

    0  0
    0 1    0
    0 1   2 0
    0 1   3 2 0
    0 1 4 3 2 0 (this last one will always be the same, whether you try putting it on the left or right)
    

    This can also be written then as either putting left or right. So for the given example it's L R R (you put 1 to the left, 2 and 3 to the right, 4 in what remains). And then finally when I started listing how all combinations of L and R would look I realised that this if you put the combinations in order, their results will literally be in the same order lexicographically, too (if you consider R bigger than L).

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

    Same. I lost track with pen and paper at $$$n = 5$$$ so I just coded up a brute force construction method and then it's pattern seeking from there.

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

mathforces

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

Today I learned that 2 is a prime number :(

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

C was too tough for pupil and specalist Guys.We cant even fight to solve C. Totally Disappointed

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

C is painful for me

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

No idea how to solve C :(

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

    Do a brute force to find the optimal value sum first and then see all the permutations that give the result for some small $$$n$$$ like $$$7$$$. Try to see the pattern.

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

I honestly dont get the point of questions like C.

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

    I liked C but it might have been harder or just as hard as D, which is not very cool. Also someone said they found it somewhere on codeforces, so, it shouldn't have been in the contest.

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

nvm

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

I brute forced and saw the pattern for C, but I couldn't figure out how to implement it for 90 mins, got really frustrated by the end of the round

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

help in d please

My thought process : choose 4 as diff and then choosing adjacent node

one will act as root and all nodes in it subtree will be 1 given 1 and increment of 4 , other with 2 and it increments

counter case : for star graphs case i can take other additions also like 1 and 7 for additional nodes,

can't implement it so need help

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

These ppl didnt mention the function in B was ceil, and not floor, and spend half an hour on that lmao, next time hopefully they write its ceil function

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

C was way too tough ig

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

I wasted so much time rabbit-holing in B... so I did D and then came back to B, spent another 20 minutes, and then finally saw the easy way to do it smh.

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

is there anyone found $$$D$$$ was easier than $$$C$$$ ?

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

why is d getting tle d

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

This was not competitive programming, this was competitive math

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

Yeah, it seems to be a very fair thing to not tell explicitly that you are using ceil function instead of floor and then don't even add testcases to make sure it doesn't happen. There's barely a difference between ceil and floor brackets and anyone can genuinely miss it.

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

guessforces + how on earth none of testers noticed about C

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

dear problem setter, please never make problem like C again, never.

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

make this unrated wtf

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

Am I the only person who really liked C? Only reason I found out it was hated was by looking in the comments

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

d is too hard for me :(

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

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

I'm sure for many, the D task was an attempt to just stuff something stupid without even trying to prove it. It's a pity that I only managed to do it after the end of the round. Specifically, C was too heavy for me.

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

I cheezed D with a randomised solution. Basically, I guessed that the ratio of number of "unblocked" values to total values is never much lower than 1/2

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

Who and for what reason decided to add -1 in Problem D?

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

[For problem C] I am trying to generate the permutation according to the bitwise representation of k. Could anyone please see what's the error?

#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main() {
    int t;
    cin>>t;
    while(t--) {
        int n, flag = 0;
        long long int k;
        cin>>n>>k;
        vector<int> a(n, 0);
        if((n<=60) && k>pow(2,n-1)) {
            cout<<"-1\n";
        }
        else {
            int L=0, R=n-1, shift=n-2, value =1;
            while(L<=R) {
                if(((k-1)>>shift)&1) {
                    a[R] = value;
                    ++value;
                    --shift;
                    --R;
                }
                else {
                    a[L] = value;
                    ++value;
                    --shift;
                    ++L;
                }
            }
            flag = 1;
        }
        if(flag) {
            for(int i=0;i<n;++i) {
                cout<<a[i]<<" ";
            }
            cout<<"\n";
        }

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

Problem C was exact copy of problem : https://codeforces.me/contest/513/problem/B2

This is extremely unfair to the people who tried this problem for the first time. This also explains why so many people were able to do this problem despite it being good enough that most of my expert friends couldnt do it.

My submission for contest problem : 295640125

Exact same code submission for older version : 295644907

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

    I totally agree with you. What are the testers doing? If it's a problem from another country's website then I can understand why they accidentally made the same problem. But another exact same problem from codeforces????? Insane. It is really unfair for ppl who didnt try this problem like me.

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

I found something interesting while reviewing the official common standing: three participants younesg (rank 2), Constantor (rank 7), and zxc3 (rank 15)—all failed to solve problem D. Upon examining their code, I noticed a significant similarity in problems C, E, and F. Although they paraphrased the code quite skillfully, it’s evident from problem E that there’s clear code plagiarism among them (295598220, 295609438 and 295632243). I hope MikeMirzayanov and Igor_Parfenov can address this case.

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

In E, how to derive the expression "2 * sizeof(vertex) — 1"? Though, i guessed, after this move, move parity will be odd, so, we can go back to the same vertex, using 2 moves and one substraction for parent.

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

    at any vertex you have two choices(if the step is even)- either go down to one of the child vertex or go to the parent vertex... the probability of going to a parent vertex is 1/degree while going to a child node is (degree-1)/degree. let E denote the expected number of steps to reach parent vertex then E= 1/degree + ((degree-1)/degree)*(1/degree)+(((degree-1)/degree)^2)*(1/degree)+........ . Solving this you get the required value of 2*degree-1.

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

did thet tutrioal of D's second idea is wrong,the"write the values n*2,n*2-1,…"should be "write the values n*2,n*2-2,…"

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

I encountered an incident where the code was found to be similar. Here are two submission records: https://codeforces.me/contest/2040/submission/295612672 https://codeforces.me/contest/2040/submission/295614629 BUT I'M NOT A CHEATER! Firstly, I assure you that I did not collude with him in the code, it just happened to be similar. Considering that this is a very typical problem and there are not many parts that need to be written, it is very likely that these two codes happen to be similar. So how to handle this matter?