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

Автор mesanu, история, 4 года назад, По-английски

Hello Codeforces!

SlavicG, flamestorm, MikeMirzayanov and I want to invite you to Codeforces Round 806 (Div. 4).

It starts on Jul/12/2022 17:35 (Moscow time).

The format of the event will be identical to Div. 3 rounds:

  • 5-8 tasks;
  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), then the round will be rated for you.

Many thanks to the testers: TimDee, Gheal, Max_Calincu, qwexd, _Vanilla_,sandry24, jampm, haochenkang, tibinyte2006, Etherite.

We suggest reading all of the problems and hope you will find them interesting!

Good Luck!

Update: Editorial

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

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

As a tester, I tested.

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

No more div4 please!

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

Thanks to System testing of last Div3 I will be giving this round :)

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

Offtopic:

It would be good if there was an option at contest standings,to check country-wise standings. Like,I will select a country,it will show the ranking of all people only from that exact country.What do you think?

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

As a noob, Div 4 is the only time i solve at least 5 problems

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

As the first tester in post, I strongly recommend this round to all participants, even high rated users can find harder problems interesting, and beginners will find all problems interesting and relevant =)

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

why there isn't div 5 :)

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

I wish you all good luck.

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

tested

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

Waiting for specialist to comment: Finally my first unrated round ;-;

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

Hope for some positive delta

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

Excited, I hope it won't have repeated problems like the last round.

Wish all the rated participants high rating!!!

Wish all the participants high ranks!!!

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

deleted

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

my code 163576300 was accepted and didn't show up "time limit exceed on test 19" while the contest was running. Then why this happened to me after the final testing?

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

As a tester, I recommend you to participate. The problems are really good!

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

hope to turn green

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

As a non-VIP tester, I non-VIP tested :(

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

Div.

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

As a tester, the problems were very interesting and educational. One of the best Div. 4 by far. Orz SlavicG.

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

I registered in this contest before the rating change of the last round i.e when I was under 1400. So, will this round be rated for me? Somebody, please confirm.

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

First unrated Div.4 for me, yay

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

as a pupil, i hope that this will be my last rated div. 4

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

Is there any dynamic-programming or greedy expected in div. 4?

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

Nice

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

Is there any interactive problem?

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

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants......

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

Thanks for creating div 4 contests

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

Finally my first unrated round lol

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

my first unrated contest !

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

Im hoping to reach pupil, good luck everyone!

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

As an OOC contestant, I OOC registered.

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

As a tester, I tested, and I have to tell u this contest is great!

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

My top 5 finish was ruined by having to wait 2 minutes to open the problems and submit A

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

My rating is 1455 and I'm still showing a contestant int this round. Please fix this

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

Hurrah! Mission A.K. accomplished!

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

Просто дизлайк раунду, больше мне сказать нечего.

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

My first rated round which i Aked.

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

Can't believe I'm that dumb, F was so simple. I hope someone hacks it.

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

I can see some contestants which did not have any rating and this is their first contest and they are ranked in top 10 or so. What happens to those contestants?

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

MikeMirzayanov, 3mara is telling you #unrated_plz_mike_im_sorry_ill_join_next_time.

So please make it unrated :)

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

Informing everyone in advance that G will be having a lot of hacks. My simple n^2 passed instead of prefix I used simple iteration and still passed lol.

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

Lot of people created new accounts just to take part in this round like meyi_will_win_NOI2023, wesaco... Here I mentioned just those in top 20. Do something about it, MikeMirzayanov.

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

Any hints for problem D?

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

    First we store all string in a map, then for each string $$$s_i$$$ with length $$$k$$$ there are at most $$$k-1$$$ way to concatenate it into 2 string, and if both string exist in the map the answer is yes

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

Please explain me how to solve problem E 1703E - Mirror Grid

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

    Each field is in one class together with the other fields that get rotated onto the position of it. For most fields that are 3 other fields. The center field of an odd n grid is allone.

    Each of these classes can be made same by 0,1 or 2 flips.

    So, we need to count the 1s in the 4 fields of each class. Thatfor we can iterate one quarter of the grid, and foreach such cell calc the position of the three other cells.

    But we need to be carefull here what is a "quarter". For me it worked fine to iterate the rows from 0 to (n+1)/2, and the col from 0 to n/2.

    That is, in an even size grid exactly a quarter, in an odd sized grid the rows up to including the center row, and the cols up to, but not including the center col. Also skip the center cell.

    Then the rotation is in zero based indexing: $$$(x'=y)$$$ and $$$y'=n-1-x$$$

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

Can anyone give hints for G?

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

What is the motivation behind the problem E?

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

Problem E totally hanged my brain.Otherwise I would become specialist today. Damn!

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

HOW TO DO F?

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

AK-ed the contest. D, E, F, and G are the only ones I remember. D was brute force with maps, E was implementation, F was seg tree, and G was a nice greedy (kind of).

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

why my code for problem G always give WA on test 4 ,my idea is use dp with bitmasks, thanks in advance.

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

I hate when tutorial is posted like two days after the contest.

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

Can someone Explain the TLE for G on my solution. 163933925 I did a recursive memoization dp like recursive knapsack.

UPD- it worked after adding if(factor>=35)return 0; condition

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

Please check my blog, I have some questions. https://mirror.codeforces.com/blog/entry/104782#comments

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

My rating is 1388, and my official ranking in this contest is 1720 (excluding rating>=1400), can I get like +30 rating change from this contest?

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

I just wonder how more people solved E than F,lol

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

In dp solution for G, why does it fail when I take max over last column (WA on test 4) and passes when I max over all states? shouldn't the max answer carry to the last column?

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

In G I guess there are several nice ways to solve it. I used following:

Observe that if i divi operations are used, then it is allways optimal to use them on the last i elements. That means, we can build a prefix sum of boxes opened with k-operation, and a postfix sum of boxes openend by divi operation.

Calculation of prefix sum is streigth forward, $$$sum[0..i]-(i*k)$$$

Calculation of postfix sum needs more code. First I thought I can simply calc the sum, and in every step divide by 2, but that does not work out.

So instead I did bit counting the set bits in the postfix, and in each step move the count of each bit one position down. So I can calculate the cost/worth of the postfix in each step by the remaining count of bits.

163908470

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

Shitty contest, end Div.4!

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

Fuck Div.4

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

Problem G Why does my solution fail test 4 https://ideone.com/FptY9R

ll n , k;
cin >> n >> k;
vector<ll> v(n + 1);
for (int i = 1 ; i <= n ; i++)
    cin >> v[i];
vector<vector<ll>> dp(n + 1, vector<ll> (45));

for (int i = 1 ; i <= n ; i++) {
    dp[i][0] = dp[i-1][0] - k + v[i];
    for (int j = 1 ; j < 40 ; j++) {
        dp[i][j] = max(dp[i-1][j] - k + (v[i] / (1ll << j)) , 
                       dp[i-1][j-1] + (v[i] / (1ll << j)));
    }
}

cout << *max_element(dp[n].begin(), dp[n].end()) << endl;
»
4 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Another fun div.4 contest! Problem D, E contains a little bit of thinking and problem G is really interesting! The observation that we use good keys at the first i chests is actually not so easy to find.

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

I tried several ways to solve F problem, but I couldn't do it. How should I think about this problem?

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

It seems D: has most hacks

»
4 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
If you use multiset in D and get FST or hacked by me
»
4 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

When will be the rating updated?

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

Nice but underrated contest.

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

The problems were great but I think the problem E Harder than all

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

I pariticipated in the contest, but it doesn't show up in my profile? My rating is below 1400, so it should have been rated for me? Can anybody explain or am I missing something?

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

Me checking every 5 minutes, if my rating is increased by 0 or rating has not updated till now

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

I really don't get cf's rating system. Mine was less than 1400 and I got downrated solving 3 of them. LOL

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

Why is my rating has decreased by 5 !

I solved 2 problems without any wrongs so what's wrong !?

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

is it just me or anyone else also noticed that we have received almost half positive rating which was shown on cf predictor

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

consequence for wrong submission ?

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

    10 minutes penalty

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

      No brother, i have submitted 3 times wrong and forth tkme i solved. And got -75.

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

        I believe you are mixing rating points with contest points. The -75 you are referring to is how much your rating changed after the contest. Rating changes are based on your overall performance/rank on the contests. Your performance/rank in contests with ICPC rules, such as this, are based first on how many problems you solved and then on how fast you solved them. An incorrect submission adds 10 minutes to how much time you took to solve a problem, what makes your performance worse, but doesn't quite directly influences your rating change like this. You could have had zero incorrect submissions and yet a negative rating change, because although you didn't get anything wrong you had a bad performance, or you could have had 100 incorrect submissions and yet a positive rating change, because you had a good performance.

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

Why my standing's different from the official standing table than the "friends standings" table?

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

I just wrote this to make number of comments 300 (-_-).

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

In Problem E, if you mirror the last testcase it looks like this:

11101
00101
11111
10100
10111