| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Doubt regarding solution | ashwin | 1025. Демократия в опасности | 25 апр 2019 02:14 | 3 |
hello all, I am new to programming problems.. I have a doubt regarding the solution.. I got the answer accepted but i want to know how did this problem come under the category of sorting?? I tried thinking a lot but i could never even guess that we have to use sorting.. I only came to know after i saw the hints in this forum. SO please can anyone explain how did this problem come under sorting?? one way to solve this program is : you should sort the array in witch is written quantity of members in each group . Then you should run this array from the first to k div 2 and remember sum of ((each element div 2) +1) this will be minimal quantity of supporters of the party, that can put into effect any decision. Sorry for bed English if you couldn't understand write me and i'll try to explain ... Still i can't understand the problem. Can you explain again pls. |
| A bloom filter with this hash function can pass these test cases, please add more strict cases. | some_programming_novice | 1350. Столовая | 22 апр 2019 21:27 | 1 |
char buf[41]; unsigned hash() { unsigned h = 0; for (char* p = buf; *p; ++p) { h = h * 13 + *p; } return h & 511; } Edited by author 22.04.2019 21:30 |
| Suggestion for TLE 7 | Aneta | 1109. Конференция | 22 апр 2019 19:53 | 1 |
If you are using Edmonds-Karp, chnage it to regular Ford-Fulkerson (do DFS instead of BFS), because the running time in this case is better that way, as the maximum flow can be 1000 at most, so the complexity will be O(V*|f|) <= 2000*1.000.000 and this umber fits in 0.5 seconds. However, in case of E-K, the worst case running time is O(V^2*E) <= 1.000.000 * 1.000.000, which is the case of 1000-1000 complete graph and this exceeds the given 0.5 seconds. |
| Strange behavior | bsu.mmf.team | 1365. Тестирование вычислителя | 22 апр 2019 18:12 | 1 |
Test ;; +* ;+*; Sample module returns: Expression 1 evaluates to: 111 Expression 2 evaluates to: 1 Expression 3 evaluates to: 11 My AC program returns different result for 3rd string: 111 It's very weird that more complex expression returns smaller result, it fully contradicts the problem statement "It may be assumed that logic of expression evaluation does not depend on context. It means, that each subexpression is always evaluated in the same way with no dependency on it's entrance into the whole expression." Well, I guess my test can be incorrect though, but it doesn't follow from the problem description. Maybe, it should be updated a little to specify what kind of expressions is acceptable? |
| Python TLE is there a better algo? | thamizhkavingan | 1048. Сверхдлинные суммы | 21 апр 2019 10:55 | 1 |
well the problem is pretty simple and straight forward but when I try to solve this in python I tried out all algos like adding them that is N iteration then carrying them another N iteration. then print... or store them in a array then add from last digit that is also 2N iterations.... but is there any iteration which is less than 2N iteration including reading the values please help me!! |
| Difficulty above 400 ?? | basuki | 2115. День знаний | 20 апр 2019 19:38 | 2 |
This question doesn't deserve difficulty above even 100. It is a new task, so difficulty may be greater than it must be. |
| ambiguous statement | 🦄Imosk72🦄∭GTGU∭ | 2114. Моё ремесло | 19 апр 2019 18:26 | 2 |
sentenсe "for which x0 ≤ x, y0 ≤ y (as in the game the southeast wind blows)" looks like x0 <= x <= y and x0 <= y0 <=y but in fact it should be x0 <= x and y0 <= y Thank you for your comment. Problem statement was fixed. |
| If you have WA #110 | bsu.mmf.team | 2117. Полифемовы тройки | 19 апр 2019 03:28 | 1 |
Try C = 794569207093795778 Answer: 315152584 |
| why wrong answer(3)? c++ | Dima Puz | 1001. Обратный корень | 17 апр 2019 08:09 | 3 |
[code deleted] Edited by author 02.04.2019 21:28 Edited by author 02.04.2019 21:49 Edited by moderator 19.11.2019 23:34 Change while (!cin.eof()){ cin >> a; mass.push_back(a); } mass.erase(mass.end()-1); To while (cin >> a) { mass.push_back(a); } |
| This is too easy | gunfighter(ノ-_-)ノ彡┻━┻ | 1026. Вопросы и ответы | 16 апр 2019 23:50 | 1 |
Wonder why this task has a 147 complexity. Just sort and write |
| Thanks for the problem. I'm high) | Kirom `Ekexity [SESC17]💻 | 2114. Моё ремесло | 16 апр 2019 22:23 | 1 |
|
| Hints | Marius Zilenas | 1014. Произведение цифр | 16 апр 2019 19:57 | 4 |
Hints Marius Zilenas 16 окт 2013 15:03 Factorize (in 1..9 figures) the N and then reduce the resulting number of figures. Re: Hints Ealham Al Musabbir 9 июл 2015 16:05 Re: Hints abdur rahman shajib 11 окт 2018 13:39 For each i = 9 to 2, repeatedly divide n by i until it cannot be further divided or the list of numbers from 9 to 2 gets finished. Also, in the process of division push each digit i onto the stack which divides n completely. After the above process gets completed check whether n == 1 or not. If not, then print “-1”, else form the number k using the digits from the stack containing the digits in the same sequence as popped from the stack |
| Please Help to understand the question | anancodec | 2112. Полевые логи | 16 апр 2019 13:32 | 2 |
I didn't understand if a player is hit by another ,what will be the changed condition of him? max(0,cur-1) or max(0,cur-2)? if "HIT IN BODY" then max(0, cur - 1) if "HIT IN HEAD" then max(0, cur - 2) |
| WA 2 py 3.6 | DonCezario | 1131. Копирование | 16 апр 2019 01:33 | 1 |
n, k =map(int, input().split(' ')) z=0 time=0 num = 1 progress = 2 if k==1 and n==1: print(n) elif k ==1: print(n-1) elif k>=n: time+=1 while num<n: num+=progress progress*=2 time+=1 print(time) else: time+=1 while z==0: if progress<=k and num<n: num+=progress progress*=2 time+=1 else: z+=1 progress=k if num<n: while num<n: if num<n: time+=1 num+=progress print(time) Edited by author 16.04.2019 01:34 |
| Survive the flood | anancodec | | 15 апр 2019 18:50 | 1 |
In the problem "2113. Survive the flood" I did't understand the condition of when the rabbit can jump to a cell and also I mean what's a jump height? Edited by author 15.04.2019 18:51 |
| Что значит (технически) ограничение по памяти. | Konstantin | 1306. Медиана последовательности | 15 апр 2019 16:41 | 1 |
Здравствуйте. Это хорошо задача (для медианы не существует хорошего агрегата) требующая для точного решения хранения минимум N\2 чисел. И тем более эффективная по времени решения, чем больше чисел мы одновременно можем хранить. Поэтому хотелось бы точно знать что значит ограничение на 1MБ по памяти. |
| Umm, I just used the method which you will use when you face this problem as an elementary school maths exercise. | some_programming_novice | 1403. Курьер | 15 апр 2019 08:10 | 1 |
1. sort these orders for the following for loop; 2. can I serve current order? is there a not used day left for it? wow, that's easy if I can use std::set::upper_bound; 3. output our selected orders with delivery time. // wow accepted, so lucky I am. // after checked the discussion, found that this problem can be easily solve with priority queue, looks that priority queue is more convenient. |
| No subject | ilUha | | 14 апр 2019 22:56 | 1 |
Edited by author 14.04.2019 22:57 |
| About Test 2 | rodge(Vologda ML) | 1120. Сумма последовательных чисел | 14 апр 2019 11:04 | 4 |
If you have WA 2 look this test 6 ans 1 3 10 ans 1 4 my programm gave for 6 ans 0 4 for 10 0 5 after changes about a1 = 0 AC.So a1 Not equal 0 It must be added to the statement. It IS in the statement: "Your program is to output two POSITIVE integers A and P separated with a space..." |
| is there a polynomial solution to the problem ? | Konstantin | 1500. Разрешения на проезд | 12 апр 2019 19:01 | 1 |
|