Fenwick tree.
Sprague Grundy theorem.
Fenwick Tree template.

From Petr's blog.