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

Автор smahdavi4, 7 лет назад, По-английски

Hi everybody!

On Saturday, August 12, 2017, at 14:35 UTC Codeforces Round #428 will be held. As usual, Div.1 participants can join out of competition.

The problems are prepared by me(Sadegh Mahdavi) and NikaraBika(Majid GarooC). Great thanks to Arpa(AmirReza PoorAkhavan) and Livace(Alexey Ilyukhov) for testing the round, KAN(Nikolay Kalinin) for helping us preparing the round and MikeMirzayanov(Mike Mirzayanov) for the Codeforces and Polygon systems.

There will be 5 problems and 2 hours to solve. The scoring will be published later.

The main characters of this round are chosen from the game of thrones series :D

UPD : The scoring is : 500 — 1000 — 1500 — 2000 — 2500

UPD: The judges solutions for problem B incorrectly handled some case, so we are going to rejudge some of the hacks. The pretests are not affected, so the contest is going to be rated.

UPD : The round is finished. Congratulations to winners:

Div 2:

1.mama_budra

2.fatego

3.regmsif

4.Lyra

5.Illyasviel

Div 1:

1.dotorya

2.kmjp

3.I_love_Tanya_Romanova

4.Benq

5.Claris

UPD Editorial

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

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

There aren't going to be spoilers in the statements right?

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

I guess problems will have lot of hacks. HBO, inspiration...

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

:D

I'll be very disappointed though, if nobody dies, or if there are no dragons/mad kings/queens causing explosions.

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

I think this is very fast announcement of the year (because it published ~60 hours before contest) thank you very much. Hope editorial is fast as announcement.

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

Why isn't the announcement on the homepage ?

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

tank you Arpa. anybody know how the pdf will be published????

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

So I've been off Codeforces for a couple of months and then I see this Game of Thrones themed round. I couldn't get a bigger motivation to come back. Thank you for this. :)

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

When one of your friend didnt watch the show.

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

Why can't GRRM use twitter?, he killed all 140 characters. I'm struggling to think of a suitable pun for why he can't write problem statements.

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

Спойлеры в студию!

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

OMG!!! This is going to be my favorite round perhaps ever! :)

I guess problems would be like; given seven kingdoms, three dragons (and their mother), one mad queen, a man who still knows nothing, how would you assign these kingdoms optimally?, haha I forgot the WHITEWALKERS!

Hope it will be as exciting and fun to watch as the show :)

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

I hope no one will die in problem statements like it's popular in Game of Thrones))

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

Problem statements be like : If Gendry started rowing in season 3 and Varys travelled from Dorne to Meereen in one episode, then where dafuq is Gendry?

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

I know nothing . But I am gonna participate .

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

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

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

Interesting round :)

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

Am I the only one in the world who hasn't watched this series yet??? :\

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

I won't be able to focus on the problems, I will be thinking what's going to happen instead.

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

Leave one Problem unsolved, and the programmers are never safe.

GOT_FAN

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

WoW GoT...excited for the problem statements.

"WHEN YOU PLAY THE GAME OF THRONES, YOU WIN OR YOU DIE."

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

Snapdragon has beaten tourist in GCJ World Finals. He's the new king of seven kingdoms.

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

i know nothing jonsnow;(

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

is it rated ?

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

--novice_dev-- you are not eligible for this contest

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

Game of Thrones + Codeforces = Game of tourist

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

I am new to programming and want to step into world of competitive programming. Is this a right platform for me to start competing ? What kind of questions will be there in this ?? SHould i participate in it ??

Please let me know! Thanks.

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

    It's really good. Codeforces is the only practice website I'm active on and there are lots of problems for you to solve for different skill levels. I recommend going to the problem set tab and clicking on solved to see the most solved problems and starting with those. You can see the types of questions they usually have by looking at previous contests, like this one.

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

I hope that I'll perform better than Lanisters' army in last battle.

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

Hope there will be Emilia Clarke's nude pictures in statements

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

Is there any PDF for translation statements to Persian ?

smahdavi4 NikaraBika

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

    Unfortunately, it isn't possible to publish the persian statements, we are sorry to persian users.

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

hacked solution like killed by white walkers, once you hacked and you find out the mistake so you can make others same by trying same hack. :D

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

I hope that this round will be successful. Good luck for everyone!

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

I Think I am the only one who haven't watched this movie.. !! :D

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

Scoring distribution

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

Registered users: Cro-Marmot, 172340, Cro-Marmot, 172340, 1040865060, ...

Hmm, that's suspicious...

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

About to start, Good luck everyone! I wish you all High rating!

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

Problem A says "Your task is to find the minimum number of days Arya needs to give Bran k candies before the end of the n-th day." But on querying, the problem actually is minimum number of days Arya has to take candies from the God to give k candies to Bran. The problem statement is wrong IMO.

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

Two unclear problem statements? Great contest. :D

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

This was one of the worst codeforces rounds ever.

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

    Saying this because you couldn't solve a tricky problem won't change anything

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

Pretests 7 in B and 5 in C;

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

    Solutions for problem B of even reds failed in pretest 7.

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

      I thought the same thing until I saw this "We call two seats neighbor, if they are in the same row and in seats {1, 2}, {3, 4}, {4, 5}, {5, 6} or {7, 8}" Did you notice this?

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

      Just used float instead of double and got AC -_-. What the hell happened in C?

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

    yeah i failed 5 c because i wasn't calculating the probability of choosing the path i was just printing sum(root->leafs) / number of leafs

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

    A bit more productive version: "But I will find you and I will solve you"

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

That pretest 7 in B killed me

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

I think the judge solution maybe wrong for B. I did a hack using following test case:

4 13

2 2 2 2 2 2 2 2 2 2 2 2 4

(4 rows, 12 groups with 2 soldiers each + 1 group with 4)

The judge solution gives "NO" for this case, but there is a solution:

[1][1] [5][5][.][13] [9][9]

[2][2] [6][6][.][13] [10][10]

[3][3] [7][7][.][13] [11][11]

[4][4] [8][8][.][13] [12][12]

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

Problem B _/_

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

Hack for B:

1 4 1 1 2 2

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

Hack Cases for A and B ?

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

Hacks for B?

I didn't hack anyone but this test broke my first pretests-passing submission:

4 10

2 2 2 3 3 3 3 3 3 3

Answer should be no I believe.

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

Ideas for E please, TIA.

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

I used greedy in B, take seats in the middle segment first. Hope it pass

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

For E , is it correct that optimal answer is always a Clique?

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

    We might have the same idea. Run under timelimit, hope that it converge. :)

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

    I was thinking in lagrange multipliers, what do you mean by clique? is a pentagon ABCDE with a triangle ACE a counterexample?

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

      for pentagon answer is while for triangle answer is so clique works better.

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

        I understand that bigger clique is better than smaller, but can you explain why clique is always the best ?

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

    Yes. Consider solution that distributes xi liquid to vertex vi. Suppose there is no edge between vi and vj. If we fix t = xi + xj and change xi, then answer is linear function of xi (because only summand that is could be not linear of xi is aij·xi·(t - xi) = aij·xi·xj, which is zero). So in one of optimal solutions either xi = 0, either xj = 0. Now fix any optimal solution with maximum numbers of zeroes. In this solution any vertices with non-zero numbers are connected. So, answer should be a clique.

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

    I proved it with following way:

    Lemma. There is an optimal way to give numbers to each vertex as this way: only some vertex v and it's neighbors can have positive values, and every other vertex has 0 value.

    Proof: Suppose that you have some optimal way to give values to vertices. For each vertex, calculate sum of values written in neighbor vertices. Find a vertex which has maximum value, and let this vertex v. Suppose we have vertex w != v, which is not a neighbor of v, and has positive value written. Then, we can just add value of w to v, and make value of w 0. This will make better result for problem. It means that all vertices except v and it's neighbors should have 0 value to have optimal solution.

    If we use above lemma, we can show that answer only depends on maximum clique by induction.

    Theorem: the answer for some graph that maximum clique is K is equal to answer for perfect graph with K vertices.

    Proof: 1) K = 1 -> Easy to show. 2) If above theorem holds for some K, it should hold for K+1 also.

    By lemma, we can take some vertex v and it's neighbors, and erase all other vertices from the graph. In this modified graph, suppose we can get rid of vertex v and think it later. (It's correct. We can find which value to write in vertex v, only depending on answer on graph without v) Then left graph should have just K-clique. So this graph is equal to perfect graph with K vertices by induction. By adding vertex v again, it becomes perfect graph with K+1 vertices.

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

