# Security Encryption Scheme

# Security Encryption Scheme

giacgbj + 2 comments Hint: !

amanish524 + 1 comment Basically u have to find the factorial of the number.

giacgbj + 0 comments I was not asking for an hint ;-) Re-read it.

- D
kd8bny + 0 comments I laughed

bartonstanley + 1 comment To me there is a typo in the following sentence from the problem:

"We can have encryption schemes where 1 can be mapped to 3 or 2 or 1, 2 can be mapped to the remaining two, and 1 can be mapped to the unmapped one."

I think the last instance of "1" should be "3" so that it reads thusly:

"We can have encryption schemes where 1 can be mapped to 3 or 2 or 1, 2 can be mapped to the remaining two, and 3 can be mapped to the unmapped one."

Does anyone else agree?

Fandekasp + 1 comment correct

bartonstanley + 0 comments Thanks for replying, @Fandekasp!

keshavm021 + 0 comments /

*In c it so simple a basic program to do.*/# include

# include

# include

# include

int main() { int i,n,result; scanf("%d",&n); for(i=0;i

CooL_codeR97 + 0 comments All you have to calculate is factorial

- CJ
pjoscely + 0 comments import java.io.

*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*;public class Solution {

`public static void main(String[] args) { /* Compute n! using iteration*/ Scanner sc = new Scanner (System.in); int n = sc.nextInt(); sc.close(); int ans = 1; for (int i = 1; i <= n; i++) { ans*=i; } System.out.println(ans); }`

}

- JB
choccybikkit + 2 comments Not many of these solutions work for large n ... and cryptography is full of large ns. A real-world input to this problem might have

*M*and*C*representing the possible blocks of say 8 bytes - what's the size of the set of all 64-bit numbers?**18446744073709551616**. Number of bijections?**$VERYBIG**.`Try even 1024 as input ...`

No more comments

Sort 6 Discussions, By:

Please Login in order to post a comment