| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| How to solve it fast? | Livace | 1422. Светлячки | 22 дек 2016 18:09 | 1 |
My solution is O(n^2*logn) and works ~1.7 seconds. But some people got AC in .078. How? |
| How to solve it fast and cool? | Laise | 1063. Домино | 22 дек 2016 13:27 | 2 |
I solved it with next algo: I bruteforce all possible connections (if graph consists of several not connected parts) and then add some edges for Euler path with greedy. Of course its right algo, but some complicated (i think). Does anyone knows more simple one? Only use buffered i/o )). |
| wa 20 | Arsen | 1297. Палиндромы | 22 дек 2016 10:53 | 1 |
wa 20 Arsen 22 дек 2016 10:53 |
| Обратный корень Java | Ilimsky | | 21 дек 2016 21:35 | 2 |
Подскажите кто нибудь что я делаю неправильно? import java.util.*; import static java.lang.Math.*; public class Sqrt{ public static void main(String[] args){ Scanner in = new Scanner(System.in); System.out.println(sqrt(in.nextInt())); } } |
| Did the problem without using binary search. However it takes 0.109 seconds. | bluestar | 1880. Собственные числа Psych Up | 20 дек 2016 22:28 | 2 |
The main method I followed was to first compare two of the arrays and extract the similar values in another array. I then compared that array with the third array, and updated the counter each time there was a match in eigenvalues. This method avoids comparing all the arrays together, and hence takes up less time. So in essence number of operations reduces to O(2*N^2) instead of O(N^3). However, more sophisticated algorithms like binary search are more effective. But still I include this method for people like myself, who are new to algorithms. Hope it helps someone. Thank you! Did as you said and get Accepted)) 0.046 seconds (FreePascal) |
| Any hints? | Programmer | 1790. В поисках Истины | 20 дек 2016 21:36 | 2 |
Any hints for this problem? Try solve 2 sub problems when dodecahedron on odd position and not. |
| What's wrong with my code? (Pascal) | genchildren | 1001. Обратный корень | 20 дек 2016 02:59 | 4 |
var j,i,n:longint; m:array of real; begin n:=1; while not seekeof do begin read(j); SetLength(m,n); m[n]:=sqrt(j); inc(n); end; for i:=n to 1 do writeln(m[i]:0:4); end. 1. chek type of j. You may have input = 10^18, but max in longint ≈ 2*10^9. 2. Write size of array. 2. Don't know what this is: SetLength(m,n); delete this nah) 3. for i:=n to 1 do |=> for i:=n downto 1 do 4. Chek why for this input: 9. your output is 0.0000 3.0000 little change your programm and get AC)) Edited by author 18.12.2016 03:29 |
| If you want more fast code submit your solution to night , really :))) | c_pp | 1019. Перекрашивание прямой | 20 дек 2016 02:37 | 1 |
|
| WA9 | Stanislav Beskorovainiy | 1123. Зарплата | 19 дек 2016 19:29 | 1 |
WA9 Stanislav Beskorovainiy 19 дек 2016 19:29 I don't understand what's wrong in my program. Give me test 9 please |
| Why this problem rejudged?? | Shen Yang | 1415. Мобильная жизнь | 19 дек 2016 13:11 | 1 |
is there something invalid in test cases?? |
| What is in the test 26? | [kubsu] Eugene Kudinov | 1378. Искусственный интеллект | 18 дек 2016 22:11 | 1 |
Help! What is in the test 26? |
| How to get speed 0.001 seconds ???? | Ruben Ashughyan | 1048. Сверхдлинные суммы | 18 дек 2016 15:47 | 5 |
-- use fread | fwrite; -- do not use << if >> statement or minimize it; -- minimize div and mod operations ( % , / operators); -- instead of % , / operators may to use pre-calculated arrays. -- and last, need lucky :) 10^6 numbers --> input file size ~4 Mbytes, and output file size ~1 Mbytes. MY PC i-core 3 , 3 GB RAM, gcc 5.4.0 with option: g++ -Wall -O3 -std=c++14 reads/writes took 6-9 milliseconds. So there need something magic tricky to solve this with time < 1 milliseconds !!!!! I got 0.001s AC!! buffered i/o helped me. Your program ate 12 Mb memory. So I suppose you are reading the whole numbers and then do addition. It isn't necessary. It's possible to add numbers digit by digit (yes, from high digits to low) without any arrays usage - 0.3s even using scanf/printf. And yes, use fread/fwrite. Edited by author 13.12.2016 22:15 |
| Heeeh) Wa8 | Rocky.B | 1741. Монстр общения | 17 дек 2016 20:13 | 1 |
Forgot to sort the updates :) |
| WA #22 | TR Sriram | 1611. Децимация | 16 дек 2016 18:58 | 2 |
WA #22 TR Sriram 8 сен 2015 20:27 I am getting WA in 22nd case! I cant find my mistake. Can someone help me ? Re: WA #22 Tolstobrov Anatoliy[Ivanovo SPU] 16 дек 2016 18:58 Try this: 20 1 00000000100000000001 Answer: 0 1 15 |
| WA 23 | zahisho | 1238. Folding | 15 дек 2016 23:18 | 1 |
WA 23 zahisho 15 дек 2016 23:18 Please could anybody give me the test case? Thanks |
| If you get WA on #7/#15/#17 | WagJK | 1297. Палиндромы | 15 дек 2016 16:12 | 2 |
If you are using int(s[i]) to get the representation for any alphabet, you may need to enlarge your counting sort table and counting sort iteration limit. I thought 200 was enough for latin alphabets, but actually I tried several times and succeeded at about 1100. I don't even know why... |
| 34 WA | Vadimzzz | 1820. Уральские бифштексы | 15 дек 2016 12:56 | 2 |
34 WA Vadimzzz 15 дек 2016 12:50 |
| Why read text with std::getc got AC 0.001s and fread got AC 0.015s for C++ compilers ???? | c_pp | 1027. Снова D++ | 15 дек 2016 00:14 | 1 |
char s[16384] ; unsigned n = 0; // AC 0.001s with this code. for(int c = std::getc(stdin); c != EOF; c = std::getc(stdin)) s[n++] = c; // and AC 0.015s with n = fread(s,1,sizeof(s)-1,stdin); code. // I'm wonder that the std::getc faster than fread!! |
| Formula | Sanatbek_Matlatipov | 1902. Нео-Венеция | 14 дек 2016 22:51 | 2 |
Formula Sanatbek_Matlatipov 7 окт 2015 23:29 System.out.printf("%.6f\n",(t+s+ss[i])/2d); It have solution with no arrays, lol) And (t+x+si)/2.0 right too, but some simply) I know, that my English bad( |
| WA on test #28 | Shen Yang | 1399. Экономный директор | 14 дек 2016 20:03 | 5 |
any one help?? I need help... I use radom to generate 200 chain list,and then cut the chain list, using O(polynomial) dynamic programming, it is WA on test # 26, then I use regular brute_force search times>=1e7 return, it WA on test #28... anyone give some ideas?? I think cut the chain method get WA is because though between two rows there is at most one same buyer, but there maybe more then two rows have same buyers for exmaple ,structure of solution maybe 0--1---2--3--4--5---0 0--1--6--0 0--2--7--0 0--3--8--0 0--4--9--0 0--5--10--0
Edited by author 14.12.2016 14:14 AC now it is some stupid bugs on my code?? btw , I think this problem is much easier than ural 1394 why not find accuarcy solution? |