セグツリーイメージ

2,060 views
2,005 views

Published on

http://d.hatena.ne.jp/kyuridenamida/

Published in: Education
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
2,060
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

セグツリーイメージ

  1. 1. Step1. [1,5]に2を足す. value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  2. 2. Step1. [1,5]に2を足す. value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  3. 3. Step1. [1,5]に2を足す. value = 0 , lazy = 0 value = 0 , lazy = 1 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  4. 4. Step1. [1,5]に2を足す. value = 0 , lazy = 0 value = 8 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 2 value = 0 , lazy = 2 value = 0 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  5. 5. Step1. [1,5]に2を足す. value = 0 , lazy = 0 value = 8 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 2 value = 0 , lazy = 2 value = 0 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  6. 6. Step1. [1,5]に2を足す. value = 0 , lazy = 0 value = 8 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 2 value = 0 , lazy = 2 value = 0 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  7. 7. Step1. [1,5]に2を足す. value = 0 , lazy = 0 value = 8 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 2 value = 0 , lazy = 2 value = 0 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 2 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  8. 8. Step1. [1,5]に2を足す. value = 0 , lazy = 0 value = 8 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 2 value = 0 , lazy = 2 value = 0 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 2 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  9. 9. Step1. [1,5]に2を足す. value = 0 , lazy = 0 value = 8 , lazy = 0 value = 0 , lazy = 0 value = 0 , lazy = 2 value = 0 , lazy = 2 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 1 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  10. 10. Step1. [1,5]に2を足す. value = 0 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 2 value = 0 , lazy = 2 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 2 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  11. 11. Step1. [1,5]に2を足す. value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 2 value = 0 , lazy = 2 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 2 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  12. 12. Step2. [4,4]の値を求める value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 2 value = 0 , lazy = 2 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 2 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  13. 13. Step2. [4,4]の値を求める value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 2 value = 0 , lazy = 2 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 2 value = 0 value = 0 value = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  14. 14. Step2. [4,4]の値を求める value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 4 , lazy = 0 value = 0 , lazy = 2 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 2 value = 0 value = 0 value = 0 lazy = 2 lazy = 2 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  15. 15. Step2. [4,4]の値を求める value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 4 , lazy = 0 value = 2 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 0 value = 2 value = 0 value = 0 value = 0 lazy = 2 lazy = 2 lazy = 2 lazy = 2 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  16. 16. Step2. [4,4]の値を求める value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 4 , lazy = 0 value = 2 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 2 value = 2 value = 2 value = 0 value = 0 value = 0 lazy = 2 lazy = 2 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  17. 17. Step2. [4,4]の値を求める value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 4 , lazy = 0 value = 2 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 2 value = 2 value = 2 value = 0 value = 0 value = 0 lazy = 2 lazy = 2 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  18. 18. Step2. [4,4]の値を求める value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 4 , lazy = 0 value = 4 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 2 value = 2 value = 2 value = 0 value = 0 value = 0 lazy = 2 lazy = 2 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  19. 19. Step2. [4,4]の値を求める value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 4 , lazy = 0 value = 4 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 2 value = 2 value = 2 value = 0 value = 0 value = 0 lazy = 2 lazy = 2 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  20. 20. Step2. [4,4]の値を求める value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 4 , lazy = 0 value = 4 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 2 value = 2 value = 2 value = 0 value = 0 value = 0 lazy = 2 lazy = 2 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8
  21. 21. Step2. [4,4]の値を求める value = 10 , lazy = 0 value = 8 , lazy = 0 value = 2 , lazy = 0 value = 4 , lazy = 0 value = 4 , lazy = 0 value = 2 , lazy = 0 value = 0 , lazy = 0value = 0 value = 0 value = 0 value = 2 value = 2 value = 0 value = 0 value = 0 lazy = 2 lazy = 2 lazy = 2 lazy = 0 lazy = 0 lazy = 0 lazy = 0 lazy = 0 1 2 3 4 5 6 7 8

×