ACM (UVa): 350


Pseudo-Random Numbers

Data type:
Long Integer

Process:
“The Cycle Might not begin with the seed !”
Produce the value of ‘L’ one after another and save those value in an array. Each time, after producing a new value of ‘L’, check whether it is already in the array or not, if found then this the seed value. Array size would be 10000.

Critical Input:
1111 1111 1111 1111
9999 9999 9999 9999
9876 5432 1234 1786
1234 5678 8956 8524
9999 1111 9999 1111

Critical Output:
Case 1: 1
Case 2: 1
Case 3: 77
Case 4: 373
Case 5: 1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s