← RoseCode

ROSECODE 474

Records in Good Sequences

Philippe_57721 · Programming ·

A sequence S of positive integers, not necessarily distinct is a good sequence if:
- when kS, then (k1)S for k2
- the first occurence of k1 in S appears before the last occurence of k

Examples:
{3,1,3,1,2} is not a good sequence: the 1st occurence of 2 is after the last 3.

The following sequences are good:
{2,2,1,3,2}
{1,3,2,1,3}
{3,1,1,2,3}
{3,2,3,1,2}
{1,2,1,3,1}

In a sequence S={a1,a2,a3,,an},aj is a record if it is greater than all elements before it : i<j,ai<aj

The sequence {4,7,5,1,6,8,2,3} contains 3 records: 4,7,8

Amongst all good sequences with 100 elements in {1,2,3,,100}, how many have 3 records?

Answer format: Give the last 10 significant digits (before trailing 0s)