Common BoardThis 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 дрочерство. Compressing the coordinates is the most obvious solution and it's hard to name this approach "data structures"... The guys like me who AC'ed it with any more stupid idea like straightforward implementation on vector are offended in their best feelings. :-) my program passed all tests in this forum + my own tests. But, I got WA #3. Please, give me a test. algo N^2 it help me: 1 1 999999999 b ans: 0 1 +) My uncorrect answer was 0 2 =) AC) Edited by author 21.07.2012 01:25 8-th test is 1 k, where k is any. Answer is 2. Sorry for my English) thanks. how did you find out wich test is what? 8-th test is 1 k, where k is any. Answer is 2. Sorry for my English) Thanks z попробував як тут написано ( вибачте, я не знаю ні російської ні англійської) щось типу 1 k і в мене програма працює, але знову вибиває WA8... допоможіть будьласка, дякую! 8-th test is 1 k, where k is any. Answer is 2. Sorry for my English) Help me... I really don't know, why 25000000 TL? I think 25000000 not many time...and must get AC in 1 sec. Edited by author 17.04.2008 08:16 Try to change the order of FOR cycles. For example, for (i=0;i<n;i++) for (j=0;j<n;j++) p[i][j]=1; works faster than for (j=0;j<n;j++) for (i=0;i<n;i++) p[i][j]=1; Why??? But I use first variant and get TL... 25000000 operation : compare of char and value assignment of integer. And 12500000 operation works 0.953! Why this work too many time???? Edited by author 18.04.2008 09:58 My O(N^2) solution works 0.171. My O(N^2) solution works 0.171. Can you write your code as pseudo or explain your algo in details, please? Not in forum ... Mail to me. (I send to u my code only) naxart@yandex.ru May be because of "mod operation"? Some new tricky tests were added. 53 authors lost their AC. someone have AC with hash? what base u used? Read this: http://codeforces.ru/blog/entry/4898Now it's VERY difficult to get AC with hashes. Double hashes fail on TLE, single hashes fail on collisions at most cases. You must be really lucky to solve it with hashes now. I did it :D On Java. Edited by author 20.07.2012 12:30 My code: [code deleted] I don't know why. Help please. Edited by moderator 22.02.2006 00:52 May be, someone know test#9? Thanks! I find my mistake and I have AC. Could you give me the ninth test? My program fails on it too. :( Try this test. My program failed on it. 3 0 0 30 -30 30 -25 30 6 correct answer: 3 Are you sure? I did it by hand and I think it's 2. Could you give the coordinate to drop the bomb on? |
|