| Show all threads Hide all threads Show all messages Hide all messages |
| is there any non-print table approach?? | Shen Yang | 2061. OEIS A216264 | 6 Mar 2018 09:51 | 2 |
|
| wa 11 | Paata Julakidze[GTU] | 1106. Two Teams | 5 Mar 2018 20:06 | 1 |
wa 11 Paata Julakidze[GTU] 5 Mar 2018 20:06 My solution is crushed on 11 test. please help me... |
| WA#4 | Kolyanich | 1751. Improbability Theory | 5 Mar 2018 14:26 | 2 |
WA#4 Kolyanich 17 Apr 2011 22:07 be careful don't compute repeated floyd[i][j]=true only once |
| Time consumed by outputting large arrays to the console | Ilya | 1701. Ostap and Partners | 5 Mar 2018 03:51 | 1 |
Hello all. I am doing task #1701, but ,actually, my question is also related to other equal tasks: how can you not exceed the time limit when the task supposes large array as the answer? For instance, in mentioned task the time is limited to 2 seconds. In case when N == 50 000, if possible set of emplyee's salaries exists, you need write 50 000 strings to console. But, as i have found out by measurig, only outputting array to the console takes over 3-5 seconds. Test it using C# and C++ with array of int values set to "0". Edited by author 05.03.2018 09:04 |
| If you have WA5 | tproger | 1067. Disk Tree | 4 Mar 2018 23:08 | 1 |
If you use set<A*> or std::sort/std::stable_sort vector/array of pointers, your comparator won't work, because you need special comparator, like this struct APtrCmp { bool operator()(const A* lhs, const A* rhs) const { /* implement logic here */ } }; set<A*, APtrCmp> yourSet; Good luck! ;) |
| Why wrong (c) | vilikan | 1068. Sum | 3 Mar 2018 09:52 | 6 |
#include <stdio.h> #include <math.h> int plus(int number){ return number*(number+1)/2; } int minus(int number){ return (-(number*(number+1)/2))+number; } int main(){ int N; scanf("%d",&N); if(abs(N)>=1 && abs(N)<=10000){ if(N<0) printf("%d",minus(N)); else printf("%d",plus(N)); } } Why do you think, that 0 is prohibited input? What the reason to check input at all? "if(abs(N)>=1 && abs(N)<=10000)" is superfluous. The statement of the problem can't lie. Thanks you so much. I'm new to olympiad programming and I sometimes make silly mistakes thanks to pointing to them Edited by author 03.03.2018 09:54 Edited by author 03.03.2018 09:53 |
| same as 1075 | ssor96 | 1285. Thread in a Hyperspace | 2 Mar 2018 18:00 | 1 |
this task is the same as 1075, but with a different number of dimensions(it doesn't really matter) |
| WA24 | Alexander | 1912. Titan Ruins: Passing through Walls | 2 Mar 2018 12:25 | 1 |
WA24 Alexander 2 Mar 2018 12:25 3 different solutions gets WA24. Is this test correct or I don't understand the statement? |
| C++17 | ASK | | 2 Mar 2018 01:06 | 4 |
C++17 ASK 28 Feb 2018 14:35 If we run GCC 7.1, we can as well use -std=gnu++17 I have no G++ 7.1 to check. But G++ 7.2 said you are correct. |
| Very Useful Advice | SergeyGlazkov [SPbPU] | 1049. Brave Balloonists | 1 Mar 2018 20:46 | 1 |
Before sending your solution try this test on your pc and make sure that pc can calculate it faster than 10 hours :)) 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 1 |
| решение С# | Terekhin Grigory | 1787. Turn for MEGA | 1 Mar 2018 15:32 | 1 |
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace РџРѕРІРѕСЂРѕС‚ { class Program { static void Main(string[] args) { string[] mas = Console.ReadLine().Split(' '); int k = int.Parse(mas[0]); int n = int.Parse(mas[1]); int[] A = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(i => int.Parse(i)).ToArray(); int M = 0; for (int i = 0; i < n; i++) { M += A[i]; if (M - k >= 0) {M -= k;} else {M = 0;} } Console.WriteLine(M); } } } Надеюсь понятно всё. |
| The code on Python work correct whe same code on Ruby have wrong answer #3 | Valentin Gulyaev | 1785. Lost in Localization | 26 Feb 2018 00:33 | 3 |
Have solved this task in Python many years ago. How test my code on Python and have Accept This code on Ruby have WA on test №3 Stay tuned and inform us as quick as possible. |
| WA#3 | Lakers | 1872. Spacious Office | 25 Feb 2018 17:00 | 3 |
WA#3 Lakers 19 Oct 2011 09:12 My program gets wa#3 test 3: 6 1 2 3 4 5 6 1 1 1 6 2 3 3 3 4 4 5 5 my program out: Perfect! 1 3 4 5 6 2 it's wrong? Edited by author 25.02.2018 18:18 |
| It's very easy to overcome TLE. | balandini | 1353. Milliard Vasya's Function | 25 Feb 2018 04:49 | 4 |
If you have program which gives right answer for the problem, but it's too slow and gets TLE, then you may just calculate answers for every possible input(there are only 81 possible variants of input, so you can calculate them all) and then create another program: put array of 81 possible answers in this program and them just read s from input and write in output corresponding answer from the array. I had made such program and it got AC. In this case what is the use solving this problem. Edited by author 25.02.2018 04:48 Edited by author 25.02.2018 04:49 Edited by author 25.02.2018 04:49 Edited by author 25.02.2018 04:49 In this case what is the use solving this problem. |
| If you got RE at test case 9 | Thomas0726 | 1061. Buffer Manager | 24 Feb 2018 13:41 | 1 |
it may help: line = Console.ReadLine(); while (line.Length < N) { line += Console.ReadLine(); } |
| WA 19 | Lightless [Samara SAU] | 1963. Kite | 24 Feb 2018 01:28 | 1 |
WA 19 Lightless [Samara SAU] 24 Feb 2018 01:28 |
| Why I get a TLE #6 ? | Yang Tianyi | 1018. Binary Apple Tree | 23 Feb 2018 06:47 | 4 |
Just like what I have said,I got a TLE and execution time is 1.029. Who can help me? Now I get an AC Just change "if(!y)" into "if(!y||!x)" |
| About TLE and Recursion | † Ленин † [Yaroslavl SU] | 1018. Binary Apple Tree | 23 Feb 2018 06:45 | 5 |
I got TL#6. After that just a little bit updated my solution: int max( int pos, int len ) { ..if ( ch[pos][len] ) ....return dp[pos][len]; --- ....ch[pos][len] = 1; ....dp[pos][len] = res; ....return res; --- } and got AC in 0.015s. Edited by author 23.03.2010 20:30 I get TLE in #6 too , can you explain in detail? Well, I checked my solution and it didn't seem that could exceed the time limit... Weird... I've got TLE #6 too. Can you explain in detail??I'm afraid i can't understand..... oh,now I get AC.Just a little mistakes. |
| WA at #1 ?? Try this data... | arena_zp | 1018. Binary Apple Tree | 23 Feb 2018 06:14 | 6 |
6 4 1 2 20 2 5 100 2 3 20 6 3 70 4 1 10 by the way : before you use the dynamic programming on the tree structure, be sure you have build the tree correctly. That's why I got WA. Source Code is available at : ecnu_zp@yahoo.cn I guess this test is incorrect, because of statement: " any biparous branch splits up to exactly two new branches", but node 3 has only one branch. As I can see here is 2 possible trees. 1 and 3 can be root 6 \ 5 3 \ / 4 2 \ / 1 4 \ 5 1 \ / 6 2 \ / 3 Edited by author 20.12.2015 15:47 wrong test case, there will always be zero or two children of any node. |
| can anyone explain me how to do it??? | Kirill | 1878. Rubinchik's Cube | 21 Feb 2018 15:08 | 1 |
explain me the way of doing it or give a solution Edited by author 21.02.2018 16:21 |