ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1268. Little Chu

Solution
Posted by 2ch 11 Feb 2018 01:49
The problem asks you to find largest primitive root modulo prime.

The algorithm for finding smallest one can be found here
https://e-maxx-eng.appspot.com/algebra/primitive-root.html

An easy modification (flipping one of for-loops) yield an AC.