Protap_Ghose's blog

By Protap_Ghose, history, 9 years ago, In English

Problem link : (http://mirror.codeforces.com/problemset/problem/166/E)

How to solve this problem log(n) with binary exponentiation of some 2 × 2 matrix into power n. Needs some explanation in this problem .Thanks in advance.

Sorry for bad english.

  • Vote: I like it
  • +5
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Not sure how to do it with a 2x2 matrix, but I solved this problem by exponentiating a 4x4 adjacency matrix. I'm guessing the 2x2 solution somehow exploits the symmetry in the tetrahedron.