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

Автор 300iq, 8 лет назад, По-русски

Всем привет!

Сейчас проходит зимняя смена ЛКШ (Летней Компьютерной Школы), и мы в составе параллели А+ с ее преподавателями подготовили полноценный Codeforces Round.

Раунд состоится в 05.01.2019 19:35 (Московское время) и продлится 2.5 часа. В каждом дивизионе будет предложено по 6 задач.

Задачи раунда были придуманы и подготовлены 300iq, scanhex, cookiedoth, VeryLonelyRaccoon, ----------, kkarnauk, forestryks, TheWayISteppedOutTheCar, LordVoldebug, romanovsavelij, golub, ismagilov.code,alexey_kuldoshin, LadyPython, Jatana под руководством преподавателей izban, VArtem, meshanya, pashka.

Также спасибо за тестирование раунда isaf27, peltorator, Kurpilyansky.

И, конечно же, спасибо MikeMirzayanov за великолепные системы Codeforces и Polygon.

Всем удачи!

UPD: так как регистрация открывается раньше пересчета рейтинга Hello 2019, в случае изменения дивизона, участники будут перекинуты в другой дивизион.

UPD: Разбор.

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

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

Я горжусб тобой сынок

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

I'd very much like to see rated rounds which are shorter than 2 hours, not longer.

For me, it's much easier to dedicate 1.5 consecutive hours to writing a contest than to have 2.5 or 3 hours available.

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

2 consecutive contests to start the year? bring me some of that

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

Cool! 300iq is now purple!

