Skip to main content
Code Review

Return to Revisions

2 of 2
fixed a number spelling: 10^5 is one hundred thousand, not ten thousand
CiaPan
  • 1.9k
  • 1
  • 12
  • 17

You should definitely familiarize with the 'modulus' operator % – calculating the 'un-rotated' (original) position of the item to find is waaay faster than performing a hundred thousand rotations (k is up to \10ドル^5\$) of one hundred thousand-item array (n up to \10ドル^5\$).
It is even faster than a single rotation.

But that is for StackOverflow rather than CodeReview...

CiaPan
  • 1.9k
  • 1
  • 12
  • 17
default

AltStyle によって変換されたページ (->オリジナル) /