| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| A way to reduce memory | Igor Parfenov | 2040. Палиндромы и сверхспособности 2 | 18 май 2020 14:00 | 1 |
Maybe I'm an addict, but since n<=5e6<2^24 I used unsigned short + unsigned char in order to immitate 3 byte integer type. |
| WA3 | morbidel | 1878. Кубик Рубинчика | 17 май 2020 00:33 | 18 |
WA3 morbidel 22 окт 2011 16:05 Re: WA3 Anil Kishore 22 окт 2011 16:21 Re: WA3 Strekalovsky Oleg [Vologda SPU #1] 23 окт 2011 23:43 'm stuck with WA5 :( Don't forget rotate clockwise and anticlockwise at one step! Yes, rotating just 90 degrees in either directions takes one step. What's the trick here? Re: WA3 MOPDOBOPOT (USU) 25 окт 2011 13:49 This test helped me to overcome WA3: 4 2 2 3 3 1 4 1 3 2 3 1 1 4 4 2 The answer is 4. Because collect '4' needs 5 steps, but collect '1' needs only 4 steps. My answer is 4. I made a classic backtracking which gets WA3 and also a Greedy who also gets WA3, which works as follows: - assume the square is solved with 1 in the upper left corner, compute the orientation of each of the layers (0 if ok, 1 or 3 if with a rotation we reach 1 in the corner, 2 if with 2 rotations). - now try to rotate the layers to achieve the color i in the upper left corner - so for each layer determine the minimal nr. of steps to move the color i from layer j in its correct position - compute the minimal number of moves to reach the solution with color i in upper-left - print the minimum out of those values Edited by author 25.10.2011 15:22 I figured out the test #3, it has T[0][0] = 2, T[0][1] = T[1][0] = 1, T[1][1] = 3, "if (...) while(1);" did the trick. So the whole table I assume is 2 1 2 4 1 3 1 2 3 4 2 4 1 3 4 3 My program outputs 2 as a minimum (rotate layer 4 clockwise with 90, rotate layer 3 anti-clockwise with 90), resulting a solved cube with 1 in its left corner. The judge answer is 3, but I don't understand why. Am I missing something? Edited by author 26.10.2011 00:04 AC at last! The problem in my solution was that I assumed always that the colors were 1-red, 2-yellow, 3-green, 4-blue, but they say that one number is one color so they could be permuted in any way. Edited by author 27.10.2011 01:55 Re: WA3 Lucian Ilea 7 ноя 2011 21:37 My AC program gives 2 as the answer for: 2 1 2 4 1 3 1 2 3 4 2 4 1 3 4 3 Re: WA3 Soucup Adrian 29 июн 2012 20:52 My AC program gives 2 as the answer for: 2 1 2 4 1 3 1 2 3 4 2 4 1 3 4 3 Strange. Mine gives 3. (Also AC). Edited by author 29.06.2012 20:52Re: WA3 Squire [Lviv NU] 29 авг 2012 23:21 My AC program gives 2 as the answer for: 2 1 2 4 1 3 1 2 3 4 2 4 1 3 4 3 Strange. Mine gives 3. (Also AC). Edited by author 29.06.2012 20:52It's obvious that the answer is 2. Bad tests :) Mine gives 2 and I got AC for this input: 2 1 2 4 1 3 1 2 3 4 2 4 1 3 4 3 Edited by author 02.07.2019 19:33 But this test incorrect, because always colours order 1-2-3-4 IN this tet 1-2-4-3. My AC solution also gives 3. Re: WA3 Squire [Lviv NU] 29 авг 2012 23:31 This test helped me to overcome WA3: 4 2 2 3 3 1 4 1 3 2 3 1 1 4 4 2 The answer is 4. Because collect '4' needs 5 steps, but collect '1' needs only 4 steps. You're wrong. The answer is equal for every colour cause you cann't collect only one colour but all the colours together. To collect '4' you must turn left inner square and turn right two outer squares each for 1 time. So we have 3 steps in sum. P. S. Sorry for bad english ( Edited by author 29.08.2012 23:31 Edited by author 29.08.2012 23:31 Edited by author 29.08.2012 23:33Re: WA3 MOPDOBOPOT (USU) 30 авг 2012 00:09 If we turn squares as you said we will get this situation: 4 3 3 3 4 4 3 2 4 1 2 2 1 1 1 2 Re: WA3 Squire [Lviv NU] 30 авг 2012 01:16 If we turn squares as you said we will get this situation: 4 3 3 3 4 4 3 2 4 1 2 2 1 1 1 2 Yes, you're right ))) We need one more step - turn right the square which includes element table[3][1]. So, the answer is 4. ac is reached just using 4 elements in inputs. |
| Simple | Mehas | 1219. Symbolic Sequence | 16 май 2020 16:39 | 5 |
Simple Mehas 25 июл 2004 01:31 This problem can be solved without random exirsices :) I have got AC just by writing triads in order(without spaces): aaa aab aac aad... aba abb abc abd... zzz. I did it recursivly. And then you must repeat this sequence until number of characters=10^6; I did the same and was actually surprised when it worked! I have got no idea why would people have problems with this one, it's really easy to solve |
| WA4 | reshke'` | 2060. Подпалиндромные пары | 15 май 2020 15:38 | 2 |
WA4 reshke'` 12 мар 2018 20:58 Does anyone know what this could be related to? Re: WA4 Alikhan Zimanov 15 май 2020 15:38 I found the following test when got WA4: INPUT: aaa OUTPUT: 4 |
| time exceeded。。can you help me make it faster? | xinxin | 1131. Копирование | 15 май 2020 04:21 | 3 |
#include<stdio.h> #include<math.h> int main() { int n,k,i=1,s=1,t=0,temp=0; scanf("%d %d",&n,&k);
while(i<k) { s=s+i; i=2*i; t++;
if(s>=n) break; } while(s<n) { s=s+k; t++; } printf("%d",t); return 0; } while(s<n) { s=s+k; t++; } Isn't here (n-s)/k iterations? #pragma optimize( "g", on ) |
| How to find minimum teams using SCC? | ajay jadhav | 1742. Тим-билдинг | 14 май 2020 20:45 | 1 |
I got AC for maximum temas using Kosaraju. and for minimum I started with nodes with no incoming edge and searched until it hit previously found node (cycle) this is 1 team. For disconnected cycles, run dfs in similar fashion incrementing teams by 1. |
| Hint | Ishmeet Singh Saggu | 1742. Тим-билдинг | 14 май 2020 19:47 | 2 |
Hint Ishmeet Singh Saggu 28 апр 2020 22:51 This question requires knowledge of Strongly Connected Component. If you don't know read about it. Good Luck !!! for max = number of strongly connected components. for min = ? |
| Error on submission with default core Java | Jose_Silva | 2004. Учёные из Спилково | 14 май 2020 17:50 | 1 |
Hi, I have submitted one solution with: new String("0").repeat(n) => n is one number, and the system not know repeat method for Java 1.8, what's about that?! It's core Java. Thanks, Jose |
| If you have WA #6 | PrankMaN | 1998. Старый падаван | 14 май 2020 13:02 | 1 |
> They fall until the total weight of the fallen stones exceeds k kilograms So weight of fallen rocks should be at least k + 1 |
| To admins: there is an error in test cases | ivzh | 1280. Topological Sorting | 13 май 2020 22:45 | 1 |
Hi! Could you please check the next test case: ``` 3 2 1 2 1 3 3 1 2 ``` result should be `no`, but 4 my case i have `yes`. Despite this i had AC. Thanks in advance! Edited by author 13.05.2020 22:47 Edited by author 13.05.2020 22:47 |
| Hint if you have TL on big tests (# >= 15) | PrankMaN | 1244. Джентльмены | 13 май 2020 21:00 | 1 |
Instead of searching for answer for m, search for sum - m |
| WA 29 test | momo | 1830. Справка в НацОС | 13 май 2020 15:22 | 4 |
Does anybody know what is so special about test no 29? I am positive that my solution is correct (which is obviously not the case) but it gets WA 29. I even compared it with a slow solution (BFS) but I did not find any differences. Please, I would really appreciate some help because I have tested all possible input combination for length 8 and the slow and fast solution produce the same answers. I FOUND MY MISTAKE :) Edited by author 17.06.2011 19:06 Edited by author 17.06.2011 19:06 test: 50 0000000000000000000000000000000000000000000000000000000000001 - 50 times 0000000000000000000000000000000000000000000000000000000000000 ans=2^50-1 : __int64 test: 50 0000000000000000000000000000000000000000000000000000000000001 - 50 times 0000000000000000000000000000000000000000000000000000000000000 ans=2^50-1 : __int64 Well, the length of the strings you provided are not 50 but 61, so the answer for this test is (2^61)-1 The correct test is 50 00000000000000000000000000000000000000000000000001 00000000000000000000000000000000000000000000000000 |
| hint | ajay jadhav | 2034. Корованы | 11 май 2020 23:21 | 1 |
hint ajay jadhav 11 май 2020 23:21 robbers dont know the path, so at each point take farthest node from robbers.do these fo for the length of shortest path and in the end take minimum of these. |
| for WA#5 | ajay jadhav | 1890. Деньги из воздуха | 10 май 2020 23:51 | 1 |
for lazy node propagation I did tree[n]+=(end-start+1)*lazy[n]; when start and end were integers. tree[n]+=(end-start+1)*(1ll)*lazy[n]; corrected error. |
| Is task solvable in python? | Anatoly [sesc 17] | 2102. Миша и криптография | 10 май 2020 06:26 | 4 |
I was able to reach 28 test in Python 3. Я дошел до 28 теста на Python 3. Edited by author 24.11.2016 23:52 Yes, I solved this problem using Python Yes, you just have to do some optimizations |
| stop asking #3 WA - HINT here | melkiy | 1603. Эрудит | 10 май 2020 04:24 | 8 |
To all of you who cannot overcome #3 !!! All the suggestions about redundant '\n' and about that the dictionary may have repeated words have nothing to do with WA #3 (read condition carefully). If you use any kind of backward tracking, be it recursion or DFS, check the "no luck" condition attentively. First i used checking the next letter to be '\0' at the beginning of my recursion function, and if so returned 'true'. This is wrong! You must make word-end check BEFORE you make the next step, otherwise you may get "deadlock" "there is no direction to go" though there is no need to go anymore!!! Test word for the example table rabadaabracabrac: YES (starting from [3,1] in C-like indices). How did you get rabadaabracabrac: YES In the condition there is said,that words could not have self-intersections. But if you don't intersect you will not get this word. My program writes NO on this test Thank you, melkiy! I made the same mistake :( My program got YES on this test, by have WA#3 It's not a test case for WA#3: rabadaabracabrac: YES and it's not working. My reason for WA #3 was that I tried to use 1d char array to store the table and used i -> i - 1 to go left and i -> i + 1 to go right, however, if you are in the first column you can't go left and if you're on the 4th row you can't go right |
| DP+BIT | ajay jadhav | 1523. K-инверсии | 9 май 2020 21:55 | 1 |
DP+BIT ajay jadhav 9 май 2020 21:55 similar to strictly increasing subsequnce of length k just query and update BIT in reverse. |
| different c++ implementations - completely different results | imaginary friend | 1915. Руины титанов: воссоздание былого | 9 май 2020 10:45 | 2 |
Clang++ 4.0.1 - 0.39s - Accepted G++ 7.1 - 0.421 - Accepted Visual C++ 2017 - 1.029 - Time limit exceeded rofl in general i noticed that for the most problems clang is usually faster then g++ or ms c++ Edited by author 21.08.2018 03:53 I got it the other way - TLE #42 using G++ and Clang++, but AC 0.687 Visual C++ |
| WA3 and WA12 | Levon Oganesyan | 1651. Кратчайшая подцепь | 8 май 2020 21:50 | 3 |
For WA3 try this: 3 1 2 1 Ans: 1 For WA12 try this: 5 1 2 3 1 5 Ans: 1 5 We have correct answers but on test 7 we have wrong answer Edited by author 08.05.2020 21:50 |
| My mistake for WA #6 | ajay jadhav | 1930. Машина инженера Ивана | 8 май 2020 20:33 | 1 |
I had maintained dis[n+1][2] for distance. But visited array was vis[n+1], changed it to vis[n+1][2] and simple bfs. |