In problem B, the answer for 3 10 2 2 2 2 2 2 2 2 2 3 should be YES, but judge outputs NO. Am I wrong thinking the answer is YES, or the judge is incorrect, and we will have to face another unrated contest?

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

Ideas for D?

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

Now that the contest is over, can anyone share how they passed test case 5 in problem C? :'(

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

    you need to calculate sum( probability of reaching the leaf * depth[leaf]), instead of sum( of paths to leafs) / number of paths

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

    I fixed it by calculating for each destination the probability to reach there * their length. For each node the probability to reach its children would be the probability to reach itself divided by the number of children (with node 1 being probability of 1). The expected length is then the sum over all of the destinations.

  • »
    »
    7 лет назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится
    Expectation(node){
       E = 0.0;
       d = 1.0/number_of_children
       for each v in node.children:
          E+= (d)*(1+Expectation(v));
       return E
    }
    
  • »
    »
    7 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    Getting to different ends in the tree have different probabilities.

    Consider the input

    5
    1 2
    1 3
    3 4
    3 5
    

    Getting to 2 have probability = 0.5 whereas getting to 4 and 5 have probability = 0.25 each

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

It's not a bad round but the language could have been better. Tbh who the fuck wrote the statements, There were typos everywhere and caused me to even misunderstood Problem A.

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

In Prob B 2 7 2 2 2 2 2 2 2 Should be "YES"

1 1 2 2 0 3 4 4 5 5 6 6 0 3 7 7

but STD output "NO" ????????

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

We need to find summation of 1.kC1 + 2*kC2 + 3*kC3 + .... k*kCk for D right ?

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

WA in A,B,C. solution for C: sum over depths of leaves/ number of leafs. Cant wait to see which mistakes I made.

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

    For begin I'm too did as you did. Then I solved so: when you went to vertex in DFS you should know probability visits to this vertex, children's probability such: (parent_probability)/(count_children). If vertex is leaf then ans += depth*probability_vertex.

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

    Sum of depths of leaves divided by the number of leafs is wrong. You have to take into account the probability of reaching every leaf (you have assumed the probability of each branch from the root node to be equal, which is not the case, as there is a branching factor at every node, not just the root). The line "In each such city, the horse goes with equal probabilities and it stops when there are no such cities" mentions this.

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

fuck u -> precision coz it fucked up my rating.

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

In problem B, why is this white line here? I thought the seats 4 and 5 are not neighbours... :/

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

How to solve C ? Also , any idea on what could be the 4th pretest ?

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

Problem B: add this test case in system tests please: 1 4 2 1 2 2

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

    Most times they add all successful hack cases to system tests.

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

    This is YES/NO problem, and there can be so many different test cases! I think it is not late to make sure, that system test contains at least 150 TCs.

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

    And anyways, probably 90% of solutions will fail on test cases, which the judge failed too during the contest, so there will be at most 100-200 solves I think.

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

    the answer is "YES".

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

The contest was quite nice (really liked the D). B was really annoying, tho as long as the problem is correct, I'd rather blame myself. All of this being said, the statement problem with problem C was extremely annoying and I've spend precious minutes trying to implement a root changing algorithm instead of writing the straight-forward one root solution. I almost ran out of time to write D because of this, so please, at least ignore the submissions before the announcement.

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

I hacked a person who submitted this code for A, my hack case was n=100, k=10000 and a_i=1 for all 1<=i<=100. His while loop should have continued pass i=100 and have very undefined behavior, yet somehow it gave the correct answer. How?

#include <bits/stdc++.h>
using namespace std;

int main() {
	//code
	int n,k,i,temp;
	cin >> n >> k;
	int arr[n];
	for (i=0;i<n;i++)
	cin >> arr[i];
	int num = k;
	i=0;
	temp = 0;
	while(num>0)
	{
	    num = num &mdash; min(8,arr[i]+temp);
	    temp = temp &mdash;  min(8,arr[i]+temp);
	    temp+= arr[i];
	    i++;
	}
	if (i>n)
	cout << -1;
	else
	cout << i;
	return 0;
}
»
7 лет назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

