
please wait
|
|
17,1,2,3,4,5,6,7,10,11,12,13,15,16,20,22,24,26,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 16,1,2,3,4,5,6,7,8,9,10,11,12,16,17,21,26,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 23,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,23,25,26,28,29,35,36,,,,,,,,,,,,,,,,,,,,,,,,,, 27,8,9,11,12,13,14,15,17,19,20,21,22,23,24,26,27,28,29,30,31,32,34,37,39,40,41,42,,,,,,,,,,,,,,,,,,,,,, 27,14,16,17,18,19,20,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,42,43,44,,,,,,,,,,,,,,,,,,,,,, 24,20,24,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45,46,47,48,,,,,,,,,,,,,,,,,,,,,,,,, 16,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 14,35,37,38,39,40,41,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, |
Number of rows read = 8 1 2 4 8 14 20 33 35 1 2 4 8 14 20 33 37 1 2 4 8 14 20 33 38 1 2 4 8 14 20 33 39 1 2 4 8 14 20 33 40 1 2 4 8 14 20 33 41 1 2 4 8 14 20 33 42 1 2 4 8 14 20 33 43 |
|
|
std::set
I can't tell how efficient it is, but sets are ordered and unique and the check whether set contains value is logarithmic. In other words, sorting is automatic byproduct of insertion.within range 1~49 |
char
A sequence could be a word with 8 (nonprintable) characters. std::string rather than std::vector<int>.
|
|
std::set<std::string> getUnique( const std::vector<std::string> & );
|
|
Number of rows read = 8 Currently including row 2 ... Reported size: 194 Currently including row 3 ... Reported size: 3016 Currently including row 4 ... Reported size: 53293 Currently including row 5 ... Reported size: 721922 Currently including row 6 ... Reported size: 8490614 Up to and including row 6(counting from 1), there are 8490614 possible sequences The first 10 are: 1 2 4 8 14 20 1 2 4 8 14 24 1 2 4 8 14 26 1 2 4 8 14 27 1 2 4 8 14 28 1 2 4 8 14 29 1 2 4 8 14 30 1 2 4 8 14 31 1 2 4 8 14 32 1 2 4 8 14 33 |
6. 13 983 816 7. 85 900 584 8. 450 978 066 |
|
|
Number of rows read = 8 Currently including row 1 ... Reported size: 27 Currently including row 2 ... Reported size: 558 Currently including row 3 ... Reported size: 8215 Currently including row 4 ... Reported size: 117888 Currently including row 5 ... Reported size: 1254015 Currently including row 6 ... Reported size: 8490614 Currently including row 7 ... Reported size: 64099944 Up to and including row 7 (counting from 1), there are 64099944 possible sequences 10 of them are: 1 2 4 8 14 20 33 1 3 4 8 14 20 33 2 3 4 8 14 20 33 1 2 5 8 14 20 33 1 3 5 8 14 20 33 2 3 5 8 14 20 33 1 4 5 8 14 20 33 2 4 5 8 14 20 33 3 4 5 8 14 20 33 1 2 6 8 14 20 33 |
|
|
Number of rows read = 8 Including row 1 ... Number of passes = 1 Pass: 1 Size so far: 27 Including row 2 ... Number of passes = 1 Pass: 1 Size so far: 558 Including row 3 ... Number of passes = 1 Pass: 1 Size so far: 8215 Including row 4 ... Number of passes = 1 Pass: 1 Size so far: 117888 Including row 5 ... Number of passes = 1 Pass: 1 Size so far: 1254015 Including row 6 ... Number of passes = 3 Pass: 1 Pass: 2 Pass: 3 Size so far: 8490614 Including row 7 ... Number of passes = 14 Pass: 1 Pass: 2 .... Lines removed .... Pass: 13 Pass: 14 Size so far: 64099944 Including row 8 ... Number of passes = 90 Pass: 1 Pass: 2 .... Lines removed .... Pass: 89 Pass: 90 Size so far: 316370761 Number of possible sequences: 316370761 The first 10 are: 1 3 6 8 14 20 33 35 2 5 7 8 14 20 33 35 3 4 6 9 14 20 33 35 2 3 8 9 14 20 33 35 6 7 8 9 14 20 33 35 3 5 8 10 14 20 33 35 1 7 8 10 14 20 33 35 4 7 9 10 14 20 33 35 1 4 6 11 14 20 33 35 1 2 8 11 14 20 33 35 |