Edit: Not anymore :(

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

10 min delay :|

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

13 problem setters for 8 problems ...........

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

 Dear CF, is it very cold there?

Why are you freezing up?

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

The contest length is 2.5 hours in the blog but it shows 2 hours in the upcoming contests.

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

I think CODEFORCES hates me! Whatever comment(or reply) I make (I tried many kinds. Contributed, Made Memes, Helped people etc.), always get dozens of downvotes. I'm really sad about it. I don't want to contribute anymore! It's already -24 and going down.

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

Oh no, the magic has gone :( Now I can't play to the chameleon

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

очередной раунд от сине-фиолетовых ((

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

After a bad experience of acm icpc, finally I am going to start this year with a new way and this is the first contest for my new journey for this year..

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

the winter SIS (Summer Informatics School)

Hold up.

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

Well,some later to Chinese users :P.

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

Every JBer show me ur hands up

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

The registration page says the contest is two hours long--is it still intended to run for 2.5 hours?

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

Another contest with 300iq in problemsetters

Looking forward to good tasks

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

The time of the match is very unfriendly to Chinese players.

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

Oof.. Red and Orange problemsetters in disguise! XD

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

Seems like it’s going to be a good round

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

starts at 01:35 in South Korea... I'm willing to exchange tomorrows day time to a codeforce round XD

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

Score distribution?

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

Scoring Distribution?

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

lol what a contest :D

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

Wow!!! Problem F of div2 in not present in div1.
wonder!! why it is so??

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

Nice difficulty-balanced div2D and div2E/F

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

Is there a straight-forward solution for Div1B that's not a disgusting ton of mindless casework? That problem ruined the contest for me, so I hope there's something at least somewhat neat.

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

A was a little difficult to understand.

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

what is test 6 in Div2 D ?

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

Can someone give a hint for E Div2?

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

    Notice that either all the rows or all the columns must have only 2 letters each. Thus, iterate for all the possibilities.

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

      Why ? I get it, instincts, no one demonstrates it himself during the contest. But why is it so ?

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

        It is clear that no column/row has only 1 letter. Then, we need to show that if some row has 3 or 4 different letters, then all of the columns must have only 2 different letters (and the same switching rows and columns).

        Then, suppose that row i has 3 different symbols. As no two consecutive letters can be the same, we can guarantee that there is an index j such that si, j - 1, si, j and si, j + 1 are pairwise different. Also, as {si, j - 1,  si, j,  si + 1, j - 1, si + 1, j} = {si + 1, j - 1,  si + 1, j,  si + 2, j - 1, si + 2, j} (= {'A', 'C', 'G', 'T'}), it must happen that the letters in si, j - 1, si, j are the same as those in si + 2, j - 1, si + 2, j. Analogously, {si, j, si, j + 1} = {si + 2, j, si + 2, j + 1}. Since si, j - 1 ≠ si, j + 1, from our construction, in order to accomplish these two equalities si, j = si + 2, j, and thus, si, j - 1 = si + 2, j - 1 and si, j + 1 = si + 2, j + 1. You can continue this argument for the whole row, and discover that row i and row i + 2 are the same. Using induction, every row j such that i mod 2 = j mod 2 must be the same.

        But then, every column repeats characters every 2 steps, as we wanted to show.

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

The problems were very good! Fantastic! Thank you for great contest!!!

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

Can anyone share their approach to E? Also, for div 2 F, I think the solution would be dfs-based, at each step finding how many cookies can be eaten if Mitya ends the game at that point. Can someone confirm this?

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

Horrible, misleading problem statements!!

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

In problem Div1D, don't you have to dynamically keep the Huffman tree in order to answer the queries, or is there an easier approach?

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

went for overkill on DIV2D with hld and still WA

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

What a great contest!!

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

Was O(QlogQlog109) supposed to fail in D1D or only my implementation has a too big constant?

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

Why would Div1C be excluded and not being used for problem F of Div.2 version, instead there comes a new problem in place of this? :O

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

Most contests are imbalanced these days :'(

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

problem D was very nice :DD , how to solve Div2E ?

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

HELP,

what is pretest 4 for the ACTG problem?

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

what is test 14 in Div2 D ?

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

Very great contest for non Div-1 coders like me. I particularly liked the gradient of submissions and the Div2-D problem. Ideal contest to increase rating for a graph lover like me.

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

what is test 4 in div2 F?

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

Does anyone know what was pretest 16 for Div2D?

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

Isn't it a O(n) solution(Div2 B)? 48005949. If so, why did it pass a test n = 1e9?

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

is Div2 F binary search? I was trying to check whether it is possible to eat x cookies, but couldn't succeed.

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

That moment when you solve E 5 minutes before the end of the round but yiu cant submit it because you have the worst internet connection in the universe :( :( :(

I fucking hate my life :( :( :( Hope its not correct :( :( :(

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

The problem setter of Div1E should stop creating problems.

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

My screencast will be available here after it finishes processing: https://youtu.be/WR9rMvE-d9Y

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

C felt so empty :(

A how could initial height be 1 if we have two rocks.. and calling the second rock "second rock" doesn't that mean the first one is heigher but that wasn't mentioned.

sadly I'm not good in graphs to try D .

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

Is there a specific reason why integer overflow hacks didn't work on this contest? A person I tried to hack used int everywhere, but somehow his submission in C++11 managed to print 3000000000. Is the int limit bigger than 2^31-1? :O

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

i got the #victoryroyale on this contest

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

Let me ask. Is F just a HLD on a suffix tree with segment tree with operations like "do x[i]=x[i]+1 on the interval" and "get sum of x[i]*a[i] from the interval"? I think that I was close, I had tree and HLD already but the fact that we have to do queries in a middle of an edge defeated me and I run out of time.

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

cool picture in div2F

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

Is there anyone solve Problem C (div.2) with DP ?

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

How to solve Div2 F?

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

    We can solve this problem by using minimax + greedy and segmentation tree. Assume we are at some node u in the tree, then we have remaining time = T - 2 * sum_l, where sum_l is sum of l over all edges from root to current node u. Now we can use a segmentation tree to greedily eat as many cookies with our remaining time from min. time required per cookie to max. time required per cookie for cookies on path from root to u. This segment tree has a leaf for each possible value of ti (so 1...1000000), and stores per interval total cookies in the interval and total time required to eat all cookies in the interval. When we arrive at node u, we add x[u] cookies to all intervals t[u] lies in. When we backtrack from u, we remove the x[u] cookies. Vasya always cuts the edge that leads to the best result, but in the root Mitya can choose an edge before Vasya is allowed to cut. This solution is O(N log 1000000). Corresponding code: https://codeforces.me/contest/1099/submission/48030249 .

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

Just curious, why is div2 F not available in div1?

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

Was this round unrated?

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

My solution for the problem C was shown as "accepted" but then after the contest, they realised I had a wrong answer? Like.. How is that allowed!!?

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

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

    To give a serious answer:

    There are pretests for the contest, where you will be given a particular verdict (in your case, Accepted). Afterwards, the submissions are run on a more thorough set of test cases, where the real verdict is made.

    There are a few reasons for this – one is that it lightens the load on the servers to only run the submissions on <20 cases, as opposed to ~100. Another is that it allows for "hacking", where you can look at other people's submissions for a problem that were accepted on pretests but have a bug in them, and create a test case that exposes the bug. All the successful test cases created from hacking are added to the total test case suite that runs after the contest. This is pretty beneficial to problem setters, because it can be difficult to think about the wrong solutions that will be made, and the corner cases that must be created to expose the bugs in the wrong solutions. The hacking system essentially crowdsources the creation of thorough test cases, making a more accurate problem for everybody.

    Failing on system tests is, unfortunately, part of the game here. On the bright side, it could be worse: Some contests, like Topcoder and Facebook HackerCup don't run your code on any test cases until after the contest is over.

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

Новая ава 300iq как бы намекает...

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

Is it only me or somebody else also who was expecting a higher rating change? Rating Predictor is showing +162 but I got just +73 whereas my friends' ratings changed as per shown in rating predictor.

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

For me 2.5 hours are better !!

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

by the f**k, why it TL??? (help me please, I am just don`t understand what wrong???) https://codeforces.me/contest/1099/submission/48007197

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

    reeWorld We had a solution like yours. Ofcourse it gets to because real complexity of this solution is N^2logN. Look at test, it is a bambook of n/2 vertrexes and in deepest vertex of it there are n/2 vortexes connected with it. X and T are such as you should erase all elements when you can to these children, and when you return you put when again. So you do n^2 operations, and it multiplicates log because these are operations with multiset

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

For those who are afraid of precision errors.. Div2-B Solution

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

How to solve Div2 D???

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

    Hint: the best S[i] for some unknown node is the minimum S[j] of its children, or the same of its parent if it has no children. After figuring out the optimal S[i] for every node, you can restore the original A[i] for each node.

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

когда выйдет разбор?

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

как решить E DIV2? суди по всему очень длинная решение но буду очень признателен если объясните)

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

Editorial?

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

editorial?

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

I did'nt get the problem statement of div2-B, can anyone pls elaborate it.

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

Where is the editorial?

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

when editorial will come ??

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

Хочу выяснить причину незачета задач. Писал все сам никому не скидывал решения

include

using namespace std;

int main() { int wStone, hStone; cin >> wStone >> hStone; int w1, h1; cin >> w1 >> h1; int w2, h2; cin >> w2 >> h2; for(int i = hStone; i>-1; i--) { wStone += i; if(i == h1) wStone -= w1; else if(i == h2) wStone -= w2;

    if(wStone < 0) wStone = 0;
}
cout << wStone;
return 0;

}

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

damn man no editorial till now!!

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

As the editorial is not published till now can somebody tell how to solve div2E and div2F?

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

is it rated?

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

мэ нэ нраицца данный контекст

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

I love that contests are being held so often now :) I am learning a lot of things thanks to that , I have high hopes that it will keep going this way !!!!

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

is there a DP approach to solve C?

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

When is the editorial translation going to be here?

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

Is there some one know the link of this problem: given a string, and some query [l,r] find the maximum i such that s[l,i]==s[r-i,r]... I'm pretty sure it is in codeforces gym thanks

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

I have a sol to solve problem F:

first we can solve the lcp[i,l] l<=i<=r not consider the bound of r restriction.

then we can try the minus old and add new value of point i s[l,l+i]==s[r-i,r].

we can solve first question by sweepline the increasing order

of rank[l], and build 2D segment tree, it can be solved

by O(n*lg(n)^2)

then we consider to find point s[l,l+i]==s[r-i,i].

there is a problem in gym find the maximum i, if we

got maximum i, then we can got sec maximum j that

s[l,l+j]==s[r-j,r] so we can get it is a repetition of s[r-i,r-j-1]==s[r-j,r-j+i-j-1].....it is a arithmetic progression

we can find the next bound of this arithmetic progression by O(1) and this number of segment is not bigger than log(n) with small constant factor

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

What a great contest!!

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

Such shameless authors , nearly 25 people involved in the round and still no translation for the editorial. I think this affects not only the authors but also codeforces's reputation.

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

    We sincerely apologize for the delay with the English version of the editorial. It's now available (link).

    However, before writing offensive & demanding comments, please understand that yesterday was the last day of the camp, and all of us needed to travel really long way home. Quite obviously English is not a mother tongue for any of the high-school students who prepared the round, and it takes a lot of time to write something readable.

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

I AK IOI. I AK ACM World Final. I AK Universe OI. I hangbeat tourist. I'm txdy.

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

.