Description Little Y finds there is a very interesting formula in mathematics: XY mod Z = K Given X, Y, Z, we all know how to figure out K fast. However, given X, Z, K, could you figure out Y fast? Input Input data consists of no more than 20 test ca…
Description Little Y finds there is a very interesting formula in mathematics: XY mod Z = K Given X, Y, Z, we all know how to figure out K fast. However, given X, Z, K, could you figure out Y fast? Input Input data consists of no more than 20 test ca…
每次把gcd(a,c)提到前面,直到a,c互质,然后就是普通BSGS了 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> #define LL long long using namespace std; struct hashtable{ static const int N=577399; int tot,hash…