Browse Source

Correct BitSet : range and print

Olivier Marty 8 years ago
parent
commit
2476ca0533
1 changed files with 2 additions and 2 deletions
  1. 2 2
      code/BitSet.cpp

+ 2 - 2
code/BitSet.cpp

@@ -1,4 +1,4 @@
-// ensemble d'entiers entre 1 et MAXN-1
+// ensemble d'entiers entre 0 et MAXN-1
 typedef long long T;
 const int MAXN = 5000;
 const int BITS = (sizeof(T)*8);
@@ -27,7 +27,7 @@ void insert(T a[], int x) {
 }
 void print(T a[]) {
   for(int i = 0; i < SIZE; i++)
-    for(int j = 0; j < BITS-1; j++)
+    for(int j = 0; j < BITS; j++)
       if(a[i] & (((T)1)<<j))
         printf("%d ", i*BITS+j);
   printf("\n");