Advertisement
Bulgogi

Untitled

Aug 23rd, 2020 (edited)
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. Replicate data over adjacent servers
  2. Severs
  3. A B C D
  4. doc -> Server B # Needs have 2 copies
  5. [A,B], [B,C]
  6.  
  7. Severs
  8. A B C D
  9. 2mb 3mb 4mb 2mb
  10.  
  11. x = how many copies a doc needs to have
  12.  
  13. What is the biggest document you can have x copies of
  14. -----------------------
  15. Input:
  16. Two arrays A and B
  17. Lower and Upper
  18.  
  19. Find the total number of pairs of elements where one element is from A and the other is from B such that
  20. lower <= A^2 + B^2 <= upper
  21.  
  22. Ex)
  23. A = [1,2,3]
  24. B = [1,2,3] [1,4,9]
  25. lower = 3
  26. upper = 13
  27.  
  28. ans = 7 # (1,2),(2,1),(1,3),(3,1),(2,2),(2,3),(3,2)
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement