I glad to invite to take part in USACO contest is from Dec 13 to 16, remember this contest is IOI style. good luck

# | User | Rating |
---|---|---|

1 | Benq | 3539 |

2 | tourist | 3532 |

3 | wxhtxdy | 3425 |

4 | Radewoosh | 3316 |

5 | ecnerwala | 3297 |

6 | mnbvmar | 3280 |

7 | LHiC | 3276 |

8 | Um_nik | 3260 |

9 | yutaka1999 | 3190 |

10 | TLE | 3145 |

# | User | Contrib. |
---|---|---|

1 | Errichto | 192 |

2 | Radewoosh | 179 |

3 | tourist | 173 |

4 | Vovuh | 167 |

4 | PikMike | 167 |

4 | antontrygubO_o | 167 |

7 | rng_58 | 160 |

8 | majk | 157 |

9 | Um_nik | 153 |

9 | 300iq | 153 |

I glad to invite to take part in USACO contest is from Dec 13 to 16, remember this contest is IOI style. good luck

↑

↓

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Nov/18/2019 17:31:33 (h2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

in problem 3 in Bronze division I can't underestand , we must only count number of

of points that they will be trapped in cycle or any cycles ?pairFor example suppose we have 4 points that they form a rectangle and points on one diagonal have paired each other,then we must count this cycles ?

Don't discuss the problems here before the contest ends!

Good luck to all contestants.

It seems something is wrong with the USACO server right now.The website takes a long time to load,and my submission is shown as "Being Judged" instead of "sample case solved correctly".Anyone experiencing the same issue?

Yep. I suggest ending an email to the contest administrator bcdean@clemson.edu, with your code attached.

Well the site appears to be completely down now, so I'm wondering what's gonna happen.

I can't solve third question in Gold division. Who can say me solution of this question?

I submitted now, and it seems to be working. Well, no server is truly stable.

The contest has ended.

How to solve 2nd problem of Gold division?

Dynamic programming with segment tree.

Each node of segment tree should contains dynamic array d[2][2]. d[hasLeft][hasRight] means what is the answer to the problem on the corresponding segment if the left machine from the segment used (hasLeft), and the right machine from the segment used (hasRight).

Thanks, got it. What about the 3rd problem?

The third problem is about permutations. It's hard to explain easy, but I will make a try.

Consider your transformation as composition of two. The first one is multiplying the prefix of your permutation by the given permutation. The second one multiplying the prefix of your permutation my cyclic shift, so as to move the first number to the end of the prefix.

The next step is to understand how the process works. It's not hard to get that it is possible to get the current

k-th number from the card deck if you know the cycle of permutationp(that is composition of two described above) that contained the element |p|.I think with these two hints and with some thoughts you can get the whole solution.

Also notice that only the first

Mand lastMelements of the resulting permutation (of allNelements) are non-trivial:k>M+ 1-th element will bek- 1-th incremented by 1.I imagine the superposition of permutations (P and right-shift) as some boring cycles and one non-cycle — a machine that's moving along a tape (some of the numbers 1..M are inside it already, and M+1..N are yet to go inside), and when moving along the tape, it always just moves the tape by 1. You can see that it takes the next number of the tape and ejects the first one still inside, so it doesn't change the order of elements on the tape. It'd be cool to construct such a machine :D

I was lazy to implement segment trees, so I just did some sqrt-stuff.

Notice that the upper bound on

Nis 40000 = 200^{2}. So just split the array into sequences of 200 consecutive elements, do an initial DP (as Gerald describes) on each of them, and for every query, another DP on the one that changes. This allows you to count the DP answers (as in the bruteforce DP) for every 200th element, and compute the lastN%200 states by bruteforce.It's easy to see that the same idea works on merging the DP answers for any 2 intervals, so you can take it as a motivation for the solution using segment trees...

Nice, thanks. It is 50000*200 on the worst case as I understood. Is it ok? My solution for the first problem is O(K*logN+Q*K), which is nearly the same, and I thought it may timeout on large cases.

It doesn't have to pass all the tests, and I don't care if it even contains a bug and completely fails. USACO is not worth it for me to exert any effort in getting my solutions to pass certainly — I don't gain anything from it. I'm just trying out various approaches, and "how fast is an sqrt solution here?" is one of them.

Another one is making this training for no feedback. This is also training for the USA team for IOI, and I don't understand how anyone would deliberately try to decrease their chances of success at the competition by using completely different environment. IOI is a lot about strategy, and gaining some "guaranteed" points is a crucial part of it, especially if you're not aiming for all or nothing. Being able to code well without feedback may be good, but if you do have feedback, then being able to code equally well but with the additional benefit of feedback is even better...

3rd Problem, Silver Divison, help, please.

In third problem we just had to build such a graph that would show us the sequence in which the cards will leave the deck. So this is easy to predict if we mention that after the shuffle(we have a graph on input that shows us the shuffle for M cards) when we take each card off we just send each card one position left. Let us shuffle the cards the first time and then build the graphs. So, we have 2 graphs that we have to unite into one. One graph that is given on the input(let's call it "S") and the other one that sends each card one position left let's call it "Co". So our final graph("Fin") would look like Fin[i] = S[Co[i]]. The first card that will leave the deck is the card that stands on the first pos after the shuffle. The second one is such a "j" for which "Fin[j] = 1". The third one is a j for which "Fin[Fin[j]] = 1" i.e. the ith card to go out will be such a j for which distance to the first node is i-1. We have to find first M cards according to the Fin graph and the N-M cards are the ones that are left in an order from smallest to biggest because we do not do the shuffle and card off after there are <M cards.

So, we basically had to implement the shuffling and taking a card off processes and find the sequence in which the cards will go out.

This is my submission for this problem.

I hope it pass all tests and help you too.

Scores published, perfect one for me on bronze. Silver division \o/

Here