Home > Back-end >  An array of reordering problem
An array of reordering problem

Time:05-27

I have, for example, int a [50]={1,1,1,1,1,2,2,2,2,2,... 10,10,10,10,10};
There are number 1-5 each 10
I'm going to make these Numbers reordering {1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10... Save} to vector
Is there a faster way, you can use c + + STL, vector, etc.,
For two cycles typically
Vector Vi.
For (int I=0; i <10; I++) {
For (int j=0; j <5; J++) {
Vi. The push_back (... );

}
}

CodePudding user response:

Whatever, no more than 100000 cycles are not necessary to optimize,

CodePudding user response:

Miss zhao how out of this, for without optimization, if there's actually operating outside

CodePudding user response:

Establish a mapping should be a little better,
  • Related