Zlatan's blog

By Zlatan, history, 8 days ago, In English,

Hey guys! My professor proposed me to solve this problme. Given a number p <= 10^7, print the sum of the digits of 2^p. For exemple, 2^4 = 16 so we'll print 7. How can I do this properly? I first tried to use in a way or in another, the little theorem of fermat but it made no sense here.

Read more »

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

By Zlatan, history, 5 weeks ago, In English,

Hey! Can anybody help me with a solution to this? We have an array of pairs [ (x1,y1) , (x2,y2), ... , (xn,yn) ]. Initially, we are at the coordinates (0,0). We can use whatever pair from the array (maximum one time) to move from the actual position (a,b) where we are to (x + xi, y + yi). The numbers from the array's pair are between [-10^4, +10^4]. Which is the maximum distance we can move from the origin (0,0) after using some of these pairs from the array? We have a maximum of 2000 pairs. I am grateful to those who brighten me.

Read more »

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

By Zlatan, history, 8 months ago, In English,

Hey guys! Can anybody explain to me how to find the bridges in a graph? I know how to find the articulation points, but I don't know how to handle the bridges. Also, is there any platform where I can submit these 2 classical algorithms? Thank you in advance!

Read more »

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

By Zlatan, history, 10 months ago, In English,

Hi! I encounter difficulties in finding a solution to this problem: having a matrix filled with 0 and 1, size N x N with N <= 1000, output the number of squares with the border filled with 1 (we are not interested in what's inside the square). We consider valid even the squares of size 1x1. For this example, the answer is 27. Can anybody help me? (sorry for the example, I don't know how to show the lines one above the others) 0000000 0111100 0101111 0100101 0111111 0000011 0000011

Read more »

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