Title |
User |
Message |
Date Posted |
Re at the 4th test case |
4Dmovie |
Re at the 4th test case. I saved sides in this way, tot++; edge[tot].from = x, edge[tot].to = y; I don't know what's wrong. Anyone can help me? Thanks! |
Apr 12, 2016 - 8:16:12 pm UTC |
Re: Hint? |
jargon |
It was in the original problem statement. |
Feb 11, 2016 - 2:49:26 am UTC |
Hint? |
jimgao |
Is the hint provided in the official problem statement? Or is it simply added by the admins? |
Feb 09, 2016 - 11:51:37 pm UTC |
Re: ... |
jungernaut165 |
Thank you very much friend! I got it! |
Apr 22, 2015 - 4:25:11 am UTC |
Re: ... |
thorthugnasty |
Your solution takes an extra O(n) to check (if g in G[i]). Instead of looping through all vertices and checking if it's in G[i], just loop through all vertices in G[i]. |
Apr 21, 2015 - 10:16:17 pm UTC |
Re: ... |
jungernaut165 |
Thanks for your input. I appreciate it. I tried that too. Still TLE on #4. Any other suggestions? |
Apr 21, 2015 - 9:22:45 pm UTC |
Re: ... |
fifiman |
Try using lists instead of sets |
Apr 21, 2015 - 7:49:53 pm UTC |
... |
jungernaut165 |
I changed to a DP approach (as opposed to BFS) and succeeded in getting 4/5. 4th is still TLE...any suggestions of what I could improve? |
Apr 21, 2015 - 7:38:10 am UTC |
... |
jungernaut165 |
I am using a BFS search for this problem. It works 3/5 cases with TLE for the other 2. Any suggestions how I could improve my algorithm? |
Apr 21, 2015 - 5:42:52 am UTC |
Re: Segmentation Fault? |
fifiman |
You are allocating the array of 10000*10000 = 100000000 bytes = 100 MB (bool is one byte). You're using too much memory |
Mar 18, 2015 - 1:56:35 am UTC |