| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Very Useful Advice | SergeyGlazkov | 1049. Отважные воздухоплаватели | 1 мар 2018 20:46 | 1 |
Before sending your solution try this test on your pc and make sure that pc can calculate it faster than 10 hours :)) 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 1 |
| решение С# | Terekhin Grigory | 1787. Поворот на МЕГУ | 1 мар 2018 15:32 | 1 |
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace РџРѕРІРѕСЂРѕС‚ { class Program { static void Main(string[] args) { string[] mas = Console.ReadLine().Split(' '); int k = int.Parse(mas[0]); int n = int.Parse(mas[1]); int[] A = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(i => int.Parse(i)).ToArray(); int M = 0; for (int i = 0; i < n; i++) { M += A[i]; if (M - k >= 0) {M -= k;} else {M = 0;} } Console.WriteLine(M); } } } Надеюсь понятно всё. |
| The code on Python work correct whe same code on Ruby have wrong answer #3 | Valentin Gulyaev | 1785. Трудности локализации | 26 фев 2018 00:33 | 3 |
Have solved this task in Python many years ago. How test my code on Python and have Accept This code on Ruby have WA on test №3 Stay tuned and inform us as quick as possible. |
| WA#3 | Lakers | 1872. Просторный офис | 25 фев 2018 17:00 | 3 |
WA#3 Lakers 19 окт 2011 09:12 My program gets wa#3 test 3: 6 1 2 3 4 5 6 1 1 1 6 2 3 3 3 4 4 5 5 my program out: Perfect! 1 3 4 5 6 2 it's wrong? Edited by author 25.02.2018 18:18 |
| It's very easy to overcome TLE. | balandini | 1353. Миллиардная Функция Васи | 25 фев 2018 04:49 | 4 |
If you have program which gives right answer for the problem, but it's too slow and gets TLE, then you may just calculate answers for every possible input(there are only 81 possible variants of input, so you can calculate them all) and then create another program: put array of 81 possible answers in this program and them just read s from input and write in output corresponding answer from the array. I had made such program and it got AC. In this case what is the use solving this problem. Edited by author 25.02.2018 04:48 Edited by author 25.02.2018 04:49 Edited by author 25.02.2018 04:49 Edited by author 25.02.2018 04:49 In this case what is the use solving this problem. |
| If you got RE at test case 9 | Thomas0726 | 1061. Диспетчер буферов | 24 фев 2018 13:41 | 1 |
it may help: line = Console.ReadLine(); while (line.Length < N) { line += Console.ReadLine(); } |
| WA 19 | Lightless [Samara SAU] | 1963. Воздушный змей | 24 фев 2018 01:28 | 1 |
WA 19 Lightless [Samara SAU] 24 фев 2018 01:28 |
| Why I get a TLE #6 ? | Yang Tianyi | 1018. Двоичная яблоня | 23 фев 2018 06:47 | 4 |
Just like what I have said,I got a TLE and execution time is 1.029. Who can help me? Now I get an AC Just change "if(!y)" into "if(!y||!x)" |
| About TLE and Recursion | daftcoder [Yaroslavl SU] | 1018. Двоичная яблоня | 23 фев 2018 06:45 | 5 |
I got TL#6. After that just a little bit updated my solution: int max( int pos, int len ) { ..if ( ch[pos][len] ) ....return dp[pos][len]; --- ....ch[pos][len] = 1; ....dp[pos][len] = res; ....return res; --- } and got AC in 0.015s. Edited by author 23.03.2010 20:30 I get TLE in #6 too , can you explain in detail? Well, I checked my solution and it didn't seem that could exceed the time limit... Weird... I've got TLE #6 too. Can you explain in detail??I'm afraid i can't understand..... oh,now I get AC.Just a little mistakes. |
| WA at #1 ?? Try this data... | arena_zp | 1018. Двоичная яблоня | 23 фев 2018 06:14 | 6 |
6 4 1 2 20 2 5 100 2 3 20 6 3 70 4 1 10 by the way : before you use the dynamic programming on the tree structure, be sure you have build the tree correctly. That's why I got WA. Source Code is available at : ecnu_zp@yahoo.cn I guess this test is incorrect, because of statement: " any biparous branch splits up to exactly two new branches", but node 3 has only one branch. As I can see here is 2 possible trees. 1 and 3 can be root 6 \ 5 3 \ / 4 2 \ / 1 4 \ 5 1 \ / 6 2 \ / 3 Edited by author 20.12.2015 15:47 wrong test case, there will always be zero or two children of any node. |
| can anyone explain me how to do it??? | Kirill | 1878. Кубик Рубинчика | 21 фев 2018 15:08 | 1 |
explain me the way of doing it or give a solution Edited by author 21.02.2018 16:21 |
| Test case 2 | Wei Zhang | 2034. Корованы | 20 фев 2018 22:49 | 1 |
What is the second test case? |
| More test cases | azikar24 | 1210. Добрые духи | 20 фев 2018 00:09 | 1 |
Make sure your graph is more than 1296 and try these 3 2 1 2 0 1 5 0 * 3 1 8 2 3 0 1 -5 0 2 25 0 * 2 1 8 2 22 3 -15 0 2 19 3 -50 0 ans = -20 =========================== 4 2 1 2 0 1 5 0 * 4 1 8 2 3 0 1 -5 0 2 25 0 1 22 2 -3 0 * 3 1 8 2 22 3 -15 0 2 19 3 -50 0 4 -1 2 -5 0 * 4 1 -8 2 18 0 1 -5 0 2 -19 3 -22 0 1 12 0 ans= -39 ============================== 2 2 1 2 0 1 5 0 * 4 1 8 2 3 0 1 -5 0 2 25 0 1 22 2 -3 0 ans = -3 ========================== 4 2 1 2 0 1 5 0 * 4 1 81 2 23 0 1 56 0 2 25 0 1 22 2 -31 0 * 3 1 8 2 22 3 -15 0 2 19 3 -50 0 4 -1 2 -5 0 * 4 1 82 2 18 0 1 59 0 2 39 3 52 0 1 112 0 ans = -2 |
| solution hints | imaginary friend | 1303. Минимальное покрытие | 17 фев 2018 04:30 | 1 |
1) greedy works here, although it's not that much obvious how *correct* greedy should look like 2) 5th test case, that didn't pass for me: 12 -3 10 -2 8 -1 16 0 0 Edited by author 17.02.2018 04:30 |
| bugurt & advice | imaginary friend | 2098. Тем ниже Приоры | 15 фев 2018 03:30 | 1 |
the only idea/key take-away of this problem is to properly combine calculation of integer and floating point numbers Edited by author 15.02.2018 03:31 |
| Почему не принимать все же верно frePascal 2.6 | Dok32 | 1000. A+B Problem | 14 фев 2018 23:35 | 3 |
var a,b,c:real; begin read(a,b); writeln(a+b); end. Edited by author 14.02.2018 23:36 Edited by author 14.02.2018 23:36 |
| WA6 | Lightless [Samara SAU] | 2089. Опытный тренер | 14 фев 2018 01:02 | 1 |
WA6 Lightless [Samara SAU] 14 фев 2018 01:02 Try this: 2 2 1 2 1 2 Ans: Yes 1 2 |
| How to fix WA 2 | Aditya Paliwal | 2093. Все дороги ведут в сугроб | 13 фев 2018 21:09 | 1 |
It is okay to use an edge if the next cleaning for this edge begins at the exact moment when you have crossed the edge. In other words a road is cleaned during the open interval (s_i, f_i). |
| No subject | IT | 1617. Ползуны | 13 фев 2018 16:03 | 2 |
Edited by author 12.03.2016 20:21 n = int(input()) a = [] summ = 0 for i in range(n): a.append(int(input())) b = list(set(a)) for i in range(len(b)): c=a.count(b[i]) if c > 3: summ+=c//4 print(summ) |
| eps | Anatoliy V Tomilov | 1369. Тараканьи бега | 13 фев 2018 15:32 | 4 |
eps Anatoliy V Tomilov 24 янв 2018 02:03 Epsilon to compare squared distances must be exactly 1.0 / (1 << 24) (at least for M*N algo). Even 23 and 25 leads to WA. Re: eps Anatoliy V Tomilov 5 фев 2018 17:11 (std::numeric_limits< float >::epsilon() / 2) is absolute accuracy needed overall. You can invent twofold float-then-double algorithm to sieve bad points beforehand. For single precision algorithm part you have to use 20.1f (20 + small constant) "epsilon" to compare squared distances in case if you use <= or >= operator (say, vcmpge_oqps or vcmple_oqps instructions) and 28.2f (28 + small constant) in case of strict inequality. Surely you can invent adaptive algorithm to infer relative accuracy needed in particular test case, which takes into account max abs differences of input point coordinates. epsilon should be explicitly specified in the problem statement, it is not hard to make a test to break even simplest O(n*m) double precision solution. Re: eps Anatoliy V Tomilov 13 фев 2018 15:32 I totally agree. The problem should be reformulated in integers or other way to make use of arbitrary precision numbers. Also 10000*100000 is too small dimensionality to encourage participants to make submissions of O((N + M) * log(N + M)) solutions due to high constant factor of latter. Stupid algorithm with randomization and trivial vectorization is faster (and extremely easier to implement) then clever algorithm with Voronoi and point location. |