Advertisement
GerONSo

Untitled

Jan 12th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. for(int i = 0; i < 100000; i++) {
  2. shuffle(all(a), rr);
  3. int cur = 1;
  4. for(int j = 0; j < n; j++) {
  5. cur *= a[j];
  6. cur %= p;
  7. if(cur == x) {
  8. for(int k = 0; k <= j; k++) {
  9. cout << a[k] << " ";
  10. }
  11. return 0;
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement