Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | Страница 11 | Anyone have test 3 ? | hailoc12 | 1005. Куча камней | 30 ноя 2016 21:58 | 1 | I don't know why I got TLE on test 3. I use bruteforce with Python. But in my PC, it runs so fast with n = 20 | WA9, I'm check all forum topic, all test success, but WA9. Please!!! | phfaster | 1005. Куча камней | 17 ноя 2016 19:04 | 1 | My tests (N, Array, Answer): [8, '6 7 9 13 18 24 31 50', 0], [5, '5 5 4 3 3', 0], [5, '3 3 4 5 5', 0], [1, '1', 1], [1, '2', 2], [6, '1 4 5 6 7 9', 0], [5, '5 8 13 27 14', 3], [5, '5 4 3 3 3', 0], [5, '11 10 8 7 6', 0], [6, '1 4 5 6 7 9', 0], [6, '9 7 6 5 4 1', 0], [7, '1 2 3 4 5 6 6', 1], [3, '1 1 5', 3], [6, '1 2 3 4 100 100', 0], [5, '5 8 13 14 15', 1], [5, '4 6 6 7 9', 0], [7, '36 25 12 10 8 7 1', 1], [6, '101 51 51 3 2 2', 0], [6, '1 4 5 6 7 9', 0], [4, '1 3 9 27', 14], [6, '6 6 5 4 3 2', 0], [20, '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20', 0] All tests = True. What I do wrong? Edited by author 17.11.2016 19:27 Edited by author 17.11.2016 20:03 | WA8 What is test | Mirjalol | 1005. Куча камней | 2 июл 2019 08:48 | 4 | try this: 8 6 7 9 13 18 24 31 50 expected: 0 8 6 7 9 13 18 24 31 50 My output : 4 expected: 0(How) 8 6 7 9 13 18 24 31 50 (18+6+24+31)-(50+7+13+9)=0 | No subject | Gulliput | 1005. Куча камней | 29 июн 2016 01:31 | 1 | Edited by author 01.07.2016 01:40 Edited by author 01.07.2016 01:40 | AC with N*logN | Sandu Petrasco | 1005. Куча камней | 23 июн 2016 14:20 | 1 | Use the generation of the subsets | Выдает ошибку "Runtime error 1" | Artem Alieinikov | 1005. Куча камней | 18 мар 2016 14:41 | 2 | Можете обьяснить пожалуйста что я делаю не так? Я ходил по обсуждению задачи пробывал тесты которые предлагают, результаты вроде бы как правильные. Может я неправильно организовал ввод/вывод данных? Работает как-то так. Считываю в 1 строку: 6 1 4 5 6 7 9 Очищаю консоль и вывожу Console.WriteLine ответ: 0 There are 2 (TWO) lines in the sample. First contains count of stones, second contains stones weights. Your test should look like: --- 6 1 4 5 6 7 9 --- By the way some languages (C scanf/C++ iostream/Java scanners) allow reading from input without checking how data items are placed on input lines. Here - http://acm.timus.ru/help.aspx?topic=csharp - input read in similar way via string[] input = Console.In.ReadToEnd().Split( new char[] {' ', '\t', '\n', '\r'}, StringSplitOptions.RemoveEmptyEntries); | To admins | Dmitriy | 1005. Куча камней | 16 мар 2016 09:57 | 1 | If you want to divide the heap into 2 parts - an expression (1≤n≥20) is not true! The number "n" can not be equal to one. | How many ways of solving this problem? | littleibex | 1005. Куча камней | 19 июл 2019 10:49 | 2 | After going through all the discussion topics, I found that this problem can be solved using different techniques. I have made a list of keywords, and I would like to know exactly how many different ways are there to solve this problem? 1) Brute force 2) Bit mask 3) Dynamic Programming 4) Backtracking 5) Balanced Partition 6) Partition problem 7) Greedy algorithm If you can solve the question with DP, you should avoid Brute Force. Although, I could not come up with a Greedy algorithm. I solved it using DP. | TEST 2 | Ken | 1005. Куча камней | 21 дек 2017 12:33 | 3 | input test 2 is: 1 1 Edited by author 06.02.2016 22:45 Thanks, mate! Serves me right for being too impatient and not considering the basic corner cases! :-) | Solution without brute force | Oleksii Kavka | 1005. Куча камней | 20 янв 2016 11:40 | 3 | How to solve it without of using brute force? It works, but, I've heard, there is better solution. | For those who have no idea, here is a tip | Jamil Siam | 1005. Куча камней | 20 ноя 2015 16:58 | 1 | use bitmask. i got ac at 0.093 | Can't resolve problem on ruby, Time Exceed Issue | Sergey Khvan | 1005. Куча камней | 18 ноя 2015 22:13 | 2 | Hello, I've implemented two solutions: DP and Brut Force on ruby, but still no luck to pass tests (#3, #4). Does someone have good solution on ruby for that problem? Is it my bad hands, or tests were changed and ruby cant process it fast. If you have accepted solution, please try to submit it again. Also, if you resolved it on ruby, please give some specific hints about solution. Thanks! I don't know much about Ruby but I've solved this problem on Python which I suppose has similar performance. It's very important to optimize algorithm very well in order to pass all tests on those script languages. Time your code and try not to exceed 1 sec. limit with 20 stones. Sorry, no hints about algorithm from me. | Who knows what is the test 7? | David Yin | 1005. Куча камней | 12 мар 2019 20:15 | 4 | Who knows what is the test 7? I failed at this test. [code deleted] Edited by moderator 29.01.2022 18:45 6 1 2 3 4 100 100 Will fail this program The solution is not correct | Just use brute force, it works. | gopher nice byte | 1005. Куча камней | 12 фев 2015 03:36 | 1 | | Partition problem | Someone Else | 1005. Куча камней | 24 дек 2014 01:45 | 1 | | Help Please, WA test 7 | Malarg | 1005. Куча камней | 1 дек 2014 01:58 | 2 | [code deleted] Edited by moderator 29.01.2022 19:09 Try this test case: 5 5 8 13 14 15 correct answer = 1 split = 5 8 14 | 13 15 sum = 27 | 28 | ошибка в тесте 8 | Denis | 1005. Куча камней | 23 мар 2023 19:59 | 3 | не могу найти ошибку,возможно ли узнать какие числа вбивает 8-й тест? Только это называется не "ошибка в 8-м тесте" (сам тест корректен), а "ошибка *в решении* НА 8-м тесте". Тест - просто случайный тест, направленный на убивание жадных решений. Эту задачу неверно решать жадным алгоритмом. тест не случайный, так как при разных алгоритмах ошибки всегда под одними и теми же номерами | Brute force it | Marius Zilenas | 1005. Куча камней | 16 окт 2013 10:32 | 1 | Solve it with brute force, afaik this problem is of NP class. | Wrong letter in problem statement | candide | 1005. Куча камней | 5 май 2013 19:26 | 1 | The problem says "You have a number of stones with known weights W1, …, Wn. " This is unclear because you can suppose there are more stones than the n weights (you can imagine two different stones having the same weight). And worst, in the output description, the author's problem uses letter n with two different cases (upper N for the number of stones and lower n for the numbers of weights), this gave me trouble and lets me think the problem was more complicated than it really is. Please, use the same case for the two letters and, better, be more explicit by starting the statement problem in this way : You have a number n of stones with known weights W1, …, Wn
Edited by author 05.05.2013 19:55 | DP with O(n*max(wi)) time and O(max(n, max(wi))) space | Серовиков Андрей | 1005. Куча камней | 30 апр 2013 02:58 | 1 | There is a DP solution for this version of knapsack problem with O(n*max(wi)) time and O(max(n, max(wi))) space. It's a beat tricky, but still not so difficult in implementation. Just use your brains wisely ;) But an easy one is a brute-force, where we need to search between 2^n sets of piles. P.S. To admins, how about adding a new problem "Stone Pile 2" with N<=1000, 1<=Wi<=10000 and with writing the exact piles to output :) |
|
|