maximaxi's blog

By maximaxi, history, 9 years ago, In English

Could anyone help me out with Permutation Encryption?

The following is my code so far. pastebin.com/DDfN5Syt

  • Vote: I like it
  • +8
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I had a lot of problems with this. I don't know if this helps, but my answer result in WA, when using for(int i = 0; i<n; i++){ scanf("%d", tmp); // code... } scanf("\n"); string line; getline(cin, line); // code...

but when I changed "scanf("\n");" with "cin.ignore();" it suddenly worked. I don't know why, and I don't know if this helps you. I suppose it had a problem with the compiler of the judge or a weird test case that made something funny. Hope it helps... 4 months later.