need help for rank of lexicographically arranged integers using BIT
Difference between en1 and en2, changed 47 character(s)
link of the problem is :↵
https://www.spoj.com/problems/TPGA/↵
https://www.spoj.com/problems/TPGA/↵

i am solving spoj problem in which i have  to find the rank of the permutations when the integers lexicographically arranged ↵
means eg.↵

1 2 3↵

1 3 2↵

2 1 3↵

2 3 1↵

3 1 2↵

3 2 1↵

rank of 132 is 2.↵
now i want to know how can i solve this using binary index tree ,i found this problem on coding portal in which this problem  was queued under the Binary Index Problems someone help. give idea at least.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ak3899 2018-07-19 18:27:51 47
en1 English ak3899 2018-07-19 18:26:58 574 Initial revision (published)