Guest User

Untitled

a guest
Jan 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. perm("abc", "012") == "abc"
  2. perm("abc", "210") == "cba"
  3. perm("abc", "201") == "cab"
  4.  
  5. array<int, 10> perm{ 2,7,4,9,8,3,5,0,6,1 };
  6. array<int, 10> perm_inverse;
  7. for (int i = 0; i < 10; ++i) perm_inverse[perm[i]] = i;
  8. for (int i = 0; i < 10; ++i) cout << perm_inverse[i] << ",";
  9.  
  10. While ( seq_c!= end )
  11. {
  12. if( perm(perm(str, seq), seq_c) == str)
  13. return seq_c;
  14. ++seq_c;
  15. }
Add Comment
Please, Sign In to add comment