Автор MikeMirzayanov, 6 лет назад, По-русски

Добрый день!

В 14.12.2019 14:05 (Московское время) состоится Отборочный Раунд 4 олимпиады для школьников Технокубок 2020. Раунд будет длиться два часа. По его результатам лучшие участники (но не более 45% от общего числа участников раунда) будут приглашены на финальный этап в Москву. Для регистрации на раунд и участия перейдите по ссылке. Не забудьте заранее зарегистрироваться на раунд! Для опоздавших будет открыта дополнительная регистрация.

Зарегистрироваться на Отборочный Раунд 4 →
Соревнование открыто для всех в виде отдельных раундов для первого и второго дивизионов.
Для всех участников всех трех редакций этого соревнования будет пересчитан рейтинг.

Параллельно с Отборочным Раундом будут проведены открытые рейтинговые раунды для обоих дивизионов, в них могут принять участие все желающие.

Напомним, что согласно правилам раундов Codeforces во время соревнования ваши решения будут тестироваться только на претестах (предварительном и неполном наборе тестов), а системное тестирование состоится после окончания раунда. Обратите внимание, что претесты не покрывают все возможные случаи входных данных, поэтому тщательно тестируйте свои программы! После прохождения претестов у вас будет возможность заблокировать решение, тем самым получив привилегию искать ошибки и взламывать чужие решения, но отказавшись от возможности перепослать ваше решение при каких-либо обстоятельствах (например, даже если вы найдете ошибку или вас взломают). Со временем задачи падают в стоимости. После системного тестирования учитываются только полные решения. Подробнее про правила соревнований можно прочитать по ссылкам:

Регистрация на олимпиаду Технокубок еще открыта. Победителей и призеров олимпиады ждут значительные квоты при поступлении в престижные технические вузы России и ценные призы! Если вы — школьник 8-11 классов и пока не зарегистрировались на Технокубок, то самое время сделать это:

Зарегистрироваться на олимпиаду →
После регистрации на олимпиаду не забудьте зарегистрироваться на Отборочный Раунд!

В финал соревнования будут приглашены лучшие участники каждого из отборочных раундов (но не более 45% от общего числа участников раунда).

Этот раунд составили задачи моего авторства, задачи Михаила Endagorion Тихомирова и Владимира voidmax Романова! Огромная благодарность тестерам: Kostroma, never_giveup, Supermagzzz, AdvancerMan, Stepavly, unreal.eugene, cannor147 и geranazavr555!

Для тех, кто впервые на Codeforces: в таблице ниже вы можете найти примеры решений на всех поддерживаемых языках:

Группа языков Языки программирования / компиляторы Примеры
C GNU C, GNU C11 10903473, 17029870
C++ GNU C++, GNU C++11, GNU C++14, GNU C++17, MS C++, etc. 23794425, 5456501
C# Mono C#, MS C# 3195513, 3794163
D D 5482410, 2060057
Go Go 7114082, 21366098
Haskell Haskell 455333, 1668418
Java Java 8 25491359, 23678167
JavaScript V8 35963909, 35681818
Kotlin Kotlin 25779271, 25204556
OCaml OCaml 6157159, 1281252
Pascal Delphi, FPC, Pascal.NET 1275798, 1259434
Perl Perl 2519448, 1277556
PHP PHP 413942, 35875300
Python Python 2, Python 3, PyPy2, PyPy3 35883730 (Py2), 36179112 (Py3)
Ruby Ruby 1837970, 1289551
Rust Rust 25180002, 35652442
Scala Scala 35847980, 2456025

Удачи!

UPD: Разбалловка:

  • Технокубок: 500-1000-1500-1500-2000-2500-3250
  • D1: 500-1000-1250-2000-2250-3000
  • D2: 500-1000-1500-1500-2000-2500
  • Проголосовать: нравится
  • +169
  • Проголосовать: не нравится

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

Looking forward to A1, A2, B1, B2, C1, C2, C3

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

What is happeninggggggg!!!!!
3 rated contests in 24 hours :3 :3

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

There will be 3 Rated contests in 24 hours, it will be a happy weekend !!!!! Thanks to the writers of these contests. :)

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

Short notice for so many contests.

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

Tomorrow is a great day.. Make a contest..take 2 hours rest..Then again...Boom.. Feeling very much excited...

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

so many contest!!! I've been waiting a long time!!!

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

Flood of contests!

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

For those who may want to take part in both rounds.

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

Two div1 contests in the weekend! Great!

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

Will EvenImage able to reach at the top position today?

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

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

WTF there're so many contests in a row (in a column?)

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

Разбалловка будет?

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

I hope the problem statements are short and clear.

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

Scoring distribution?

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

Score distribution for the contest?

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

When Three contest starts at different time

There is still this issue.

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

:D

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

The output on A for div 2 is still wrong.

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

There is a very long queue :(

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

Queue is taking a long time

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

Why I can't submit, though I have registered? It says you have submitted exactly same code before, when I submit any code, though there is no submission in my submissions or standing. Why? I tried to submit by editing my code. It is same.

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

RIP queue

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

queueforces right now

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

Such a long queue. This round should be unrated.

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

Probably it should be good to close gym during online rounds.

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

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

How to solve B without building tree of biconnected components?

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

    DFS from $$$a$$$ without going past $$$b$$$, call the set of reached vertices $$$r_a$$$, and DFS from $$$b$$$ without going past $$$a$$$, call this set of reached vertices $$$r_b$$$. The answer should be $$$|r_a \setminus r_b|*|r_b \setminus r_a|$$$.

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

    It seems that the answer is $$$(\text{No. of vertex not reachable by 'a' without going through 'b'}) \cdot (\text{No. of vertex not reachable by 'b' without going through 'a'})$$$

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

      I'm so stupid. :(

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

      Yeah... After the contest I realized that it is correct:

      Define three subsets of the n-2 vertices except a and b:

      A={Ai} be the subset of the vertices which can only reach a without passing through a and b;

      B={Bi} be the subset of the vertices which can only reach b without passing through a and b;

      C={Ci} be the subset of the vertices which can reach both a and b without passing through a and b.

      It's obvious that these sets contains all the n-2 vertices and the three sets have none in common. (Since the graph is connected there shouldn't be a point that can't go to both a and b.)

      For each unordered pair (x,y) (x!=y):

      1)x and y both belong to A. Then there is a path x-...-y don't contain b.

      (Both x and y can reach a without passing through b)

      2)x and y both belong to B. Then there is a path x-...-y don't contain a.

      (Both x and y can reach b without passing through a)

      3)x belongs to C. Like 1) and 2), the path needn't contain both a and b.

      If y belongs to A or C the situation is similar to 1).

      If y belongs to B the situation is similar to 2).

      4)x belong to A and y belong to B. then x can't reach y without passing through a or b.

      Otherwise:

      If a is not on a valid path x to y, then x-...-y-...-b should not contain a (Since y belongs to B). Then according to the definition of B, x belongs to B.

      If b is not on a valid path x to y, then y-...-x-...-a should not contain b (Since x belongs to A). Then according to the definition of A, y belongs to A.

      Both two suppositions lead to conflictions.

      so the answer is |A|*|B|.

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

        Can you please explain it more.

        Explain with this example.

        I have graph with 11 nodes. Consider 10th node as a and 11th node as b.

        Now edges are:


        1-a 2-a 3-a a-4 a-5 a-6 4-b 5-b 6-b b-7 b-8 b-9

        According to your explanation:

        A = [1,2,3]

        B = [7,8,9]

        C = [4,5,6]

        So the answer must be |A|*|B| = 3*3 = 9.

        But my question is why we aren't considering the path 1-a-4-b-5 as valid?

        I know you have written last two lines regarding this but still I am not getting.

        Please help me out.

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

          For the solution 1-a-4-b-5...

          It doesn't prove that all the paths from 1 to 5 pass through a and b.

          Simply we can find another path 1-a-5 proving that the pair (1,5) is invalid.

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

            Ok so we need to find pairs x,y such that all paths from x to y must contain a and b. But in question it was written that find pairs x,y such that any path from x to y must contain a and b.

            Please clarify this.

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

              I wonder what is different between those two statements. :(

              Logically, "all the things are" equals to "any of the things is", I think.

              P.S. Maybe you understood the problem as "Find pairs x,y such that there exists a simple path from x to y that contains a and b"?

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

    Run two DFS from a and b individually ignoring b and a respectfully and save the visited nodes in two sets. Now, we have to delete the commonly visited nodes from the two sets. Then, the answer will be the multiplication of the size of these two sets.

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

    Find connected components of the graph without $$$a$$$ and $$$b$$$. Then for each component, determine whether it is adjacent to $$$a$$$, $$$b$$$, or both. The answer is the product of (sums of sizes of components adjacent to $$$a$$$ only) and (sums of sizes of components adjacent to $$$b$$$ only).

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

    My approach was bit different. I did it by doing dfs from a. Find the sum of size of subtree of b's children in dfs tree from which there is no back edge above b. Now, multiply it by (n — (Size of subtree of a's child which contains b) — 1).

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

    I made two dominator trees, using a and b as roots. The answer is: ((size of subtree b on first tree) -1) * ((size of subtree a on second tree) -1)

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

    Another way to find it:

    Run a dfs from A and as soon as you reach a vertex (and it's not visited), add it to cnt. If you reach B, add it to cnt but do not move forward. It's obvious that n — cnt is equal to the nodes that are not reachable by A if we disconnect B.

    Do the same from B and you'll find the nodes that are not reachable from B if we disconnect A. Now, if we get 1 node from cntA and 1 from cntB, we can see that the only way to connect them would be to pass through both A and B. Hence, it's a valid answer!

    So, if we multiply cntA and cntB, we get the answer! :)

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

    Can anyone tell me why my solution is wrong? 66888589

    My approach was as follows :-

    Remove all the edges from and to b, then count the number of nodes which can't be visited through dfs from a, since these nodes could be visited by adding the edges of b, this simply means that any path from a to these nodes passes through b. Count this number and let it be A.

    Do the same after swapping a and b. Let the new number be B.

    Then the answer should be A*B, this fails testcase 18 :(

    UPD :- Nevermind, I messed up ll and int, fuck my life

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

Too many query problem resulted in too long queue. :(

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

Any particular edge cases on Div1 C? Failed on pretest 48 :/

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

One of my best contests ever. Thank you Endagorion.

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

What is testcase 3 in Div2C

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

Can someone explain Div2 D?

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

In Div1C did the authors want an O(n sqrt(n)) solution to pass, or not?

If "yes", then why set TL to 1 second, isn't it right on the edge? Would the problem be spoiled by 2 or 3 second TL?

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

Is it just me or was this round overkilled? I tried hard stuff but in the end, if I had a screencast, it would look like this.

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

Tell me, no one (especially me) is gonna fail in system test.

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

THIS IS THE POWER OF CODEFORCES TO HOST MANY CONTESTS IN A ROW SALUTE CODEFORCES

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

The true way to solve Technocup Elimination A,B,C(sometimes D) problems:

int main()
{
	int t;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		Evolution();
	}
	return 0;
}

Maybe it will help someone next year...

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

Looks like the key to doing well in contests nowadays is having code snippets for everything.

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

Can anyone explain how to solve Div.2 D, please?

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

    Check the first and the last digit of each string. And you'll be able to classify them as [0~0], [0~1], [1~0], [1~1]. If the second and the third group are all empty, handle that case separately, otherwise regulate the size of the second and the third group properly.

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

Everyone is posting screenshot of list of contest to get UPVOTES .

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

what are the edge cases in Div 2C

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

.

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

I solved the idea for E quickly and was happy about it, but I kept getting wrong answer on test 3 :(

Isn't the solution: We check if both a and b are articulation points and then multiply the number of nodes on a's side(nodes that can be reached by a but not b) by the number of nodes on b's side?

UPD: Can anyone check what is the bug in my code? 66862954

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

when I saw A,B,C then --------->

But When I saw D&E,------------->

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

How to solve Div1D?

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

    We do subtree dp. For each vertex $$$v$$$ we calculate 3 dp values: when parent $$$p$$$ of $$$v$$$ is taken before we go through edge $$$(v, p)$$$, when $$$p$$$ is taken by edge $$$(v, p)$$$ and when $$$p$$$ is either taken after edge $$$(v, p)$$$ or never taken at all. To calculate it we go through edges incident to $$$v$$$ in sorted order and store intermediate dp for wether we have taken $$$v$$$ and $$$p$$$.

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

How to solve E?

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

    Run two DFS from a and b individually ignoring b and a respectfully and save the visited nodes in two sets. Now, we have to delete the commonly visited nodes from the two sets. Then, the answer will be the multiplication of the size of these two sets.

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

      Actually, we don't even need the sets. I did it in this way: my used[] has an integer type, and I exited DFS when I see a or b. Counted, how many vertices visited twice. Obviously, if used[V] == 2, then it has been visited by both APs. Then just subtracted this value from vA and vB, where vA — number of vertices, accessable from a, and vB — ... from b. The answer, as yours, multiplication of vA and vB.

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

Pretest 2 of Div2D ???

UPD : I think I found the case when both [0-0] and [1-1] type are present and I was handling this case seperately when abs( number of [0-1] — number of [1-0] ) will be even which was not required at all. After removing this part from the code, it passed perfectly.

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

How to solve Div1C? I figured that we can simulate the process for each rectangle height (at most sqrt(n)), but I couldn't do that in O(n).

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

    I also do the same, but consider only rectangles where height is smaller than or equal to width. Now consider that you don't need to simulate the process (except at the end). If you have a fixed height H, you know you can't take more than H samples from each number. So, with Fenwick tree, count the sum S of all numbers from which there are at most H samples. Then, count the number N of numbers which occur more than H times in the array. In the end, calculate S + H * N — this is the maximal amount of numbers you can get. You can then find the max. width you can have for height H.

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

Why the announcement for problem D in the contest was titled "Problem E" ??

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

Can someone show me pretest 3 for DIV2 C please?

I can't figure out why it failed for me.

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

Is there any successful hacks in this contest? Strong pretests!!

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

In problem D there is a problem in the constraints!

It's written "The sum of word lengths doesn't exceed $$$4*10^6$$$" but the length of a single word isn't mentioned, so we should consider that the maximum length could be $$$4*10^6$$$. I submitted D at minute 46 (with setting $$$2*10^5$$$ the size of the char array) but before the end of the contest I noticed this problem and I changed the size of the array to $$$4*10^6$$$ and resubmitted.

Now after the contest I resubmitted the code that has only $$$2*10^5$$$ array size and it passed! This is totally unfair. You either should consider my first submission or modify the tests for all of the contestants.

UPD: Please look in it, it would give me 150 ranks up! Endagorion voidmax

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

I almost missed it...Although I didn't get good results in it...

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

Two rated contest within 4 hours of difference

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

Not satisfied with the delay of submission verdict. Did a silly mistake and got WA on test 1 after 10 minutes.

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

For Div2 Problem C- "As simple as One and Two", an important test case is missing.

The test is repeated 'twone' and it will lead to TLE in some solutions.

Test generation in Python

print(10)
for _ in range(10): print('twone'*(3*(10**4)))

In my opinion, it should atleast be added to the testcases for those who try it in practice later so as to fully test correctness.

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

Е*аный рот этого казино, спасибо за 3 секунды

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

I BECAME THE PURPLE!!!!

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

For div1 E:

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

My Div1C code passed pretests (50+ tests). It failed the main tests (runtime error on test 33). I submitted same code again twice after contest. It passed both times! Why?! How?

Two consecutive ACs submitting same code after contest https://mirror.codeforces.com/contest/1276/submission/66875312 https://mirror.codeforces.com/contest/1276/submission/66875827

RE on main tests of in contest submission https://mirror.codeforces.com/contest/1276/submission/66867062

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

Why can't we see others submissions and tests past samples?

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

Does anybody know why this code for Div 2 E failed?

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

Can you, please, open test's verdicts

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

What was the idea for Div2 D?

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

Why submissions aren't visible?

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

Can someone explain why this solution is failing? 66858891

Edit: It fails in the case

1 t

But I still can't figure out why?

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

Please post the editorials

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

Can someone please explain or provide a small case why this IEP based solution for E is wrong — 1. Add total pairs

  1. We subtract those pairs which are in same component after removing a — because they can be reached without a.

  2. Same as 2 but after removing b.

  3. We add those pairs which are in same component after removing both a and b because they are subtracted twice.

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

Why are the solutions not visible?

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

Can anybody see why does this code(div2 E) failed?

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

Can someone please explain the approach for DIV2 D and also the corner cases?

Thanks.

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

ConstructiveAlgorithmsForces

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

Why cant we see testcases?

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

How to solve div2D and div2E?

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

    Div2 D

    Notice that the only important thing is the first and last character of the string so the possible values are (0,0), (0,1), (1,0) and (1,1)

    Notice that you can continue alternating the (0,1) and (1,0) they will continue forming a good sequence and you can add all the (0,0)'s in between any (0,0) and (0,1) and all the (1,1)'s in between any (0,1) and (1,0)

    With that said you just have to check if it's possible to alternate the (0,1)'s and (1,0)'s also reverse a few of them as possible and check that the reversed value is unique.

    My solution: Link

    This is the best I can explain my solution it's really difficult to explain it and I hope the code helps.

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

    2E: Delete every nodes that can reach both A and B without going through the other. Now the answer is (how many nodes that can reach A)*(how many nodes that can reach B).

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

When we can see the results of Technocup? How many people will be invited to the final?

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

Well...When will the solution be given?

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

still could not see others solutions?

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

In Div 2 F I'm getting WA on TC 37 and I'm not able to figure out why. Anyone else got WA on fixed it? It would be great anyone is able to give some corner test case.

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

editorial?

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

Please provide editorials

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

Nice contests for newbies.

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

In D2-E, why the answer of testcase 2 is 0, we can go from node 1 -> 2(a) -> 3(b) -> 4. So we have a pair and the answer should be 1?

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

Excuse me, when will the totorial be published :D

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