Implementation of a Fenwick tree as described by Peter M. Fenwick. It will pass Kattis.
For running tests you will need Google C++ Mocking Framework. Build with SCons from root directory.
$ scons
$ cd bin
$ ./run_all_tests
You can also run the Kattis test cases.
$ cat kattis/fenwick1.in | ./fenwick
Peter M. Fenwick. "A new data structure for cumulative frequency tables". Software: Practice and Experiences 24 (3): 327-336, 1994.