|
|
Common BoardWA on the 5th test! It passed all random tests on my computer. got no idea! Please help me! Edited by author 12.03.2008 17:48 It gives WA please give me test for it (test #11) +1 I have the same problem. Could somebody give a test, please? Tried all the tests of this forum, neither of those helped me. +1 why no one answers?( My WA11 x-x x-x Result: 0 My result before AC on WA11: <empty line> This test could help you. 5 8 1 5 2 200 1 2 1 100 99 2 3 0 0 0 3 2 0 0 0 2 4 0 0 0 4 2 0 0 0 3 4 0 0 0 4 3 0 0 0 4 5 1 100 99 You can draw this graph on paper, and the answer will be obvious. I have this output: 99 3 1 4 8 Good luck. I got RE9.I got WA10 after use your test.So interesting.QAQ Sorry my bad English. Edited by author 17.08.2021 06:35 In my case WA 10 was caused by one directional roads, not <->. "In a country, there is a number of cities connected by unidirectional roads" try changing the cycle: while(energy > 0.01) to while (energy > 0.00000000001) Maybe this will help you Попробуйте поменять цикл while (energy > 0.01) на while (energy > 0.00000000001) Возможно, это поможет Damn, how is this problem 440 difficulty, I solved it in 10 minutes The DP version actually harder than you think. The solution with magic formula is disappointing. Go solve other problems and come back later. The score of problems are calculated by number of accepted solutions, and some problems are very popular and people find out answers and send ready solutions. 0. I wanted to implement universal approach with Huffman coding + compressing binary code to 64 base code. Not just eng text property (I was upset, because for so interesting task so stupid solution works). 1. I'm Java developer, and I afraid that Java consume too much memory even for input. So I have to rewrite all to cpp. 2. Thinks that costs me a lot of time. Input in cpp. (If you can explain what is wrong. please do ) WRONG inputData = ""; std::string line = ""; while (std::getline(std::cin, line)) { inputData += line; //inputData.push_back('\r');//todo maybe we need \r\n inputData.push_back('\n'); } CORRECT inputData = ""; int c; while ((c = getchar()) != EOF) inputData.push_back((char)c); 3. Escaping characters to produce cpp code: std::string escape(char ch) { switch (ch) { case '\'': return "\\'"; case '\"': return "\\\""; case '\\': return "\\\\"; case '\b': return "\\b"; case '\f': return "\\f"; case '\n': return "\\n"; case '\r': return "\\r"; case '\t': return "\\t"; default: return {ch}; } } I finally got AC. So I wish you good luck with this problem and thank to author so interesting problem. import re pattern = re.compile(r"\d+") matches = re.findall(pattern, input()) for i in matches[::-1]: print(f"{float(i)**0.5:.4f}") Input: " 1427 0 \n 876652098643267843 \n5276538" No way, this become harder than 1293. Eniya. We did it, guys!!! Some useful tests for WA3: 3 3 2 2 3 answer: NO 4 3 2 2 3 answer: YES No these won't help for WA at 3. Bruteforse gets TL on Python but works on c++ The limitations and input/output format were changed. Old submission were moved to the problem 1012. Shouldn't the complexity of the problem be changed as well? Not sure that the complexity 189 corresponds to the intended solution for the new limitation. What is test 11? Edited by author 05.12.2021 02:11 Is it possible to use somehow that p is prime? My AC solution doesn't use this fact, but I'm wondering is there a simpler way to solve this task. Complexity is (M + N) * log N, where N is a size of the array and M is a number of queries I needed primality of 'p' when I calculated S(K) from sums of powers for Ai. I needed to divide by 2, 6 or 24 in the end. Primality plays important role when you find inverse of these divisors modulo 'p'. Also the fact that S>1000 was also convenient fact because some multiplications would turn to zero for quite small p. This problem is named "Elementary Symmetric Functions". There is formula (by Newton) that gives relation between elementary symmetric polynomials and "power sums" (that are symmetric too). Formula used division that can be done in general case only by prime modulo. But it can be solved without knowing any special about these polynomials. In this case solution doesn't need the primality of P. And then we have a data structure problem only, not number theoretical :) I used interval tree and memoization of sums on subsegments. And still the 4 seconds limitation is too large. upd: Fenwick tree is better ;) Edited by author 10.09.2011 23:40 I understand how to solve the problem with combinatoric formula and 4 segment trees, can you please explain the second way? А мне жалко стану, которая до сих пор живёт так( Да боже. Вы, тупые нытики, даже на сайте с программированием ноете. Как же вы задолбали уже. Никто так не живёт Hi I think that we should help each other. If someone resolves a problem he/she must help the others with materials or links where the algorithm/formula is explained. This is the reason we are users of such sites - because we want to improve our programming skills. So I decided to help all of you who find this problem difficult. Here you can find help: http://en.wikipedia.org/wiki/Circular_segment http://www.mathopenref.com/segmentarea.html The rest is up to you! HTH Edited by author 22.10.2013 12:23 thanks dude, i didn't even understood what the question was asking :) Thanks, bro, you are real man! |
|
|