Comments
|
+9
Actually, ‘+’ doesn’t mean only one submission. Submissions with WA on test 1 are not counted. |
|
+34
But I made too many iterations and got TL :) |
|
+5
You use nonexistent elements of array "c". The size of array "c" is "t", but "i" is running from 0 to "card". |
|
0
1. If you have problems with generators, you can download testlib here. It contains sample generators. Save your generator, for example, as "g.cpp", upload it in the source files and then write "g 5 > 3" to generate test number 3 using your generator with parameter 5.
2. In the "manage access" you can add users to give them "READ" or "WRITE" permission. |
|
0
Well, I've answered the trivial part of the question :) What can I say about inventing ideas for problems? In fact I have some experience in this. A problem usually consists of a legend and a formal statement. I can divide all problems into two classes depending on what of this two things was the first.
To invent a problem from a legend just look around yourself. For example, you see traffic on streets and you can invent a problem about buses, trams, traffic lights, etc. Usually such problems are organically connected with their legends. People sometimes find ideas for problems in their work. A small subtask may be removed from the context and then be developed to a problem for a contest. To start with a formal statement it's better to read something giving ideas: book and articles in computer science, math problems for school olympiads, problems of old contests. This way is useful when you need to prepare many problems for a contest and don't have enough ideas. If you don't know what to start with, read Cormen book. It contains many exercises which make you think on different abstract objects and their properties. Never take a problem you have found somewhere ''as is'', think on it creatively. Try to make it more complicated or just think about something that isn't required in the problem. This way has an additional difficulty, afterwards you have to invent a proper legend for the problem. |
|
0
Use polygon. As I know, problems for Codeforces contests are created here. It is a professional way to prepare problems with validators, test generators, checkers, etc.
|
|
0
Try to solve problems with tag "greedy" from Codeforces problemset. May be after a few problems you will feel the difference with the dynamic programming.
|
|
0
Probably the answer will contain too many digits. I'm not sure, I haven't investigated the situation carefully. Some participants wrote something about it in russian comments. In any case, the problem is much more difficult than it was supposed to be. |
|
0
See my solution 560061 for small n. It gives better answers than the jury's one. |
|
+14
We suppose that the jury's solution for B (Div. 1) is incorrect, and this problem doesn't have a correct solution for n ~ 1017. |
|
+32
Обычно раунды Codeforces делают нерейтинговыми при наличии более серьезных проблем. Если администрация все же решит поддержать это предложение, предлагаю это сделать в такой форме. Создать кнопочку: "Да, проблемы с задачей E сильно повлияли на мой результат, прошу сделать этот раунд нерейтинговым лично для меня". На большинство участников эти проблемы не повлияли, и по умолчанию для остальных раунд останется рейтинговым.
|
|
+15
a / rev(a) = rev(b) / b.
|
|
On natalia →
School Personal Contest #3 (Winter Computer School 2010/11) - Codeforces Beta Round #45 (ACM-ICPC Rules), 17 months ago
0
First number in the output must be the number of permutations. Then there must be a line which desribes a partition of the given sequence for several permutation. So the correct answer is
1 1 |
|
On natalia →
School Personal Contest #3 (Winter Computer School 2010/11) - Codeforces Beta Round #45 (ACM-ICPC Rules), 17 months ago
0
Test 4 for D is
1 1 |
|
On natalia →
School Personal Contest #3 (Winter Computer School 2010/11) - Codeforces Beta Round #45 (ACM-ICPC Rules), 17 months ago
0
On the test case 4 your program outputs just one number 1, white the correct answer contains two 1's. |
|
On natalia →
School Personal Contest #3 (Winter Computer School 2010/11) - Codeforces Beta Round #45 (ACM-ICPC Rules), 17 months ago
0
6 1 2 3 5 6 7 |
|
On natalia →
School Personal Contest #3 (Winter Computer School 2010/11) - Codeforces Beta Round #45 (ACM-ICPC Rules), 17 months ago
0
1 100 200 2 200 200 0 0 1 100 0 |
|
On natalia →
School Personal Contest #3 (Winter Computer School 2010/11) - Codeforces Beta Round #45 (ACM-ICPC Rules), 17 months ago
0
Use any correct solution to get it.
|
|
On natalia →
School Personal Contest #3 (Winter Computer School 2010/11) - Codeforces Beta Round #45 (ACM-ICPC Rules), 17 months ago
0
The solution you give for your test is correct. The description of your algorithm seems to be correct too, but you should be careful with cases when the answer is -1, i.e. no partition exist.
|
|
On natalia →
School Personal Contest #3 (Winter Computer School 2010/11) - Codeforces Beta Round #45 (ACM-ICPC Rules), 17 months ago
0
I have given test 25 to OgieKako in the comments upper.
|
|
On natalia →
School Personal Contest #3 (Winter Computer School 2010/11) - Codeforces Beta Round #45 (ACM-ICPC Rules), 17 months ago
0
1 2 |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
+5
3 3 -2 1 -5 4 -5 -4 -1 1 -1 |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
+5
4 2 4 2 1 4 3 a 1 1 1 b 2 1 2 c 3 0 d 4 0 a 2 1 2 b 1 1 1 c 4 0 d 3 0 |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
0
3 3 -2 1 -5 4 -5 -4 -1 1 -1 |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
+1
13 0 2 4 41 20 S XXL XXL L XXL M L M XXL M XXL L XXL XL M XL XL L L M |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
0
1000 12 16 100 1 16 1 52 1 55 2 3 2 2 2 1 1 97 1 53 1 29 2 9 1 2 1 91 2 8 2 12 1 35 1 92 1 62 2 15 2 11 2 7 1 14 2 16 1 93 1 67 1 97 1 33 1 98 1 23 1 60 1 66 1 8 1 87 2 32 1 62 1 45 2 25 2 23 1 29 2 29 2 38 1 34 1 71 1 24 2 31 1 21 1 77 1 67 2 26 1 6 2 30 2 24 2 46 1 77 2 28 1 13 2 21 2 35 1 6 1 100 1 10 1 56 1 37 2 62 1 52 1 70 1 95 1 14 2 64 1 91 1 68 1 72 2 41 1 76 1 29 1 86 2 43 1 82 2 45 2 60 2 65 1 58 1 44 2 27 1 1 1 57 1 70 1 87 1 16 1 1 1 58 1 85 1 58 1 22 1 13 1 81 1 57 2 58 1 22 2 93 1 41 |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
0
4 5 3 1 2 2 3 2 4 1 3 1 3 a 1 2 4 3 b 1 0 c 4 3 1 2 5 a 1 2 4 3 b 1 1 5 c 4 2 1 2 |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
0
Test 28 is a big random test with size 1000x2
|
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
0
50 3 1 30 1 9 2 1 1 6 1 5 1 8 1 1 2 6 1 7 2 3 2 8 1 7 2 4 2 5 2 11 1 2 2 15 1 6 1 3 2 17 1 9 1 3 2 18 1 3 2 23 2 21 1 8 1 2 2 27 1 8 2 29 |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
0
24 is a big random test
|
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
0
30 1 2 10 1 1 1 1 2 1 1 5 1 2 2 4 1 6 2 5 2 2 2 7 |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
0
Yes, there was a terrible bug in the checker. Now it is fixed, and solutions that passed after the end of the contest were rejudged. Solutions that got accepted during the contest won't be rejudged.
I apologize for that, and also for the bug in the first sample in the problem A. Thank you for that comment. |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
+3
3 3 3 1 2 2 3 3 1 a 1 1 1 b 2 1 3 c 3 1 2 b 1 1 2 c 2 1 3 a 3 1 1 |
|
On Nerevar →
School Individual Contest #2 (WCS 2010/11) - Codeforces Beta Round #43 (ACM-ICPC Rules), 17 months ago
+3
50 2 4 15 1 4 1 4 2 1 2 2 1 8 1 7 2 5 1 2 1 7 2 8 1 7 2 11 1 3 2 6 2 9 |
|
+3
"15 лет" just means "15 years"
|
|
0
Correct solution for this problem requires O(n log n) memory that is not too much. See accepted solutions of other participants (using ~ 50 M). If you are getting MLE, I can suppose that your solution probably use O(n^2) memory, or it goes to infinite recursion.
|
|
0
I also think that a feature of viewing all solutions for a problem in certain programming language would be very helpful. You can see only a fixed number of the best solutions, and I don't know, how to see others. Search in codeforces is also far from perfect (you only can click a tag and get all pages with this tag). It's better to use google if you want to find something there. |
|
0
You can analyze solutions for problem J of other participans that are in Java.
|
|
0
It depends on methods of reading and writing. The author's solution in C++ that reads strings by gets() and prints numbers by printf() works 360 ms. See about printing ints/chars by different methods here.
|
|
0
Big random test
|
|
0
Large test with many letters a
|
|
On natalia →
School Team Contest #2 (Winter Computer School 2010/2011): tutorial of A-E, H, J., 18 months ago
0
What is the number of your submission?
|
|
0
Sorry, that I write in russian, so many comments to answer...
|
|
0
Ваше решение выдает на тесте 15 1838236027.
|
|
0
Yes. Tell me the number of your submit.
|
|
0
17601120900014764776764048700928872725171605903217 ответ: 10428170619 |
|
0
9876543210 |
|
0
5 2 1 4 1 6 1 8 1 5 3 |
|
0
Test 12 is a big random test
|
|
0
You should just wait. Your question is to MikeMirzayanov, and he works on it. You may write him a private message.
|
|
0
Better let's solve this problem when the contest ends. Now you have many other problem to solve. If your team is a valid school team, I believe that everyting will be OK.
|
|
0
ok, try to register your team for the contest again
|
|
+1
It means Winter Computer School (russian abbreviation).
|
|
+4
It means that you should read input data from the input file and write output data to the output file. Names of the files will be in problem statements, I think
|
|
0
Let d[i][j] be the expected number of steps to reach the bottommost row from the cell (i, j). Calculate d[i][j] for rows N, N-1, ..., 1 in this order. To get d[i][j], j = 1, ..., m from d[i-1][j] you have to solve a linear system with tridiagonal matrix which can be solved in O(n) operations.
|
|
0
M[1] = 2 * A[0] - M[0],
M[2] = 2 * A[1] - 2 * A[0] + M[0], M[3] = 2 * A[2] - 2 * A[1] + 2 * A[0] - M[0], ... M[n] = 2 * A[n] - 2 * A[n - 1] + ... + 2 * A[0] - M[0] (т.к. по условию n нечетно), ... M[2 * n] = 2 * A[n] - 2 * A[n - 1] + ... + 2 * A[0] - M[n] = M[0]. |
|
+6
M[k + 1] = 2 * A[k % n] - M[k]. It is easy to check that M[2 * n] = M[0]. So you can calculate M[j % {2 *n)] instead of M[j]
|
|
+7
If there is a pair i, j such that a[i] >= a[j] and o[i] >= o[j], we should choose the i-th box and not to choose the j-th box, and then we can solve the problem for (N - 1). Otherwise sort the boxes and get a[1] < a[2] < ... < a[2*N-1] and o[1] > o[2] > ... > o[2*N-1]. Choose boxes 1, 3, 5, ..., 2*N - 1.
|
|
0
Try to the following algorithm (I haven't implemented it yet):
1) Let us have two lists on numbers: (a[0], a[1], ..., a[n-1]) and (b[0], b[1], ..., b[m-1]). Initially the first list contains the given numbers sorted in non-increasing order, the second one is empty. 2) While two last numbers in the first list are negative or zeros, do the following step. 3) Take two last numbers from a and put their product to the end of b. Note that numbers in b will be in non-increasing order too. 4) Each time you do that try to update the answer by the sum of M-1 smallest numbers from two lists + the product of the others. Use binary search to find the prefixes (a[0], ..., a[i-1]), (b[0], ..., b[j-1]) of the largest numbers in two sorted lists, that should be multiplied. 5) You have to use BigIntegers to implement ariphmetic operations. But they are necessary only for multiplication of some prefixes. So you can calculate partial products p[i] = a[0] * a[1] * ... * a[i-1] (and the same way for b) and add a new product with a new element of the list. |



