Common BoardFinally, I found the way to solve it in O(n) (needs about 4 full string-checks). In journey to this solution i tried to imagine that i'm cutting brackets like '()'. And watching what I can get by cutting all this pieces. Looking on new sequence I understood what I need to shift to get right bracket-sequence. Here are some tests that helped me: )))(()(( ans: 1 (()(())) ans: 1 ())( ans: 1 ))(())())((()( ans: 1 Edited by author 27.07.2012 14:19 what is the test #7? I have tried my own tests, my program outputs right answers, i don't know what to do try this: 2 A B C Isenbaev A D answer is: A 1 B 2 C 2 D 1 Isenbaev 0 Can anybody give me some tests? Time interval for each mage is not [t, s], it is [t, t+s-1]. it's all about point in tests (maybe) are nubmers in format XX.YYY I have WA#2 try test 3 0 0 0 0 0 0 0 0 0 I have WA 5 again and again. I tried all the test from this forum. I use neither double nor float, but still WA. I don't know how to deal with it. Can you give me some tests with answers? Oh, finally! AC! To all, who have WA5: try this test 2 1 0.13 Correct answer is 8.
Thank You very much!!! It's really very useful test! :) I don't know how to solve it, but I got AC because C#'s regular expression engine knows ;) How speed up C#'s regular expression engine? I have TL #6 and use Regex.IsMatch method Reduce pattern parts of "%%%%%%" to "%". It extremely raises performance of regex engine. The Test #2 must like this 1 1 100000000 hope it can help u. Edited by author 04.10.2009 15:10 thanks Thank you very! I output (x mod m),and forgot maybe x=m. I WA at test #2,too. But my WA program passed this test. then i change every int to long long and got a TLE at test #6 so i think test #2 involves very large numbers This test helped me to find several bugs 2 0,0:1-1,2012-200 201,201:2012-1 1:1,1 2012:200,200 Thank you! Wow!!! Usually the answer doesn't come so fast =) Why? What is a key point of this task? You can try to condense your graph first. It helped me to avoid TLE21 with my O(N^3) DFS and indeed would help your Floyd-Warshall. However, I am not sure whether there is not a better solution — my time is 0.25s that is so far from the best 0.046s. Thx, I will try this way. i did just dp. [bitmask][no of iter until roll back][height left] somebody help please. thanks in advance As many of you know, call to BigInteger.IsProbablePrime in java lead to "Restricted Function" verdict. Today I decided to resolve this problem. When I started reading BigInteger.java, I found that "isProbablePrime" method calls "primeToCertainty" method and passes null as "random" parameter. This null is passed to "passesMillerRabin". "passesMillerRabin" has the following lines of code: if (rnd == null) { rnd = getSecureRandom(); } Since "rnd" is actually null, getSecureRandom is called. It has following logic: private static volatile Random staticRandom; private static Random getSecureRandom() { if (staticRandom == null) { staticRandom = new java.security.SecureRandom(); } return staticRandom; } That is when called for the first time, it initializes staticRandom with java.security.SecureRandom, in all the following calls - returns cached object. Call to java.security.SecureRandom is the source of all problems. Since it is "secure", it uses a lot of information to initialize, including current time and ip address of machine it is run at. Of course, all attempts to get information about network configuration are blocked, so this caused "Restricted Function" verdict. Moreover, when we tried to allow all required calls, we found out that due to some strange problems such initializing took about five seconds. So we decided to change BigInteger class a bit to use usual Random with some predefined seed instead of SecureRandom. It solved all problems and now isProbablePrime works as it should. Rejudge of all submits that had "Restricted Function" verdict is now in progress and will be finished in few hours. tl;dr: BigInteger.isProbablePrime now works. Be happy. N and M both are odd numbers --> No solution ??? Try to find out it yourself. It shouldn't be hard. I was right! for n and m are odd -> no solution! But, solution is backtrasing or not? How we get this? После первого опрыскивания — 2, 4, 5, 1, 3. После второго опрыскивания — 4, 1, 3, 2, 5. После третьего опрыскивания — 1, 2, 5, 4, 3. После четвёртого опрыскивания — 2, 4, 3, 1, 5. После пятого опрыскивания — 4, 1, 5, 2, 3. После шестого опрыскивания — 1, 2, 3, 4, 5. I don't understand rule P. It's strange rule. =) please, give me some test Check the situation when one husband comes back for the second time, the quantity he wants to buy was modified meanwhile ... I had the same WA, but now I have AC I had wa 14 in this case: when husband returns the second time and amount was not changed then I forgot to set amount to 0 (husband buy this product) 715068 Yes 7+1+5=13 0+6+8=14 445219 No 4+4+5=13 2+1+9=12 <<<---- Why ANSWer is No ? ? ? 012200 Yes 0+1+2=3 2+0+0=2 WTF ? Edited by author 25.07.2011 00:19 Edited by author 25.07.2011 02:11 because next ticket is "445220" because next ticket is "445220" wth! Why is that so? because next ticket is "445220" wth! Why is that so? Yes, Sure!!! Ticket is: 715068 7+1+5=13 0+6+8=14 Next ticket is: 715069 7+1+5=13 0+6+9=15 Why answer is "Yes"? it is next, but before was 715067 7+1+5=13 and 0+6+7=13 2 sweet dream 3 swee t drea m Correct answer is Passed My java program crashes for this. I do not understand why. I tested for even big inputs and it is working fine for me in my machine. How do I know where it crashed ? No information is given by judge. Test 6 contains numbers on different lines (I suppose so). I have Crash in my C# program on this test. And now it is AC! I have the same trouble, also with java! Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); Above is like the A+B problem, I think it's right. Any one can help me plz?~:) I have the same trouble, also with java! Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); Above is like the A+B problem, I think it's right. Any one can help me plz?~:) I have the same trouble, also with java! Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); Above is like the A+B problem, I think it's right. Any one can help me plz?~:) I know why crash!~ for the input:40 1000000000 no problem what about this one: 1 1 I carsh because can't pass 1 1 But now AC~~~ Some new tests were added. 127 authors lost their AC. Теперь из-за антихеш тестов все задачи перерешивать? Спасибо :) Всегда пожалуйста. Очередной реджадж уже в процессе. Suffix Array Without Longest Common Prefix O(N*logN) 0.312 Edited by author 31.01.2014 21:34 Antihash tests are дрочерство. |
|