void sort3(int iFrom, int iTo)
   {
     // iTo=19;
      int d=iFrom+getPow(iTo-iFrom);
      //if(d<2)return;
      sort2(iFrom,d);
    
      if(d!=iTo)
      {
        // printf("-------------marl=%d\n",d-iFrom);
         int iDif=iTo-d;
         if(iDif==1)
         {
         }
         else if(iDif==2)
         {
            join(d,d+1,iTo);
         }
         else if(iDif==3)
         {
            join(d,d+1,d+2);
            join(d,d+2,iTo);
         }
         /*
         else if(iTo-d<16)//shis var buut 0
         {
            sort4(d,iTo);
         }
         */
         else
         {
            sort3(d,iTo);
         }
         join(iFrom,d,iTo);
      }
      

   }
Exemple #2
0
 // Concatenation
 friend Hasher operator+(const Hasher &a, const Hasher &b) { return Hasher((1LL * a.h * getPow(b.sz) + b.h) % MOD, a.sz + b.sz); }
Exemple #3
0
 void pop_front(int ch) {
     --sz;
     h = (h - 1LL * getPow(sz) * ch) % MOD;
     if (h < 0) h += MOD;
 }
Exemple #4
0
 // Push-pop
 void push_back_pop_front(int pushCh, int popCh) {
     h = ((h - 1LL * getPow(sz - 1) * popCh) * B + pushCh) % MOD;
     if (h < 0) h += MOD;
 }
Exemple #5
0
 void push_front(int ch) { h = (1LL * ch * getPow(sz) + h) % MOD, ++sz; }