Huge Mod Input: standard input Output: standard output Time Limit: 1 second The operator for exponentiation is different from the addition, subtraction, multiplication or division operators in the sense that the default associativity for exponentiati…
//题目大意:输入一个n值问洗牌n-1次后是不是会变成初始状态(Jimmy-number),从案例可看出牌1的位置变化为2^i%n,所以最终判断2^(n-1)=1(mod n)是否成立#include<iostream> #include<cstring> #include<cmath> #include<cstdio> using namespace std; long long Montgomery(long long a,long long b,lon…