for problem C i rooted the tree then had a function solve (i, d, prob) , i is index of current node, d is its distance from the root (the root is node 1), prob is the probability of reaching node i, prob starts by 1 and on each recursive call for solve the node i passes to its child the third parameter as prob multiplied by number of children of node i, when we reach a leaf node we add to the answer the distance of the leaf node from the root divided by prob, but WA at test 10, any ideas ?

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

    Most probably overflow.Your prob parameter may reach upto 2^2500 if you analyse.The trick was to prune the tree after prob parameter is sufficiently large.

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

The statement of problem B never specifies that the seats {3,4,5,6} are neighbor. "We call two seats neighbor, if they are in the same row and in seats {1, 2}, {3, 4}, {4, 5}, {5, 6} or {7, 8}.". This round should be unrated......

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

B was really annoying. Although pretests was not affected,but hack was. After Unsuccessful hacking I spent a lot of time on it. It should be UNRATED

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

    I support your opinion. Time is invaluable in Codeforces Rounds. This contest should be UNRATED!

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

    If your solution was successfully hacked by incorrect hack, you could have also spent time on it, trying to find a bug in a correct solution.

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

    Also, I tried to hack with a correct hack, but I got unsuccessful. If I had succesful, I could have hacked more people with it, ending with more points.

    On the other hand, even with a failed B, I'll end up with positive delta in rating, so I'll be happy if the contest stays rated, but I also think it shouldn't.

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

    How you are affected by this issue as I see you never tried to hack any solution nor your solution got hacked

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

      I do. The hack ID is 341785. It was unsuccessful during the contest. And it was Ignored after the contest.

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

    You are right pantw:)

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

I think i should have a good sleep .

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

"The judges solutions for problem B incorrectly handled some case, so we are going to rejudge some of the hacks. The pretests are not affected, so the contest is going to be rated." AND WHAT ABOUT THE TIME WE WASTED IN FINDING THE BUG? CANT BELIEVE YOU GUYS

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

Why are the system tests taking so long?

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

I don't know if it is kinda template or not but this two codes are same:

http://codeforces.me/contest/839/submission/29409014

http://codeforces.me/contest/839/submission/29406327

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

    Their solutions to A also has a more or less line-by-line correspondence.

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

Oohoo, minimum number of days must be minimum number of index problem A, I think many contestant lost time on problem A !!!! LOL

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

Are there tests that cause a stack overflow in Java for C? Cause I resubmitted with iterative DFS just to make sure...

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

    Yeah my solution just crashed on the max case. Guess it's failing system tests.

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

Can you share some information about the hacks that helped to identify the bugs???

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

    10 3 2 2 2 2 2 2 2 2 2 3

    Answer is YES, judge outputs NO. I tried to hack with it, and got unsuccesful.

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

I cannot Understand the problem in my C problem code.... can anyone help? i simply did a DFS on the undirected graph and found the distances of leaves... take their mean. What am i doing Wrong for Pretest 5?

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

    5

    1 2

    1 3

    2 4

    2 5

    Remember, there is a different probability that the horse ends up at cities 4 and 5 than the probability that he ends up at 3.

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

Wikipedia reference was added to problem C statement without an announcement !

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

    In fact, there were lots of edits without announcement!

    As an example, at the start of the contest, I opened all problems, and my B problem said: "The second line contains n integers", I thought they should have been just k integers, so I refreshed and it suddenly said: "The second line contains k integers".

    Also I remember that happening one more time, but don't exactly remember where.

    EDIT: Now I remember, exactly in problem C, haha, it said: "What is the of their journey?", yes... unbelievable.

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

Another shitty contest, when you don't know whether to rate or unrate. All of that caused by trying to be too smart on B task...

I understand such initiatives on harder tasks, but why B? It is supposed to be a little more difficult than A. Why trying to make it so tricky?

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

How about using the pretest results for B and ignoring all hacking results? It seems like some red-rated contestants also made mistakes on B.

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

KAN what dafuq are you doing now?

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

    Maybe working together with the setters, and testers to figure out what will they do. They need time for that.

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

hack for B

2 8 1 1 2 2 2 2 2 2 "YES"

2 7 1 2 2 2 2 2 2 "YES"

2 8 1 2 2 2 2 2 2 2 "NO"

is it right?

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

    I think Claris got it right. You could actually use his solution to test.

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

      for case: 2 7 2 2 2 2 2 2 2 I got "YES" from his solution, but I think the answer will be "NO"…

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

        for the case : 2 7 2 2 2 2 2 2 2 I have tested some "Accepted" solutions, but I got "YES" from them. Something wrong for standard solution?

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

I used Hightail today for the first time. It worked nicely. Thanks to the maker(s).

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

finally the testing started

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

This contest must be unrated, I know someone can say that, I'm just thinking about myself, but I was thinking about problem B more than one hour, and why???sorry for poor English

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

    For me it is totally irrelevant will it be rated or not. But your reason for unrated is wrong, you were thinking about B and didn't solve it, so what ? It is solvable and it will have many accepted. Estimation is wrong, but not so tragic as it happened on some previous rounds.

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

      That isn't but this is.

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

        What time is wasted ? Pretests were correct, so good solution will pass it. If you missed hack, you can think what is wrong with your code, but why would you think about it when you do not have ability to change code ?

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

          I pointed to my comment not to it's parent. I could have had more successful hacks, if I used the test case more times, but as I saw unsuccessful I didn't try. I tried to find the mistake in my test case (I didn't waste my time, because like 5 minutes were left) and I couldn't, but I didn't hack more anyways.

          However as I pointed out here I don't have problems, just try to make everyone see every aspects of the issue.

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

    If round 421 ended unrated,I don't see why will this round be different.Please don't apply double standards KAN

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

      That problem was (probably) unsolvable, and no one solved the problem during the contest. This one is different, now the judge was incorrect, but many people got it AC on system test. I also think it would be more fair to make it unrated, but if they make it rated, it won't be double standards.

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

Even though the system test began, my hack still shows unsuccessful, when it should be successful.

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

There are around 50 people affected by the issue in problem B. We will calculate ratings for all participants now, and after that (most likely tomorrow) will make it unrated for those affected who has negative rating change.

I'm sorry for the issue.

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

 they ignored all my hacks, and what does it mean??

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

    it means all the users were correct on your given test case.. you should be grateful to the organiser as they did not give you negative points for this lol

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

      No just 2 or 3 of them were correct, other were incorrect, don't unswer if you don't know the unswer of question!!!

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

wow cool problemset (no)

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

wow! 1800 pretest passed for B and just 300 accepts !!!

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

I am worried with tests for the problem D. Is 29406336 supposed to pass?

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

Contest should be unrated as incorrectly handled some test-case for problem B. :|

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

When only 332 can solve a problem of category B in div 2 (including the div 1 players) and the author as well as the people related to this contest also make a mistake in writing the solution and testing, should the contest be considered even good?

Why shouldn't it be unrated? it looks harsh that we had a contest after a week and it turned out to be like this. But when a problem was being made, didn't it feel that this was being somewhat awkward? Problem C was easy (it was normal expected value problem) and problem B was really tough. even div 1 solvers would have had hard time solving it. so does it seem like a div2 contest? it would been better if it was div1 + div2. it would been fairer.

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

    A contest isn't rated when it's good, it is when it's fair. They handled the issue with the unfairness, so I see no reason to make it unrated.

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

Could smb explain me pretest 43 for problem B?

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

    11|22 3|44 55|66 3|77 The numbers mean the groups.

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

    11 22*3 44 55 66*3 77

    you can choose seat like something like up * is for empty seat

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

    7 Groups can be seated as follows: Group 1 at {1,2} at row 1 Group 2 at {5,6} at row 1 Group 3 at {7,8} at row 1 Group 4 at {1,2} at row 2 Group 5 at {5,6} at row 2 Group 6 at {7,8} at row 2 Group 7 Person 1 at {4} at row 1 Person 2 at {4} at row 2

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

If I understand correctly, my answer "NO" for problem B is correct, isn't it?

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

I downvoted this round. B problem was way too hard for standard B level.

I finally found clean solution for B after contest:

http://codeforces.me/contest/839/submission/29411599

P.S. It looks like CodeForces became harder. So you have to run in order to stay at the same place (run=amount of training, place=rating). And if you want to grow you have to run twice as fast. It's so demotivating!

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

    That's pretty biased, you can't say Codeforces became harder just because one hard contest, and even if you could everyone has had the same promblem set, so as long as you did better than the other people with lower rating than you, you will stay in the same rating.

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

      Then let's make all Div2 rounds where all problems starting from B will be as hard as Div1 E and A problem will be as trivial as possible. In this case, a few reds would be distinguished from each other based on number of solved problems (one solved 2, other 3 etc). Others will be rated only based how fast they could read the statement of trivial problem A and how fast they could type a text for trivial solution for A.

      Of course, that would be extreme case but I hope you've got the idea.

      I'm not enjoying write text for trivial solution for A problem as fast as possible as it will be the only way to distinguish yourself unless you are super strong.

      If problems don't have huge gap in difficulty, then most participants have more options than just compete in submitting trivial solution for A as fast as possible.

      P.S. I couldn't solve B problem for last few rounds in a row. That's never happen with me since 2015.

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

        I'm not gonna argue todays contest was harder than usual, that's definitely each person's perspective and it's hard to deny that B was definitely much harder than expected. But still, everyone has the same problemset and the difficulty of other problems weren't incredibly much harder. And most importantly rating isn't decided by one contest, everyone does better in some contests than others but as long as you keep practicing in participating your rating will hopefully rise independently of the problemset.

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

          Unless you are at the level to consistently solve C problem (which is quite high level), you compete with fast typing of solution for problem A.

          I.e. before you fill the huge gap between sometimes solving C and always solving C, you compete in fast typing solution for trivial problem A.

          As I said I couldn't solve B problem for last few rounds in a row. That's never happen with me since 2015! And I didn't make pause in my training. So CodeForces indeed became harder.

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

            The other people are learning faster than you and can solve B, or maybe they can finish faster than you while solving the same problems, then why wouldn't they rank higher than you?

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

              I don't think you understood what I tried to explain.

              So let's make all problems in all rounds as hard as Div1 E. Sure results of a few people could be distinguished from each other. Do you see problem in this model?

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

                But that's a logical fallacy, in reality you are always at least able to solve one problem, and people who are worse than you should solve the same or less problems. I know it's harsh to lose rating just because sone people typed the trivial problem faster, but if they solved the problem faster it is obl fair that it happens.

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

                  Look at AtCoder. They have much better difficulty distribution than CodeForces. In fact, you don't compete there by typing solution fast because the gap between difficulty isn't high, so that a lot of participants are distinguished by number of problems they solved.

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

                  All time I like codeforces because of unusual problemsets. If you want to solve easier problems there are many places. It is not easy to create interesting problems and keep their difficulty level. If one time problem B more harder than expected, other time it can be easier. Even my rating was fall, It was interesting problem. Thanks for contest.

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

                  That argument still is really bad, because if there are easier problems the same will happen, instead in atcoder you have to type 3 and not 1 trivila problem. And distinguishing participants by problems solved in itself is a bad measure because with 5 problems there is at most 25 different possibilities, definitely worse ranking system.

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

                  I think you don't get his argument at all. He is not talking about having 3 trivial problem, but instead have a gradual increase in difficulty. For instance, this codeforces round failed to do that as B was a little too difficult, in fact when I solve B, I thought that it wasn't suppose to be a B and should be like a C instead.(which is evident by looking at the number of AC of B and C)

                  distinguishing participants by problems solved in itself is a bad measure because with 5 problems there is at most 25 different possibilities

                  He is not asking to only distinguish participant by problem solved, he is just mentioning the problem that for those people with lower rating, most people will only have 1 problem solved (as the difficulty level increase too quickly), and this will make it into a contest where your standing depends more on your typing speed than actual problem solving skills.

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

                  Thank you! That's exactly what I'm trying to explain!

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

                  To be fair I did misrepresent the last argument and I'm sorry for that, but the initial rant was about this:

                  P.S. It looks like CodeForces became harder. So you have to run in order to stay at the same place (run=amount of training, place=rating). And if you want to grow you have to run twice as fast. It's so demotivating!

                  So while I agree that it can be true that the difficulty grows too fast, it is the same for everyone so as long as you learn at the same speed than the others your rating will eventually improve.

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

    And what your going to do, every one is trying his best, if you will not do this, you will newer be better.sorry for English

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

Test case #33 in problem B:

2 5

8 2 2 2 2

Why the answer is YES?

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

n = 1 can strike you hard sometimes :(

Problem C :(

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

Stop complaining about hardness of problem B. Nobody has guaranteed that problem B should be easier than C or D or whatever. The issue has affected only those who made an unsuccessful hack and these people can complain. But if you can't solve problem it doesn't mean that round was garbage and should be unrated.

And I want to thank authors for beautiful problem E.

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

What are the main topics/tags of problem D?

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

Can anyone help me solve the problem B?

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

In div2 B 1 4 2 2 2 2 Why te query answer is no ?

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

    The middle four seats are all connected.

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

      The problem statement doesn't have anything that says that !

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

        It says it pretty clearly and even gives a diagram. Honestly, I almost made the same mistake.

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

          he said "We call two seats neighbor, if they are in the same row and in seats {1, 2}, {3, 4}, {4, 5}, {5, 6} or {7, 8}."

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

            Exactly, so 3 is a neighbor of 4. 4 is a neighbor of 5. 5 is a neighbor of 6. Those 4 seats are all next to each other.

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

              so 2 is neighbor of 3 ?

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

                No 2 is not a neighbor of 3. I said the middle four seats are all next to each other. If one group takes seats 3 and 4 and another group takes 5 and 6, then seats 4 and 5 will violate the rule.

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

                  every row has 8 seats he didn't that the middle 4 are connected he said that the two seats are neighbors if they are in seats {1,2} , etc those pairs don't have {4,5} so 4 and 5 aren't neighbors .

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

                  They do have {4,5}. You even said it.

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

                  I didn't say anything :D

                  okay the contest has ended there is no reason for complaining about it thank you for trying to make me understand the problem though .

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

                  you know what I saw it now .

                  I think I was blind :D

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

Can anyone explain their problem B solution?

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

    We will keep three counters cnt4, cnt2, cnt1 storing the following information:

    Number of empty blocks of 4 seats (initialized to N); Number of empty blocks of 2 seats (initialized to 2 * N); Number of empty blocks of 1 seat (initialized to 0).

    At the start, we will greedily fill all the blocks of 4 we can. For each team t[i], the number of blocks of 4 we can fill up is min(cnt4, ). If we still have blocks of 4 remaining after we run through all teams, we note that we can break up a block of 4 into a block of 2 and a block of 1. So we do cnt2 += cnt4; cnt1 += cnt4; cnt4 = 0.

    After that, we will greedily fill all the blocks of 2 we can. For each team t[i], the number of blocks of 2 we can fill up is min(cnt2, ). If we still have blocks of 2 remaining after we run through all teams, we note that we can use a block of 2 as a block of 1. So we do cnt1 += cnt2; cnt2 = 0.

    After that, we just fill up all the remaining blocks of 1. For each team t[i], the number of blocks of 1 we can fill up is min(cnt1, t[i]). After we run through all teams, if at least one team still has at least one player remaining, the answer is NO; otherwise, the answer is YES.

    Implementation: http://codeforces.me/contest/839/submission/29414448

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

Can anyone tell why CF-Predictor predictions are wrong today?

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

so why didn't the author say that the 4 middle seats are connected ? anyone who read the statement will say that (1,2) , (3,4) , (5,6) , (7,8) are the pairs

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

WA in Problem B, test case 7 gives me nightmares...

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

I find a test case for problem B:

2 7

2 4 2 2 2 2 2

The answer is "NO", isn't it?

And some of the shortest solutions can be hacked by this test case...

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

      You are not rigth, answer is "No", look, at first we will give for 3 first groups place to first row -> 11_2222_33 <- and after this we need to give places to other 4 groups, but we can not do this because our test case become " 1 4 -> 2 2 2 2", we can give for the first and last groups seats in places {1,2} and {7,8}, but we have two more groups, we can not give them seats, because seats 4 and 5 are neer to each other, and what did we get, anwser is "NO", sorry for grammatical mistakes :D

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

        You are right, sorry for my mistake I confused this testcase with this one : 2 7 2 2 2 2 2 2 2

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

in problem D why the output of the second sample is 39 ? any explain please !

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

[ignore,fixed] Again 1727 :)

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

Hope it to be rejudged instead of unrated...(+149 last night)

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

[ignore, fixed]

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

Why unrated? Can someone tell me why?

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

Even after recalculation my hack still is unsuccessful, despite the fact it is correct. KAN could you please look into it? The hack's ID is 341839.

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

You copied my (and also E869120's) problem XD...
Actually Problem C is the easiest version of Problem D on square869120contest #4 in Atcoder.