#C12247. Unique Random List Generation
Unique Random List Generation
Unique Random List Generation
Problem Statement:
Given an integer ( n ) (with (0 \le n \le 100)), generate a list of ( n ) unique random integers from 1 to 100. For reproducibility, initialize your random number generator with the fixed seed (42). If ( n > 100), output the error message "n should not be greater than 100".
The generated numbers must be output in the order they appear after shuffling, separated by a single space. If ( n = 0 ), output an empty line.
Note: The list is generated by first shuffling the array ( [1, 2, \ldots, 100] ) using the specified seed and then taking the first ( n ) elements.
inputFormat
Input is provided via standard input (stdin) as a single integer ( n ).
outputFormat
If ( n \le 100 ), output ( n ) unique random integers (each between 1 and 100) separated by a space. If ( n = 0 ), output an empty line. Otherwise, if ( n > 100 ), output the error message: "n should not be greater than 100".## sample
10
82 15 4 95 36 32 29 18 14 87