|
|
Общий форумso in my solution i use o(N^3) space and i got mle ( i expected that) but what makes me confused that people says they passed wih o(n^3) time i know there is a different between memory and time complexity but i have some doubts they may also used o(n^3) space too so can someone tell me whether they added a new cases or whats is the problem? I assume that you are using an array dp[N][N][k] and that the first dimension of this array is the index that you are currently at, you don't actually need this dimension because the index which you are currently at only relies on the previous index's states, this means that you can reduce the first dimension from size N to size 2 O(n*m*k) solution is AC. Rating 731 is too big. Very simple geometry task Little bit boring, but anyway rating is too big In the measurements it is written that when 1 response 1 2 3. But in the condition said "If there are several solutions, display, where a minimum. If such multiple, display, where the minimum of b and so on". So the correct answer should be 1 1 2. (В промерах написано, что при 1 ответ 1 2 3. Но в условии сказано "Если решений несколько, вывести то, где a минимально. Если и таких несколько, вывести то, где минимально b и т.д". Поэтому правильный ответ должен быть 1 1 2.) Edited by author 09.11.2014 17:33 Have you read the statement? "Output Three ***different*** integers (a, b and c) such that..." Hahaha, Timus should have something like a "Like" button for comments like yours. ;) je suis ne pas tres attentif Edited by author 01.09.2024 03:42 In my solution, it was a bug with precision. So I fixed it, by using int instead of double, as much as it was possible sys.setrecursionlimit(10**9) + python instead of PyPy Test: 1 4 m m a a b b c c a Output: -1 How I can check the tests? Use BFS, use bitset, use binsearch, use random shuffle and get easy AC! The description of the problem says: "Your program must take into account the command \", which is used to write two dots above a vowel. For example, \"e means the symbol ë." But you don't really have to distinguish between vowels and consonants for this command. Edited by author 26.08.2024 17:37 You are amazingly attentive! I solved the problem on the first try simply because I didn't even think about this detail of the task) My program use iostream for reading data. Always when i use iostream i add this lines to turn off flushing after each line: signed main(void) { cin.tie(nullptr)->sync_with_stdio(false); cout.tie(nullptr)->sync_with_stdio(false); // solution return 0; } But in this problem program with this lines getting WA#1, without - AC. Why? I've got WA 5 cause I checked that distance less than d only in case where Gnusmas is not on the border of the arc. So, if you have WA#5 be careful with case where Gnusmas is on the border of the arc of fire. Один и тот же алгоритм и практически один и тот же код, с учётом схожести синтаксиса языков, даёт : AC 15 ms C++14 Clang TLE #9 Python 2.7/3.4 Ну да. Питон способен выполнять не более 10^7 операций в секунду, а С++ - более 10^9 операций в секунду. Можно попробовать отослать тот же код на PyPy или использовать по возможности библиотеки, написанные на как раз-таки С++ But O(N^2 * logN) is death for python Edited by author 23.08.2024 14:56 Edited by author 11.08.2025 18:30 |
|
|