Всем добрый день!
В связи с неожиданными изменениями в расписании Кубка я остаюсь без команды, так как Дима Матов (Nerevar) на выходные меня покидает. Поэтому было бы очень здорово объединиться с кем-нибудь еще, у кого в команде не хватает человека.
Моя цель — пройти на онсайт. Поэтому главное условие — преемственность нашей сборной с Saratov SU Retired либо с вашей командой (если у нее высокий результат в настоящий момент) и мое участие в онсайте, если пройдем. Еще крайне желательно, чтобы вы могли взять меня на все три этапа (6, 7 и 9 мая). Расписание есть на сайте www.opencup.ru.
Ваше географическое положение особой роли не играет. Надеюсь, в связи со сложными обстоятельствами разрешат участвовать дистанционно.
Если есть деловые предложения — пишите в личку, а вот троллить, наоборот, лучше где-нибудь в другом месте.
Удивительно, что все как-то подзабыли, что сегодня, 23 февраля, в России праздник — День защитника Отечества. Поздравляю с этим замечательным праздником представителей сильной половины человечества от лица другой половины, менее многочисленной на Codeforces. Дорогие мужчины, вы у нас самые умные, обаятельные, изобретательные и веселые. Счастья, здоровья, успехов, великих свершений, удачи на контестах и побед на всех фронтах!
The plates must touch the edge of the table, so their centers must lie on the circle with radius R - r (see the figure).
| 1 | 2 | 3 | 4 | |
| {1} | - | 1 | 1 | 1 |
| {1, 2} | 2 | 1 | 1 | 1 |
| {3, 1, 2} | 3 | 3 | 1 | 3 |
| {3, 1, 2, 4} | 3 | 3 | 1 | 3 |
.
by binary search (if the set was previously sorted). But there is more effective way of check in O(n). Note that if initially the points (xi, yi) were sorted, say, by x-coordinate in increasing order and in case of equal x by y, then the points of the form (2xc - xi, 2yc - yi) will be sorted in the reverse order. The order doesn't depend on the center (xc, yc). So we can check the points (2xc - xi, 2yc - yi) in the order of sorting moving a pointer in the sorted array (xi, yi).In conclusion, a couple of words about the difficulty order in the problemset must be said. Difficulty of a problem is subjective. Especially if we need to compare a problem with idea and nearly without implementation and implementation without idea. As a result, different participants form different preference lists (russian). I can't deny that the order chosen during preparation of the contest appeared to be inadequate with the number of solutions for the problems, and it surely can be not liked by someone personally. Nevertheless, I want to say a couple of words in its support. Namely, about principles we have used to choose it.
Hello everybody!
I hope you have finished New Year celebrations, or you are ready to make a small break to take part in the anniversary Codeforces Round #100. Round will have place January 4 at 15:00 (UTC). There will be a common contest for participants of the both divisions with the same set of 6 problems. The top 100 participants of the contest receive prize t-shirts.
Score distribution: 500-1000-1500-2000-2500-3000
Manthan прошел на Codeforces где-то в середине марта, побив очередной рекорд по количеству регистраций. Мне по счастливой случайности удалось занять на этом контесте 15-е (последнее призовое) место. Только о моем подарке стоимостью 1000 рупий (по словам Димы Матова, это 600 рублей, не проверяла) ничего не было слышно. Я уже была готова обидеться на организаторов и почти забыла про это соревнование, как вдруг мне приходит письмо. Цитирую только самое интересное.
- The Gift Voucher (GV) can be redeemed on orders placed at website www.naaptol.com/hot
- Only one order per GV No. (As printed overleaf) can be placed. No two GVs can be clubbed together for an order
- This GV is valid till 31st May 2011
- GV is not redeemable/ refundable for CASH and cannot be returned for a cash refund under any circumstances
- If this GV No. is non functional on account of any technical reason, your sole remedy and the sole liability of Naaptol shall be reissue/ replacement of the particular GV NO
- Naaptol is not responsible for the lost or stolen GV and no representation in this regard will be accepted in any form or nature
- This Voucher can be redeemed only by online payment mode. (No cash on Delivery orders will be accepted)
- Customer Care - 9223516148
Put β = α / 10. Then the given numbers are a1 = [β], a2 = [2β], a3 = [3β], ... an = [nβ], and you have to count [(n + 1)β] ([x] is the integral part). The given equalities are equivalent to the system of inequalities: an ≤ nβ < an + 1,
. Choose maximum among left-hand sides and minimum among right-hand sides and obtain an inequality in the form A ≤ n < B. Now compare integral parts of the numbers A / (n + 1) and B / (n + 1). If B is divisible by (n + 1), subtract 1 from the right-hand side, because of the strict inequality in the right-hand side.Problem D
Create vertors vi, and put positions of ones to the first vector v1, positions of 2s - to v2, positions of 3s to v3, etc. The vectors can be filled for one pass of the given sequence. The number of permutations is the number of ones, or the size of the first vector. Mentally put the first 1 to the first permutation, the second 1 to the second permutation, and so on. Now turn to 2. If the number of 2s is greater than the number of 1s, there is no solution. Otherwise put the first 2 to the first permutation, the second 2 to the second permutation, and so on. It is possible for some last permutations to remain without 2. Then do the same for 3s (there should be less 3s than 2s), and so on. Obtain the O(n) solution.
I tell two solutions. The first solution examines three possible cases separately. Build a graph which have pairs (h, t) as vertices, where h and t are dragon's current amounts of heads and tails. Edges are determined by possible Ivan's blows. Firstly, determine by bfs if it is possible to get from the start vertex to (0, 0) and the number of required steps in case if it is possible. Then check if the draw is possible, i.e. if the graph has cycles. Otherwise the graph is acyclic, and by dynamics on the acyclic graph you can find the longest path to a dragon-win position.
For each of n days you have to solve the so-called "continuous knapsack problem". The solution is greedy: sort the firms by prices of produced snow and take snow starting from small prices until you get the required volume. Solutions with sorting for each n work too long. The author's solution takes O(nm) time, and it is based on ideas of QuickSort. Choose a random element r in the segment. The same way as in QuickSort, reoreder the rest elements so that elements smaller than r preceed r, and elements greater than r follow r. Calculate the total volume of snow with prices less than r. If it is enough for us - solve the problem on the left subsegment, otherwise - buy all the left subsegment and go to the right subsegment recursively.
The given graph is connected and has one cycle. First solve the problem for a tree. Choose any vertex as a root, and for each subtree calculate the following characteristics by standard dynamics:
1) number of vertices in it;
The most difficult part is calculation of the summand 4. Go through the cycle by two pointers: one to the current vertex, another to the vertex that separetes vertices from that one has to go left or to go right to the current vertex. Moving the pointers one can obtain partial sums for the summand 4 in a total linear time.
Imagine that you have exactly m black-and-white tiles. Then you can solve the problem as follows. Go by cells from top to bottom, from left to right. First put a black tiles, then put c black-and-white tiles, then - b white tiles. As a result you get a border of black-and-white tiles that separates black from white. The black-and-white tiles can be rotated such a way that makes the tiling correct. For example, n = m = 4, a = b = 6, c = 4.
######## ######## #####/\# ####/..\ \##/.... .\/..... ........ ........
######## ######## #####/\# ####/..\ \##/.... .\/..... .../\../ ../##\/#
The solution of the problem always exists.
Good day!
I invite everyone to take part in the last contest of the series of WCS olympiads for school students which is one of the regular Codeforces rounds at the same time. The start of the contest is on the 12th of December, at 11:00 MSK.
The competition rules are ACM-ICPC rules, the duration of the contest is 3 hours.
Like the previous school individual olympiads, the contest will be rated for all participants (both for school students and others). Rating will be calculated according to the merged result table.
The authors of the problems are me and Dmitry Matov again. Thanks to Gerald Agapov and Artem Rakhov for their help in preparing the problems and to Maria Belova for translating the problem statements.
Good luck everyone!
UPD. The contest is over. The results are available. The winner of School Personal Contest is scottai1, the winner of Codeforces Beta Round is ilyakor. Congratulations to the winners!
The author's problem analysis is posted. Now problems G and H are added to the tutorial, too.
Thanks to everyone who participated in WCS series for school students, officially and unofficially!
,
,
,
, and so on, i.e. the roots of integers, that can be represented as a2 + b2. Generate a proper quantity of such numbers. Denote them
,
, ... In some cases we can take first n such numbers as lengths of sides, but in some cases we surely cannot. It depends on the parity. If the sum r1 + r2 + ... + rn is odd, it is impossible. Indeed, we canIf the numbers n, m and k do not exeed, say, 1000, the problem is solved by easy dynamics on the acyclic graph, standard for such games. Let d(n, m) = 1, if the position (n, m) is winning, and d(n, m) = 0, if the position (n, m) is losing. The value of d(n, m) is calculated using the following considerations. If there exists a move from the current position to a losing one, then the current position is winning, otherwise it is losing.
But conditions of the problem do not allow us to solve it by the standard dynamics. The solution is to implement the dynamics for small values of n and m and to find a pattern! For example, build the matrix of values d(n, m) for k = 2:







