Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

Misa-Misa's blog

By Misa-Misa, history, 6 months ago, In English

Problem

You are give a permutation of length n. Among all rotations of this permutation find out the one with maximum number of cycles.
Cycles here mean that cyles in the graph of permutation which contains edges from element->corresponding index. (One based indexing)

Constraints:

n <= 3e5

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

»
6 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Misa-Misa (previous revision, new revision, compare).