title: COCI 2006 Contest#1 Bond task explanation
body: <p>Task : <a href="http://hsin.hr/coci/archive/2006_2007/contest1_tasks.pdf" rel="nofollow">http://hsin.hr/coci/archive/2006_2007/contest1_tasks.pdf</a></p>
  
  <p>I read the solution but I don't understand any bit operation shown here:</p>
  
  <pre><code>/*
    Croatian Open Competition in Informatics 2006/2007
    Contest 1 - Task BOND
    Programming language C++
  */
  
  #include &lt;cstdio&gt;
  using namespace std;
  
  int n;
  double prob[21][21];
  
  char vec_rijesio[1&lt;&lt;21];
  double memo[1&lt;&lt;21];
  
  double rijesi( int d, int s ) {
     if ( d == n )
        return 1.0;
  
     if ( vec_rijesio[s] ) return memo[s];
     vec_rijesio[s] = 1;
     double &amp;ret = memo[s];
     ret = 0.0;
  
     for ( int i=0; i&lt;n; ++i )
        if ( ( s &amp; (1&lt;&lt;i) ) == 0 ) {
           double tmp = prob[d][i] * rijesi(d + 1, s|(1&lt;&lt;i));
           if ( tmp &gt; ret ) ret = tmp;
        }
  
     return ret;
  }
  
  int main() {
     scanf( "%d", &amp;n );
  
     for ( int i=0; i&lt;n; ++i )
        for ( int j=0; j&lt;n; ++j ) {
           int x;
           scanf( "%d", &amp;x );
           prob[i][j] = x / 100.0;
        }
  
     double ret = rijesi( 0, 0 );
     printf( "%.6f\n", ret*100.0 );
  
     return 0;
  }
  </code></pre>
  
  <p>Could someone please explain the code for me?
  1. What does "1&lt;&lt;21" mean? 
  2. What happened in the for loop inside rijesi()? 
  Thank you.</p>