Given N strings, count the number of different strings.
The strings will be generated by a pseudo random number generator, so you don't have to worry about downloading and parsing large text files.
A string is represented by a sequence of integers. The first integer is the number of characters in the string, each one of the following integers encode a character of the string. Such integer sequences can be concatenated to represent multiple strings.
The integer sequence representing the given N strings is generated by the following linear congruential generator:
X := SEED A := 8433437992146984169 B := 7905438737954111703 function nextinteger(): X := (A*X + B) mod (2^64) return X / (2^56)where ^, / and mod are exponentiation, integer division and modulo operations with the usual semantics.
A single line containing two integers: N and SEED.
The number of different strings.
4 11413960417
3
Random numbers are 2, 245, 71, 1, 46, 4, 105, 177, 135, 114, 1, 46, 154, 195, ...
The lengths of the four strings are 2, 1, 4, 1.