Преглед изворни кода

Correct BitSet : range and print

Olivier Marty пре 8 година
родитељ
комит
2476ca0533
1 измењених фајлова са 2 додато и 2 уклоњено
  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");