Mahmoud..Adel's blog

By Mahmoud..Adel, history, 8 hours ago, In English,

These are two solutions for uva 784 — maze exploration problem :

https://paste.ubuntu.com/26433633/

https://paste.ubuntu.com/26433634/

the first one gets accepted but the second one does not although they are almost identical ? can anyone help with the explanation

Read more »

 
 
 
 

By Mahmoud..Adel, history, 7 weeks ago, In English,

I was trying to solve 150A and I submitted a solution where I used a variable ( i ) in a loop :

for(int i=2; i*i<=n; i++)
    {
        while(n%i == 0)
        {
            n /= i;
            p[k++] = i;
        }
    }

and it got TLE in test 7

submission : 32983991

and when I changed the datatype of variable ( i ) to long long it got accepted.

submission : 32984272

can anyone help me with the reason...?

Read more »

 
 
 
 
  • Vote: I like it  
  • +1
  • Vote: I do not like it  

By Mahmoud..Adel, history, 2 months ago, In English,

An inquiry… Which is more effective? Digging deeper in each knowledge branch, as DP or graph theory, to be up to bar in it or working on diverse topics on the same time?
Other workable techniques are welcomed :D

Read more »

 
 
 
 
  • Vote: I like it  
  • +28
  • Vote: I do not like it