print() is a function just like every other function (#1101)
* print() is a function just like every other function
This commit is contained in:
committed by
Harshil
parent
6654e1ec7d
commit
89acf5d017
@@ -16,14 +16,14 @@ class FenwickTree:
|
||||
ret += self.ft[i]
|
||||
i -= i & (-i)
|
||||
return ret
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
f = FenwickTree(100)
|
||||
f.update(1,20)
|
||||
f.update(4,4)
|
||||
print (f.query(1))
|
||||
print (f.query(3))
|
||||
print (f.query(4))
|
||||
print(f.query(1))
|
||||
print(f.query(3))
|
||||
print(f.query(4))
|
||||
f.update(2,-5)
|
||||
print (f.query(1))
|
||||
print (f.query(3))
|
||||
print(f.query(1))
|
||||
print(f.query(3))
|
||||
|
||||
Reference in New Issue
Block a user